diff --git a/anatomy/static/css/anatomy.css b/anatomy/static/css/anatomy.css index 1e11802d..77f71554 100644 --- a/anatomy/static/css/anatomy.css +++ b/anatomy/static/css/anatomy.css @@ -587,24 +587,6 @@ table.longs .user-answer-score- { background-color: red; } -.published-icon { - border: 1px dotted gray; - opacity: 20%; - border-radius: 4px; - display: none; -} - -.published-icon:hover { - opacity: 100%; -} - -.published-icon.published { - border: 1px solid purple; - color: purple; - opacity: 100%; - display: inline-block; -} - textarea, input { border-radius: 2px; diff --git a/anatomy/views.py b/anatomy/views.py index 8135da10..ab4f53c6 100644 --- a/anatomy/views.py +++ b/anatomy/views.py @@ -664,6 +664,7 @@ def exam_scores_cid_user(request, pk, cid, passcode): "total_score": total_score, "max_score": max_score, "answers_and_marks": answers_and_marks, + "view_all_results": view_all_results, }, ) diff --git a/generic/templates/generic/user_scores_header.html b/generic/templates/generic/user_scores_header.html new file mode 100644 index 00000000..45b56ffa --- /dev/null +++ b/generic/templates/generic/user_scores_header.html @@ -0,0 +1,7 @@ +

Exam: {{ exam.name }}

+

Candidate: {{ cid }}

+{% if view_all_results %} + +{% endif %} \ No newline at end of file diff --git a/generic/views.py b/generic/views.py index 12658a0c..3fac5537 100644 --- a/generic/views.py +++ b/generic/views.py @@ -362,7 +362,7 @@ class ExamViews(View, LoginRequiredMixin): True if request.POST.get("publish_results") == "true" else False ) exam.save() - data = {"status": "success", "publish_results": exam.publish_results} + data = {"status": "success", "publish_results": exam.publish_results, "name": exam.name, "id": exam.id} return JsonResponse(data, status=200) else: data = {"status": "error"} @@ -376,7 +376,7 @@ class ExamViews(View, LoginRequiredMixin): exam.active = True if request.POST.get("active") == "true" else False exam.save() - data = {"status": "success", "active": exam.active} + data = {"status": "success", "active": exam.active, "name": exam.name, "id": exam.id} return JsonResponse(data, status=200) else: data = {"status": "error"} diff --git a/longs/views.py b/longs/views.py index d2b09505..30dff861 100755 --- a/longs/views.py +++ b/longs/views.py @@ -1121,8 +1121,9 @@ def exam_scores_cid_user(request, pk, cid, passcode): "total_score": total_score, "normalised_score": normalised_score, "max_score": max_score, - "answer_text": answer_text + "answer_text": answer_text, # "answers_and_marks": answers_and_marks, + "view_all_results": view_all_results, }, ) diff --git a/physics/templates/physics/exam_list.html b/physics/templates/physics/exam_list.html index 68543005..af6ad227 100644 --- a/physics/templates/physics/exam_list.html +++ b/physics/templates/physics/exam_list.html @@ -8,7 +8,10 @@ {% for exam in exams %} {% if exam.active %}
  • - {{exam.name}} Scores Results Published + {{exam.name}} Scores Results Published + Publish results: +
  • {% endif %} {% endfor %} diff --git a/physics/templates/physics/exam_overview.html b/physics/templates/physics/exam_overview.html index 8a877d4a..dba832f5 100644 --- a/physics/templates/physics/exam_overview.html +++ b/physics/templates/physics/exam_overview.html @@ -2,113 +2,67 @@ {% block content %} - {% load thumbnail %} -
    - {% if can_edit %} - Edit - Delete - Clone - {% endif %} - {% if request.user.is_superuser %} - Admin Edit - {% endif %} -

    Exam: {{ exam.name }}

    +{% load thumbnail %} +
    + {% if can_edit %} + Edit + Delete + Clone + {% endif %} + {% if request.user.is_superuser %} + Admin + Edit + {% endif %} +

    Exam: {{ exam.name }}

    - {% include 'exam_notes.html' %} + {% include 'exam_notes.html' %} -

    This exam has {{question_number}} questions.

    - Open access: {{ exam.open_access }}
    - -
    - Exam active: [When checked the exam will be available to take in the test system] -
    -
    - Publish results: [When checked the exam results will be available on this site] -
    - This exam will be available to take here (when active). - - {% autoescape off %} -
      - {% for question in questions.all %} - -
    1. - {{ question.stem }} -
        -
      1. - {{ question.a }}: {{ question.a_answer }} -
      2. -
      3. - {{ question.b }}: {{ question.b_answer }} -
      4. -
      5. - {{ question.c }}: {{ question.c_answer }} -
      6. -
      7. - {{ question.d }}: {{ question.d_answer }} -
      8. -
      9. - {{ question.e }}: {{ question.e_answer }} -
      10. -
      - Category: {{ question.category }}, View Edit - -
    2. - {% endfor %} -
    - {% endautoescape %} +

    This exam has {{question_number}} questions.

    + Open access: {{ exam.open_access }}
    +
    + Exam active: [When checked the exam will be available to take in the test system]
    - -{% endblock %} +
  • + {{ question.stem }} +
      +
    1. + {{ question.a }}: {{ question.a_answer }} +
    2. +
    3. + {{ question.b }}: {{ question.b_answer }} +
    4. +
    5. + {{ question.c }}: {{ question.c_answer }} +
    6. +
    7. + {{ question.d }}: {{ question.d_answer }} +
    8. +
    9. + {{ question.e }}: {{ question.e_answer }} +
    10. +
    + Category: {{ question.category }}, View Edit + +
  • + {% endfor %} + + {% endautoescape %} + +
    + {% include 'exam_overview_js.html' %} +{% endblock %} \ No newline at end of file diff --git a/physics/templates/physics/exam_scores_user.html b/physics/templates/physics/exam_scores_user.html index b8691ceb..faf9df70 100644 --- a/physics/templates/physics/exam_scores_user.html +++ b/physics/templates/physics/exam_scores_user.html @@ -2,8 +2,8 @@ {% block content %}
    -

    Exam: {{ exam.name }}

    -

    Candidate: {{ cid }}

    + {% include 'generic/user_scores_header.html' %} + Answers:
    + {% include 'exam_overview_js.html' %} + + + {% endblock %} + diff --git a/templates/exam_overview_js.html b/templates/exam_overview_js.html index 806fe3d3..6fc26f9d 100644 --- a/templates/exam_overview_js.html +++ b/templates/exam_overview_js.html @@ -1,7 +1,7 @@