.
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
<div class="alert alert-warning" role="alert">
|
<div class="alert alert-warning" role="alert">
|
||||||
The following questions need marking
|
The following questions need marking
|
||||||
{% for exam_index in unmarked %}
|
{% for exam_index in unmarked %}
|
||||||
<a href="{% url 'longs:mark' exam.pk exam_index %}">{{ exam_index|add:1 }}</a>
|
<a href="{% url 'longs:mark_question_overview' exam.pk exam_index %}">{{ exam_index|add:1 }}</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
{% for question in questions %}
|
{% for question in questions %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{% url 'longs:mark' pk=exam.pk sk=forloop.counter0 %}">Question {{forloop.counter}}</a></td>
|
<td><a href="{% url 'longs:mark_question_overview' pk=exam.pk sk=forloop.counter0 %}">Question {{forloop.counter}}</a></td>
|
||||||
{% for ans, score in by_question|get_item:question %}
|
{% for ans, score in by_question|get_item:question %}
|
||||||
<td class="user-answer-score-{{score}}" title="answer score: {{score}}">{{score}}</td>
|
<td class="user-answer-score-{{score}}" title="answer score: {{score}}">{{score}}</td>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
{% for exam in exams %}
|
{% for exam in exams %}
|
||||||
<div class="longs">
|
<div class="longs">
|
||||||
<h1><a href="{% url 'longs:exam_overview' pk=exam.pk %}">Exam: {{ exam.name }} </a></h1>
|
<h1><a href="{% url 'longs:exam_overview' pk=exam.pk %}">Exam: {{ exam.name }} </a></h1>
|
||||||
{% if request.user.is_staff %}<a href="{% url 'longs:mark' pk=exam.pk sk=0 %}">Mark answers</a>{% endif %}
|
{% if request.user.is_staff %}<a href="{% url 'longs:mark_question_overview' pk=exam.pk sk=0 %}">Mark answers</a>{% endif %}
|
||||||
{% if request.user.is_staff %}<a href="{% url 'longs:exam_scores_cid' pk=exam.pk %}">Scores</a>{% endif %}
|
{% if request.user.is_staff %}<a href="{% url 'longs:exam_scores_cid' pk=exam.pk %}">Scores</a>{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -32,12 +32,12 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<div>
|
<div>
|
||||||
{% if question_details.current > 1 %}
|
{% if question_details.current > 1 %}
|
||||||
<a href="{% url 'longs:mark' exam.id question_details.current|add:'-2' %}"
|
<a href="{% url 'longs:mark_question_overview' exam.id question_details.current|add:'-2' %}"
|
||||||
title="Previous question">Previous</a>
|
title="Previous question">Previous</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if question_details.current >= question_details.total %}
|
{% if question_details.current >= question_details.total %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{% url 'longs:mark' exam.id question_details.current %}" title="Next question">Next</a>
|
<a href="{% url 'longs:mark_question_overview' exam.id question_details.current %}" title="Next question">Next</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,12 +9,12 @@
|
|||||||
title="Edit the user answer using the admin interface">Admin
|
title="Edit the user answer using the admin interface">Admin
|
||||||
Edit (user answer)</a>
|
Edit (user answer)</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<h2>Marking question <a href="{% url 'longs:mark' exam.id question_details.current|add:'-1' %}"
|
<h2>Marking question <a href="{% url 'longs:mark_question_overview' exam.id question_details.current|add:'-1' %}"
|
||||||
title="View question answers">{{question_details.current}}</a> of {{question_details.total}}</h2>
|
title="View question answers">{{question_details.current}}</a> of {{question_details.total}}</h2>
|
||||||
|
|
||||||
{% if not next_unmarked_id and not unmarked %}
|
{% if not next_unmarked_id and not unmarked %}
|
||||||
<div class="alert alert-info sticky-alert" role="alert">Success! Marking question complete. <br />Return to <a
|
<div class="alert alert-info sticky-alert" role="alert">Success! Marking question complete. <br />Return to <a
|
||||||
href="{% url 'longs:mark' exam.id question_details.current|add:'-1' %}">question
|
href="{% url 'longs:mark_question_overview' exam.id question_details.current|add:'-1' %}">question
|
||||||
overview</a>, <a href="{% url 'longs:mark_overview' pk=exam.pk %}">marking
|
overview</a>, <a href="{% url 'longs:mark_overview' pk=exam.pk %}">marking
|
||||||
overview</a><br />
|
overview</a><br />
|
||||||
{% if previous_cid %}
|
{% if previous_cid %}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<ul id="question-mark-list">
|
<ul id="question-mark-list">
|
||||||
{% for question, unmarked_count in question_unmarked_map %}
|
{% for question, unmarked_count in question_unmarked_map %}
|
||||||
<li data-markcount={{unmarked_count}} {% if unmarked_count %}class="unmarked" {% endif %}><a
|
<li data-markcount={{unmarked_count}} {% if unmarked_count %}class="unmarked" {% endif %}><a
|
||||||
href="{% url 'longs:mark' pk=exam.pk sk=forloop.counter0 %}">Question {{forloop.counter }}:
|
href="{% url 'longs:mark_question_overview' pk=exam.pk sk=forloop.counter0 %}">Question {{forloop.counter }}:
|
||||||
{{ question }}</a><br /> Answers to mark: {{unmarked_count}}</li>
|
{{ question }}</a><br /> Answers to mark: {{unmarked_count}}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
+1
-1
@@ -67,7 +67,7 @@ urlpatterns = [
|
|||||||
name="question_review",
|
name="question_review",
|
||||||
),
|
),
|
||||||
path("exam/<int:exam_id>/<int:question_number>/<int:cid>/mark", views.mark_answer, name="mark_answer"),
|
path("exam/<int:exam_id>/<int:question_number>/<int:cid>/mark", views.mark_answer, name="mark_answer"),
|
||||||
path("exam/<int:pk>/<int:sk>/mark", views.mark, name="mark"),
|
path("exam/<int:pk>/<int:sk>/mark", views.mark_question_overview, name="mark_question_overview"),
|
||||||
path("exam/<int:pk>/mark", views.LongExamViews.mark_overview, name="mark_overview"),
|
path("exam/<int:pk>/mark", views.LongExamViews.mark_overview, name="mark_overview"),
|
||||||
# path("exam/<int:pk>/<int:sk>/", views.exam_take, name="exam_take"),
|
# path("exam/<int:pk>/<int:sk>/", views.exam_take, name="exam_take"),
|
||||||
path(
|
path(
|
||||||
|
|||||||
+3
-3
@@ -697,7 +697,7 @@ def mark_answer(request, exam_id, question_number, cid):
|
|||||||
if "save" in request.POST:
|
if "save" in request.POST:
|
||||||
return redirect("longs:mark_answer", exam_id=exam_id, question_number=question_number, cid=cid)
|
return redirect("longs:mark_answer", exam_id=exam_id, question_number=question_number, cid=cid)
|
||||||
#elif "previous" in request.POST:
|
#elif "previous" in request.POST:
|
||||||
# return redirect("longs:mark", pk=exam_id, sk=n - 1)
|
# return redirect("longs:mark_question_overview", pk=exam_id, sk=n - 1)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
form = MarkLongQuestionForm(initial={'score': answer.score})
|
form = MarkLongQuestionForm(initial={'score': answer.score})
|
||||||
@@ -722,7 +722,7 @@ def mark_answer(request, exam_id, question_number, cid):
|
|||||||
# @user_passes_test(user_is_admin, login_url="/accounts/login")
|
# @user_passes_test(user_is_admin, login_url="/accounts/login")
|
||||||
@login_required
|
@login_required
|
||||||
@user_is_long_marker
|
@user_is_long_marker
|
||||||
def mark(request, pk, sk):
|
def mark_question_overview(request, pk, sk):
|
||||||
exam = get_object_or_404(Exam, pk=pk)
|
exam = get_object_or_404(Exam, pk=pk)
|
||||||
|
|
||||||
questions = exam.exam_questions.all()
|
questions = exam.exam_questions.all()
|
||||||
@@ -746,7 +746,7 @@ def mark(request, pk, sk):
|
|||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
"longs/mark.html",
|
"longs/mark_question_overview.html",
|
||||||
{
|
{
|
||||||
"exam": exam,
|
"exam": exam,
|
||||||
"question": question,
|
"question": question,
|
||||||
|
|||||||
Reference in New Issue
Block a user