fix a few missing things
This commit is contained in:
+18
-2
@@ -47,6 +47,7 @@ from .forms import (
|
||||
CidReportAnswerMarkForm,
|
||||
ConditionAutocompleteForm,
|
||||
ConditionForm,
|
||||
ExamGroupsForm,
|
||||
FindingForm,
|
||||
JsonAnswerForm,
|
||||
PriorCaseForm,
|
||||
@@ -144,6 +145,7 @@ from django.forms.models import model_to_dict
|
||||
from generic.views import (
|
||||
AuthorRequiredMixin,
|
||||
ExamCloneMixin,
|
||||
ExamGroupsUpdateBase,
|
||||
ExamViews,
|
||||
SeriesImagesZipViewBase,
|
||||
)
|
||||
@@ -2713,6 +2715,15 @@ class CaseCollectionAuthorUpdate(RevisionMixin, AuthorRequiredMixin, UpdateView)
|
||||
context["collection"] = context["object"]
|
||||
return context
|
||||
|
||||
class ExamGroupsUpdate(ExamGroupsUpdateBase):
|
||||
model = CaseCollection
|
||||
form_class = ExamGroupsForm
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(ExamGroupsUpdate, self).get_context_data(**kwargs)
|
||||
context["exam"] = context["object"]
|
||||
return context
|
||||
|
||||
|
||||
class CaseAuthorUpdate(RevisionMixin, AuthorRequiredMixin, UpdateView):
|
||||
model = Case
|
||||
@@ -2816,8 +2827,12 @@ def collection_reset_answers(request, exam_id: int):
|
||||
case_details = collection.casedetail_set.all().prefetch_related()
|
||||
|
||||
# Delete all answers
|
||||
cid_answers = case_details.cidreportanswer_set.all()
|
||||
user_answers = case_details.userreportanswer_set.all()
|
||||
for case in case_details:
|
||||
cid_answers = case.cidreportanswer_set.all()
|
||||
|
||||
cid_answers.delete()
|
||||
user_answers = case.userreportanswer_set.all()
|
||||
user_answers.delete()
|
||||
|
||||
|
||||
# User statuses
|
||||
@@ -2825,6 +2840,7 @@ def collection_reset_answers(request, exam_id: int):
|
||||
|
||||
# CidUserExams
|
||||
collection.cid_users.all().delete()
|
||||
return HttpResponse("Success")
|
||||
|
||||
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user