diff --git a/rapids/models.py b/rapids/models.py index 74be3860..61b403c9 100644 --- a/rapids/models.py +++ b/rapids/models.py @@ -663,6 +663,7 @@ class CidUserAnswer(models.Model): mark = "unmarked" return mark +# Not used @reversion.register class AnswerMarks(models.Model): score = models.CharField( diff --git a/rapids/templates/rapids/mark.html b/rapids/templates/rapids/mark.html index 617c7728..b2e7696a 100644 --- a/rapids/templates/rapids/mark.html +++ b/rapids/templates/rapids/mark.html @@ -1,88 +1,90 @@ {% extends 'rapids/exams.html' %} {% block content %} -

Marking question {{question_details.current}} of {{question_details.total}}

-View Edit Admin - Edit -{% if question.normal %} -

This question is normal

-Answers will be automatically marked.
+

Marking question {{question_details.current}} of {{question_details.total}}{% if review %} [REVIEW]{% endif %}

+ View Edit Admin + Edit + {% if question.normal %} +

This question is normal

+ Answers will be automatically marked.
-{% if incorrect_answers %} -

The following answers have been submitted for this question

-
- -
-{% endif %} -{% else %} -

This question is abnormal

-Answers marked as normal will be automatically marked.
-Region: {{ question.get_regions }}, Abnormalities: {{ question.get_abnormalities }} -{% endif %} -
-
-
-
{% csrf_token %} - {% if not question.normal %} - Click each answer to toggle through marks awarded (as per colour)
- {% if unmarked_exam_answers_only %} - Showing exam answers only (view all) - {% else %} - Showing all answers (view unmarked exam answers) + {% if incorrect_answers %} +

The following answers have been submitted for this question

+
+
    + {% for answer in incorrect_answers %} +
  • +
    {{ answer }}
    +
  • + {% endfor %} +
+
{% endif %} - -
- Unmarked: -
    - {% for answer in user_answers %} -
  • -
    {{ answer }}
    -
  • - {% endfor %} -
- Marked: -
    - {% for answer in correct_answers %} -
  • -
    {{ answer }}
    -
  • - {% endfor %} - {% for answer in half_mark_answers %} -
  • -
    {{ answer }}
    -
  • - {% endfor %} - {% for answer in incorrect_answers %} -
  • -
    {{ answer }}
    -
  • - {% endfor %} -
-
Key: 2 Marks, 1 - Mark, 0 Marks
-
- {% endif %} - {% if question_details.current > 1 %} - - {% endif %} - - {% if question_details.current >= question_details.total %} - {% else %} - - - {% endif %} - - {{ form.as_p }} - -
-
-{% endblock %} \ No newline at end of file + {% else %} +

This question is abnormal

+ Answers marked as normal will be automatically marked.
+ Region: {{ question.get_regions }}, Abnormalities: {{ question.get_abnormalities }} + {% endif %} +
+
+
+
{% csrf_token %} + {% if not question.normal %} + Click each answer to toggle through marks awarded (as per colour)
+ {% if not review %} + {% if unmarked_exam_answers_only %} + Showing exam answers only (view all) + {% else %} + Showing all answers (view unmarked exam answers) + {% endif %} + {% endif %} + +
+ Unmarked: +
    + {% for answer in user_answers %} +
  • +
    {{ answer }}
    +
  • + {% endfor %} +
+ Marked: +
    + {% for answer in correct_answers %} +
  • +
    {{ answer }}
    +
  • + {% endfor %} + {% for answer in half_mark_answers %} +
  • +
    {{ answer }}
    +
  • + {% endfor %} + {% for answer in incorrect_answers %} +
  • +
    {{ answer }}
    +
  • + {% endfor %} +
+
Key: 2 Marks, 1 + Mark, 0 Marks
+
+ {% endif %} + {% if question_details.current > 1 %} + + {% endif %} + + {% if question_details.current >= question_details.total %} + {% else %} + + + {% endif %} + + {{ form.as_p }} + +
+
+{% endblock %} diff --git a/rapids/urls.py b/rapids/urls.py index d431c74c..0721841c 100755 --- a/rapids/urls.py +++ b/rapids/urls.py @@ -44,6 +44,7 @@ urlpatterns = [ ), path("exam///mark", views.mark, name="mark"), path("exam///mark/all", views.mark_all, name="mark_all"), + path("exam///mark/review", views.mark_all, name="mark_review"), path( "exam//mark", views.RapidExamViews.mark_overview, name="mark_overview" ), diff --git a/rapids/views.py b/rapids/views.py index 0e8a871e..139ed639 100755 --- a/rapids/views.py +++ b/rapids/views.py @@ -572,16 +572,23 @@ def loadJsonAnswer(answer): return True, None +@login_required def mark_all(request, exam_pk, sk): return mark(request, exam_pk, sk, unmarked_exam_answers_only=False) +@login_required +def mark_review(request, exam_pk, sk): + return mark(request, exam_pk, sk, unmarked_exam_answers_only=False, review=True) + # @user_passes_test(user_is_admin, login_url="/accounts/login") @login_required -def mark(request, exam_pk, sk, unmarked_exam_answers_only=True): +def mark(request, exam_pk, sk, unmarked_exam_answers_only=True, review=False): exam = get_object_or_404(Exam, pk=exam_pk) mark_url = "rapids:mark" - if not unmarked_exam_answers_only: + if review: + mark_url = "rapids:mark_review" + elif not unmarked_exam_answers_only: mark_url = "rapids:mark_all" questions = exam.exam_questions.all() @@ -603,15 +610,6 @@ def mark(request, exam_pk, sk, unmarked_exam_answers_only=True): for ans in question.answers.all(): answers_dict[ans.answer_compare] = ans - #marked_answers_set = set(answers_dict.keys()) - - # correct_answers = [i.answer.lower() for i in question.answers.all()] - # half_correct_answers = [ - # i.answer.lower() for i in question.half_mark_answers.all() - # ] - # incorrect_answers = [ - # i.answer.lower() for i in question.incorrect_answers.all() - # ] if unmarked_exam_answers_only: unmarked_user_answers = question.get_unmarked_user_answers(exam_pk=exam_pk) @@ -692,6 +690,7 @@ def mark(request, exam_pk, sk, unmarked_exam_answers_only=True): { "exam": exam, "form": form, + "review": review, "question": question, "question_number": n, "question_details": question_details,