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