"""This module contains the apiv2 related urls for the ``questionnaires`` app"""

from rest_framework_extensions.routers import ExtendedSimpleRouter

from . import views

questionnaires_router = ExtendedSimpleRouter()
questionnaires_router.register(
    r'questionnaires',
    views.QuestionnaireViewSet,
    base_name='questionnaire'
)

questionnaires_router.register(
    r'openanswers',
    views.OpenAnswerViewSet,
    base_name='openanswer',
)
questionnaires_router.register(
    r'choicesanswers',
    views.ChoicesAnswerViewSet,
    base_name='choicesanswer',
)
questionnaires_router.register(
    r'questionnaires/(?P<questionnaire_uuid>[^/]+)/answers',
    views.ReadAnswerViewSet,
    base_name='answer',
)

urlpatterns = questionnaires_router.urls
