From d47462be9898b3895d166f85c4bade7ad6b115e2 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 26 Dec 2020 20:45:26 +0000 Subject: [PATCH] numerous improvements and fixes --- anatomy/static/css/anatomy.css | 15 +++++++++++ anatomy/static/js/anatomy.js | 2 +- anatomy/templates/anatomy/exam_scores.html | 15 +++-------- anatomy/views.py | 2 +- physics/templates/physics/exam_scores.html | 10 +------ .../templates/physics/exam_scores_user.html | 2 +- physics/templates/physics/exam_take.html | 27 ++++++++----------- physics/views.py | 2 +- 8 files changed, 34 insertions(+), 41 deletions(-) diff --git a/anatomy/static/css/anatomy.css b/anatomy/static/css/anatomy.css index 72d3a53d..13e1f274 100644 --- a/anatomy/static/css/anatomy.css +++ b/anatomy/static/css/anatomy.css @@ -23,14 +23,29 @@ a, a:link { color: green; } +.answer-list .correct::after{ + content: " [Score = 2]"; + font-size: small; +} + .answer-list .half-correct { color: yellow; } +.answer-list .half-correct::after{ + content: " [Score = 1]"; + font-size: small; +} + .answer-list .incorrect { color: red; } +.answer-list .incorrect::after{ + content: " [Score = 0]"; + font-size: small; +} + .answer-list .not-marked { color: lightblue; } diff --git a/anatomy/static/js/anatomy.js b/anatomy/static/js/anatomy.js index 52cb161c..24d974b5 100644 --- a/anatomy/static/js/anatomy.js +++ b/anatomy/static/js/anatomy.js @@ -8,7 +8,7 @@ var marked_answers = { $(document).ready(function () { $(".answer-list li").each(function (index, element) { - $(element).append($("G")); + $(element).append($("G")); }); $(".answer-list span.answer").each(function (index, element) { diff --git a/anatomy/templates/anatomy/exam_scores.html b/anatomy/templates/anatomy/exam_scores.html index 83466eef..5bc70ed6 100644 --- a/anatomy/templates/anatomy/exam_scores.html +++ b/anatomy/templates/anatomy/exam_scores.html @@ -12,21 +12,12 @@ {% endif %} - {% for user, value in user_answers_marks.items %} -

Candidate: {{ user_names|get_item:user }}

- - Answers: {% for ans, score in user_answers_and_marks|get_item:user %} - {{ans}} ({{score}}), - {% endfor %} -
Total mark: {{ user_scores|get_item:user }} - {% endfor %} -

Stats

Mean: {{mean}}, Median {{median}}, Mode {{mode}} -

Distribution of results

-
{{plot|safe}}
+ +

Distribution of results

{{plot|safe}}
@@ -36,7 +27,7 @@ {% for user, value in user_answers_marks.items %} - + {% endfor %} diff --git a/anatomy/views.py b/anatomy/views.py index ac32272b..36fc8f54 100644 --- a/anatomy/views.py +++ b/anatomy/views.py @@ -625,7 +625,7 @@ def exam_scores_cid(request, pk): mode = "No unique mode" df = user_scores_list - fig = px.histogram(df, x=0) + fig = px.histogram(df, x=0, title="Distribution of scores", labels={"0": "Score"}, height=400, width=600) fig_html = fig.to_html() total = len(questions) diff --git a/physics/templates/physics/exam_scores.html b/physics/templates/physics/exam_scores.html index 42f394f3..9551563f 100644 --- a/physics/templates/physics/exam_scores.html +++ b/physics/templates/physics/exam_scores.html @@ -4,14 +4,6 @@

{{ exam.name }}

- {% for user, value in user_answers_marks.items %} -

Candidate: {{ user_names|get_item:user }}

- - Answers: {% for ans, score in user_answers_and_marks|get_item:user %} - {{ans}} ({{score}}), - {% endfor %} -
Total mark: {{ user_scores|get_item:user }} - {% endfor %}

Stats

@@ -27,7 +19,7 @@ {% for user, value in user_answers_marks.items %}
- + {% endfor %} diff --git a/physics/templates/physics/exam_scores_user.html b/physics/templates/physics/exam_scores_user.html index ba9074e1..fb74ec54 100644 --- a/physics/templates/physics/exam_scores_user.html +++ b/physics/templates/physics/exam_scores_user.html @@ -10,7 +10,7 @@
  • Question {{forloop.counter}} - {{ question.stem }}
    1. {% for q, a, score, correct_answer in ans %} -
    2. {{q}}: {{a}}
      Correct answer: {{correct_answer}} (Score: {{score}})
    3. +
    4. {{q}}: Correct answer: {{correct_answer}}
      {{a}} (Score: {{score}})
    5. {% endfor %}
    {% endfor %} diff --git a/physics/templates/physics/exam_take.html b/physics/templates/physics/exam_take.html index 74a47840..45d9ff08 100644 --- a/physics/templates/physics/exam_take.html +++ b/physics/templates/physics/exam_take.html @@ -13,6 +13,7 @@ saved)

    + {% autoescape off %}
      {% for question in questions.all %} @@ -53,6 +54,8 @@ {% endfor %}
    + {% endautoescape %} + @@ -61,7 +64,7 @@
    {{user}}{{user}} {{user_scores|get_item:user}}
    {{user}}{{user}} {{user_scores|get_item:user}}