diff --git a/rad/views.py b/rad/views.py index 2f5fafd4..d2c6a716 100644 --- a/rad/views.py +++ b/rad/views.py @@ -123,6 +123,14 @@ def cid_scores(request, pk, passcode): sbas_exam_ids = sbas_answers.values_list("exam").distinct() sba_exams = SbasExam.objects.filter(id__in=sbas_exam_ids, **kwargs) + available_exams = [] + + exam_types = ("physics_exams", "rapid_exams", "sba_exams", "anatomy_exams", "longs_exams") + + for t in exam_types: + exams = getattr(cid_user, t).all() + available_exams.push((t, exams)) + return render( request, "cid_scores.html", @@ -134,6 +142,8 @@ def cid_scores(request, pk, passcode): "sba_exams": sba_exams, "cid": cid, "passcode": passcode, + "cid_user": cid_user, + "available_exams": available_exams, }, ) diff --git a/templates/cid_scores.html b/templates/cid_scores.html index 56dc73f8..ee5dbbea 100644 --- a/templates/cid_scores.html +++ b/templates/cid_scores.html @@ -1,48 +1,66 @@ {% extends 'base.html' %} {% block content %} -
-

CID: {{ cid }}

- The following exams have been found (click to view answers and scores): - {% if physics_exams %} -

Physics

- - {% endif %} - {% if anatomy_exams %} -

Anatomy

- - {% endif %} - {% if rapid_exams %} -

Rapids

- - {% endif %} - {% if longs_exams %} -

Longs

- - {% endif %} - {% if sba_exams %} -

SBAs

- - {% endif %} -
-{% endblock %} \ No newline at end of file + + + + +

Taken Exams

+ The following exams have been found (click to view answers and scores): + {% if physics_exams %} +

Physics

+ + {% endif %} + {% if anatomy_exams %} +

Anatomy

+ + {% endif %} + {% if rapid_exams %} +

Rapids

+ + {% endif %} + {% if longs_exams %} +

Longs

+ + {% endif %} + {% if sba_exams %} +

SBAs

+ + {% endif %} + +{% endblock %}