.
This commit is contained in:
@@ -78,7 +78,7 @@
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if previous > -1 %}
|
||||
{% if previous %}
|
||||
<button type="submit" name="previous" class="save btn btn-default">Previous</button>
|
||||
{% endif %}
|
||||
{% if next %}
|
||||
|
||||
+23
-20
@@ -1256,31 +1256,33 @@ def collection_case_view_take(request, pk, case_number, cid, passcode):
|
||||
cases = collection.cases.all().order_by("casedetail__sort_order").prefetch_related()
|
||||
case = cases[case_number]
|
||||
|
||||
c = CidUser.objects.filter(cid=cid).first()
|
||||
cid_user_exam = collection.get_or_create_cid_user_exam(cid_user=c)
|
||||
case_detail = CaseDetail.objects.get(case=case, collection=collection)
|
||||
answer = case_detail.cidreportanswer_set.filter(cid=cid).first()
|
||||
if collection.collection_type == "REP":
|
||||
c = CidUser.objects.filter(cid=cid).first()
|
||||
cid_user_exam = collection.get_or_create_cid_user_exam(cid_user=c)
|
||||
case_detail = CaseDetail.objects.get(case=case, collection=collection)
|
||||
answer = case_detail.cidreportanswer_set.filter(cid=cid).first()
|
||||
|
||||
if request.method == "POST":
|
||||
if not collection.publish_results:
|
||||
if answer:
|
||||
form = CidReportAnswerForm(request.POST, instance=answer)
|
||||
else:
|
||||
form = CidReportAnswerForm(request.POST)
|
||||
if form.is_valid():
|
||||
answer = form.save(commit=False)
|
||||
answer.cid = cid
|
||||
answer.question = case_detail
|
||||
# answer.published_date = timezone.now()
|
||||
answer.save()
|
||||
if collection.collection_type == "REP":
|
||||
if not collection.publish_results:
|
||||
if answer:
|
||||
form = CidReportAnswerForm(request.POST, instance=answer)
|
||||
else:
|
||||
form = CidReportAnswerForm(request.POST)
|
||||
if form.is_valid():
|
||||
answer = form.save(commit=False)
|
||||
answer.cid = cid
|
||||
answer.question = case_detail
|
||||
# answer.published_date = timezone.now()
|
||||
answer.save()
|
||||
|
||||
cid_user_exam.end_time = timezone.now()
|
||||
cid_user_exam.save()
|
||||
cid_user_exam.end_time = timezone.now()
|
||||
cid_user_exam.save()
|
||||
|
||||
kwargs = {"pk": pk, "cid": cid, "passcode": passcode}
|
||||
redirect_url = "atlas:collection_case_view_take"
|
||||
kwargs = {"pk": pk, "cid": cid, "passcode": passcode}
|
||||
redirect_url = "atlas:collection_case_view_take"
|
||||
|
||||
if cid is None:
|
||||
else:
|
||||
kwargs = {"pk": pk}
|
||||
redirect_url = "atlas:collection_case_view_review"
|
||||
|
||||
@@ -1305,6 +1307,7 @@ def collection_case_view_take(request, pk, case_number, cid, passcode):
|
||||
|
||||
series_list = case.series.all().prefetch_related("images", "examination", "plane")
|
||||
|
||||
print("case_no")
|
||||
previous = case_number > 0
|
||||
next = case_number < (len(cases) - 1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user