From 5ca1d5b44ed6a4285bcf7d1d9c94e771045355c4 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 19 Jun 2023 10:55:08 +0100 Subject: [PATCH] Improve candidate display in exams --- generic/templates/generic/exam_cids.html | 12 ++++++------ generic/templates/generic/exam_scores_base.html | 6 +++--- generic/views.py | 8 +++++++- rad/static/css/anatomy.css | 11 ++++++++++- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/generic/templates/generic/exam_cids.html b/generic/templates/generic/exam_cids.html index e16df4a2..f7c500ea 100644 --- a/generic/templates/generic/exam_cids.html +++ b/generic/templates/generic/exam_cids.html @@ -4,11 +4,10 @@ {% if cid_users %}

{{cid_user_count}} CID candidates.

-
    +
      {% for cid in cid_users %} -
    1. {{cid.cid}} [{{cid.passcode}}] {{cid.name}} / - Email: {{cid.email}} +
    2. {{cid.cid}} [{{cid.passcode}}]
      {{cid.name}}
      Email: {{cid.email}}
    3. {% endfor %} @@ -27,11 +26,11 @@ {% if user_users %}

      {{user_user_count}} User candidates.

      -
        +
          {% for user in user_users %} -
        1. {{user.username}} - Email: {{user.email}} +
        2. {{user.username}}
          +
          Email: {{user.email}}
        3. {% endfor %} @@ -51,6 +50,7 @@

          Submitted candidates

          + The following candidate submissions have been received. Candidates with submissions will be shown in green above.
            {% for user_data in user_exam_data %}
          • diff --git a/generic/templates/generic/exam_scores_base.html b/generic/templates/generic/exam_scores_base.html index 22443086..29b281c7 100644 --- a/generic/templates/generic/exam_scores_base.html +++ b/generic/templates/generic/exam_scores_base.html @@ -1,7 +1,6 @@ {% extends exam.app_name|add:'/exams.html' %} {% block content %} -
            {{plot|safe}}

            {{ exam.name }}

            {% if cached_scores %} @@ -19,8 +18,8 @@ {% if missing_users %} {% endif %} @@ -34,6 +33,7 @@ {% endif %}
            +
            {{plot|safe}}

            Stats

            Candidates: {{cids|length}}
            diff --git a/generic/views.py b/generic/views.py index f905d949..6e23ffd8 100644 --- a/generic/views.py +++ b/generic/views.py @@ -2076,10 +2076,16 @@ class ExamViews(View, LoginRequiredMixin): exam.save() + missing_user_ids = valid_user_users - user_ids + + missing_users = [] + if missing_user_ids: + missing_users = User.objects.filter(pk__in=missing_user_ids) + template_variables = { "cids": sorted(cids), "missing_cids": valid_cid_users - plain_cids, - "missing_users": valid_user_users - user_ids, + "missing_users": missing_users, # "cid_passcodes": cid_passcodes, "exam": exam, "unmarked": unmarked, diff --git a/rad/static/css/anatomy.css b/rad/static/css/anatomy.css index c2f1b4d1..0d19af58 100644 --- a/rad/static/css/anatomy.css +++ b/rad/static/css/anatomy.css @@ -959,4 +959,13 @@ form .submit-button { h1, h2, h3, h4, h5, h6 { margin-top: 10px; -} \ No newline at end of file +} + +.cid-candidate-list li { + display: grid; + grid-template-columns: 150px repeat(auto-fill, 400px); +} + +.cid-candidate-list div { +} +