.
This commit is contained in:
@@ -767,11 +767,19 @@ class CidUserAnswer(models.Model):
|
|||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def get_mark_status(self):
|
||||||
|
mark_objects = self.mark.objects.all()
|
||||||
|
if not mark_objects:
|
||||||
|
return "Unmarked"
|
||||||
|
markers = ",".join([i.marker for i in mark_objects])
|
||||||
|
return f"Marked by {markers}"
|
||||||
|
|
||||||
def get_answer_score(self):
|
def get_answer_score(self):
|
||||||
if self.score == "":
|
if self.score == "":
|
||||||
return ""
|
return ""
|
||||||
return float(self.score)
|
return float(self.score)
|
||||||
|
|
||||||
|
|
||||||
@reversion.register
|
@reversion.register
|
||||||
class AnswerMarks(models.Model):
|
class AnswerMarks(models.Model):
|
||||||
score = models.CharField(
|
score = models.CharField(
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
{% extends 'longs/exams.html' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<a href="{% url 'longs:exam_question_detail' exam.id question_details.current|add:'-1' %}"
|
||||||
|
title="View the Question">View</a>
|
||||||
|
<a href="{% url 'longs:long_update' question.id %}" title="Edit the Question">Edit</a> <a
|
||||||
|
href="{% url 'admin:longs_long_change' question.id %}" title="Edit the Question using the admin interface">Admin
|
||||||
|
Edit</a>
|
||||||
|
<h2>Marking question {{question_details.current}} of {{question_details.total}}</h2>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
{% if not unmarked_count %}
|
||||||
|
<div class="alert alert-info" role="alert">No answers to mark.</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="alert alert-warning" role="alert">{{unmarked_count}} answer(s) to mark.</div>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
Answers:
|
||||||
|
<ul>
|
||||||
|
{% for answer in user_answers %}
|
||||||
|
<li>
|
||||||
|
<a href="{% url 'longs:mark_answer' exam.id question_details.current|add:'-1' answer.cid %}"
|
||||||
|
title="Click to mark"> {{answer.cid}}</a>:
|
||||||
|
{% if answer.is_marked %}
|
||||||
|
Score {{answer.get_answer_score}}
|
||||||
|
{% else %}
|
||||||
|
{{answer.get_mark_status}}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
<div>
|
||||||
|
{% if question_details.current > 1 %}
|
||||||
|
<a href="{% url 'longs:mark_question_overview' exam.id question_details.current|add:'-2' %}"
|
||||||
|
title="Previous question">Previous</a>
|
||||||
|
{% endif %}
|
||||||
|
{% if question_details.current >= question_details.total %}
|
||||||
|
{% else %}
|
||||||
|
<a href="{% url 'longs:mark_question_overview' exam.id question_details.current %}" title="Next question">Next</a>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
+14
-1
@@ -781,9 +781,22 @@ def mark_question_overview(request, exam_id, sk):
|
|||||||
|
|
||||||
unmarked_count = user_answers.filter(score=CidUserAnswer.ScoreOptions.UNMARKED).count()
|
unmarked_count = user_answers.filter(score=CidUserAnswer.ScoreOptions.UNMARKED).count()
|
||||||
|
|
||||||
|
if exam.double_mark:
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
"longs/mark_question_overview.html",
|
"longs/mark_question_double_overview.html",
|
||||||
|
{
|
||||||
|
"exam": exam,
|
||||||
|
"question": question,
|
||||||
|
"question_details": question_details,
|
||||||
|
"user_answers": user_answers,
|
||||||
|
"unmarked_count": unmarked_count,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
return render(
|
||||||
|
request,
|
||||||
|
"longs/mark_question_single_overview.html",
|
||||||
{
|
{
|
||||||
"exam": exam,
|
"exam": exam,
|
||||||
"question": question,
|
"question": question,
|
||||||
|
|||||||
Reference in New Issue
Block a user