diff --git a/physics/templates/physics/exam_take.html b/physics/templates/physics/exam_take.html index c96735c9..ebcf8b49 100755 --- a/physics/templates/physics/exam_take.html +++ b/physics/templates/physics/exam_take.html @@ -1,104 +1,104 @@ {% extends 'base.html' %} {% block content %} -CID: {{cid}} -
-

Question [{{pos|add:1}}/{{exam_length}}]

- {% if exam.publish_results %} - - {% endif %} - -
-

{{question.stem|safe}}

-
- - - -
- -
{% csrf_token %} -
- {{form}} + CID: {{cid}} +
+

Question [{{pos|add:1}}/{{exam_length}}]

+ {% if exam.publish_results %} + + {% endif %} - {% if previous > -1 %} - - {% endif %} - {% if next %} - - {% else %} - {% if not exam.publish_results %} - - {% endif %} - {% endif %} +
+

{{question.stem|safe}}

+
+
    +
  • {{question.a|safe}}
  • +
  • {{question.b|safe}}
  • +
  • {{question.c|safe}}
  • +
  • {{question.d|safe}}
  • +
  • {{question.e|safe}}
  • +
- {% if exam.publish_results and question.feedback %} -

Feedback

-

{{question.feedback|safe}}

- {% endif %} -
- - - + +
+ +
{% csrf_token %} +
+ {{form}} +
+ + {% if previous > -1 %} + + {% endif %} + {% if next %} + + {% else %} + {% if not exam.publish_results %} + + {% endif %} + {% endif %} + + {% if exam.publish_results and question.feedback %} +

Feedback

+

{{question.feedback|safe}}

+ {% endif %} +
+ + +
+
-
-

Questions

- {% endblock %} {% block js %} - + } + $("button.question-menu-item").on("click", (e) => { + console.log(e.currentTarget.dataset.qn); + document.getElementById("goto-button").value = e.currentTarget.dataset.qn; + $("#goto-button").click(); + }); + /* beautify ignore:end */ + }) + {% endblock %} {% block css %} - -{% endblock %} \ No newline at end of file + .selected { + border: 1px solid purple; + } + +{% endblock %} diff --git a/physics/views.py b/physics/views.py index 019bddd7..b3a4cacf 100644 --- a/physics/views.py +++ b/physics/views.py @@ -337,13 +337,13 @@ def exam_take(request, pk, sk, cid): # answer.published_date = timezone.now() answer.save() if "next" in request.POST: - return redirect("sbas:exam_take", pk=pk, sk=pos + 1, cid=cid) + return redirect("physics:exam_take", pk=pk, sk=pos + 1, cid=cid) elif "previous" in request.POST: - return redirect("sbas:exam_take", pk=pk, sk=pos - 1, cid=cid) + return redirect("physics:exam_take", pk=pk, sk=pos - 1, cid=cid) elif "finish" in request.POST: - return redirect("sbas:exam_finish", pk=pk, cid=cid) + return redirect("physics:exam_finish", pk=pk, cid=cid) elif "goto" in request.POST: - return redirect("sbas:exam_take", pk=pk, sk=int(request.POST.get("goto")), cid=cid) + return redirect("physics:exam_take", pk=pk, sk=int(request.POST.get("goto")), cid=cid) else: form = CidUserAnswerForm(instance=answer)