.
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
{% extends 'rapids/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
{% for exam in exams %}
|
||||
<div class="rapids">
|
||||
<h1><a href="{% url 'rapids:exam_overview' pk=exam.pk %}">Exam: {{ exam.name }} </a></h1>
|
||||
{% if request.user.is_staff %}<a href="{% url 'rapids:mark' exam_pk=exam.pk sk=0 %}">Mark answers</a>{% endif %}
|
||||
{% if request.user.is_staff %}<a href="{% url 'rapids:exam_scores_cid' pk=exam.pk %}">Scores</a>{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
{% for exam in exams %}
|
||||
<div class="rapids">
|
||||
<h1><a href="{% url 'rapids:exam_overview' pk=exam.pk %}">Exam: {{ exam.name }} </a></h1>
|
||||
{% if exam.exam_mode %}
|
||||
{% if request.user.is_staff %}<a href="{% url 'rapids:mark' exam_pk=exam.pk sk=0 %}">Mark answers</a>{% endif %}
|
||||
{% if request.user.is_staff %}<a href="{% url 'rapids:exam_scores_cid' pk=exam.pk %}">Scores</a>{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
+9
-1
@@ -581,6 +581,9 @@ def mark_review(request, exam_pk, sk):
|
||||
def mark(request, exam_pk, sk, unmarked_exam_answers_only=True, review=False):
|
||||
exam = get_object_or_404(Exam, pk=exam_pk)
|
||||
|
||||
if not exam.exam_mode:
|
||||
raise Http404("Packet not in exam mode")
|
||||
|
||||
mark_url = "rapids:mark"
|
||||
if review:
|
||||
mark_url = "rapids:mark_review"
|
||||
@@ -728,6 +731,9 @@ def mark(request, exam_pk, sk, unmarked_exam_answers_only=True, review=False):
|
||||
def exam_scores_cid(request, pk):
|
||||
exam = get_object_or_404(Exam, pk=pk)
|
||||
|
||||
if not exam.exam_mode:
|
||||
raise Http404("Packet not in exam mode")
|
||||
|
||||
questions = exam.exam_questions.all()
|
||||
|
||||
cids = (
|
||||
@@ -841,8 +847,10 @@ def exam_scores_cid(request, pk):
|
||||
def exam_scores_cid_user(request, pk, cid):
|
||||
exam = get_object_or_404(Exam, pk=pk)
|
||||
|
||||
if not exam.exam_mode:
|
||||
raise Http404("Packet not in exam mode")
|
||||
|
||||
# TODO:Need some kind of test for cid
|
||||
#cid = sk
|
||||
|
||||
questions = exam.exam_questions.all()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user