from django.urls import path, include

from generic.urls import generic_exam_urls, generic_view_urls
from . import views

app_name = "longs"

urlpatterns = [
    path("author/<int:pk>/", views.author_detail, name="author_detail"),
    path("author/", views.author_list, name="author_list"),
    path("question/", views.LongView.as_view(), name="question_view"),
    path("series/", views.LongSeriesView.as_view(), name="series_view"),
    path("series/<int:pk>", views.series_detail, name="series_detail"),
    path(
        "series/<int:pk>/order_dicom",
        views.long_series_order_dicom,
        name="long_series_order_dicom",
    ),
    path(
        "series/<int:pk>/download",
        views.SeriesImagesZipView.as_view(),
        name="long_series_download",
    ),
    path(
        "series/<int:pk>/order_dicom_instance",
        views.long_series_order_dicom_instance,
        name="long_series_order_dicom_instance",
    ),
    path(
        "series/<int:pk>/order_dicom_SeriesInstanceUID",
        views.long_series_order_dicom_SeriesInstanceUID,
        name="long_series_order_dicom_SeriesInstanceUID",
    ),
    path(
        "series/<int:pk>/order_upload_filename",
        views.long_series_order_upload_filename,
        name="long_series_order_upload_filename",
    ),
    path(
        "series/<int:pk>/delete",
        views.LongSeriesDelete.as_view(),
        name="long_series_delete",
    ),
    # path("unchecked/", views.unchecked_list, name="unchecked_list"),
    # path("verified/<int:pk>/", views.verified_detail, name="verified_detail"),
    path("question/<int:pk>/", views.question_detail, name="question_detail"),
    path("question/<int:pk>/json", views.question_json, name="question_json"),
    path(
        "question/<int:pk>/json/unbased",
        views.question_json_unbased,
        name="question_json_unbased",
    ),
    path(
        "question/<int:pk>/json/recreate",
        views.question_json_recreate,
        name="question_json_recreate",
    ),
    path("question/<int:pk>/split", views.long_split, name="long_split"),
    path("question/<int:pk>/clone", views.LongClone.as_view(), name="long_clone"),
    # path("verified/", views.verified, name="verified"),
    # path("all_questions/", views.all_questions, name="all_questions"),
    path("question/<int:pk>/scrap", views.long_scrap, name="long_scrap"),
    path("question/<int:pk>/delete", views.LongDelete.as_view(), name="long_delete"),
#    path(
#        "exam/<int:pk>/review",
#        views.question_review,
#        name="question_review",
#    ),
    path(
        "exam/<int:exam_id>/<int:question_number>/<int:answer_id>/mark",
        views.mark_answer,
        name="mark_answer",
    ),
    path(
        "exam/<int:exam_id>/<int:question_number>/<int:answer_id>/mark_override",
        views.mark_answer_override,
        name="mark_answer_override",
    ),
    path(
        "exam/<int:exam_id>/<int:sk>/mark",
        views.mark,
        name="mark",
    ),
    path("exam/<int:pk>/markers", views.ExamMarkersUpdate.as_view(), name="exam_markers"),
    path("exam/<int:pk>/groups", views.ExamGroupsUpdate.as_view(), name="exam_groups_edit"),
    path("exam/<int:pk>/authors", views.ExamAuthorUpdate.as_view(), name="exam_authors"),
    path(
        "exam/<int:pk>/question_json_refresh",
        views.refresh_exam_question_json,
        name="refresh_exam_question_json",
    ),
    #path("exam/<int:pk>/scores", views.exam_scores_all, name="exam_scores_all"),
#    path(
#        "exam/<int:pk>/scores/<int:cid>/<str:passcode>/",
#        views.exam_scores_cid_user,
#        name="exam_scores_cid_user",
#    ),
    path("exam/create", views.ExamCreate.as_view(), name="exam_create"),
    path("exam/<int:exam_id>/clone", views.ExamClone.as_view(), name="exam_clone"),
    path("exam/<int:pk>/update", views.ExamUpdate.as_view(), name="exam_update"),
    path("exam/<int:pk>/delete", views.ExamDelete.as_view(), name="exam_delete"),
    path("create/", views.LongCreate.as_view(), name="question_create"),
    path("create/series", views.LongSeriesCreate.as_view(), name="series_create"),
    path(
        "create/series/<int:pk>",
        views.LongSeriesCreate.as_view(),
        name="long_series_id_create",
    ),
    #    path("region/create/", views.create_region, name="create_region"),
    #    path("region/ajax/get_region_id", views.get_region_id, name="get_region_id"),
    #    path("abnormality/create/", views.create_abnormality, name="create_abnormality"),
    #    path(
    #        "abnormality/ajax/get_abnormality_id",
    #        views.get_abnormality_id,
    #        name="get_abnormality_id",
    #    ),
    path("examination/create/", views.create_examination, name="create_examination"),
    path(
        "examination/ajax/get_examination_id",
        views.get_examination_id,
        name="get_examination_id",
    ),
    path(
        "question/<int:pk>/update",
        views.LongUpdate.as_view(),
        name="long_update",
    ),
    path(
        "series/<int:pk>/update",
        views.LongSeriesUpdate.as_view(),
        name="long_series_update",
    ),
    path(
        "user_answers/",
        views.UserAnswerTableView.as_view(),
        name="user_answer_table_view",
    ),
    path(
        "user_answers/<int:pk>", views.UserAnswerView.as_view(), name="user_answer_view"
    ),
    path(
        "user_answers/<int:pk>/delete",
        views.UserAnswerDelete.as_view(),
        name="user_answer_delete",
    ),
    path(
        "user_answers/delete",
        views.user_answer_delete_multiple,
        name="user_answer_delete_multiple",
    ),
]


urlpatterns.extend(generic_view_urls(views.GenericViews))
urlpatterns.extend(generic_exam_urls(views.GenericExamViews))