diff --git a/generic/tables.py b/generic/tables.py index 9e124b71..49a36fd7 100644 --- a/generic/tables.py +++ b/generic/tables.py @@ -23,9 +23,9 @@ class CidUserTable(tables.Table): # edit = tables.LinkColumn( # "anatomy:anatomy_question_update", text="Edit", args=[A("pk")], orderable=False # ) - # view = tables.LinkColumn( - # "anatomy:question_detail", text="View", args=[A("pk")], orderable=False - # ) + view = tables.LinkColumn( + "cid_scores", text="View", args=[A("cid"), A("passcode")], orderable=False + ) # image = ImageColumn("image", orderable=False) # clone = tables.LinkColumn('anatomy:anatomy_question_clone', # text='Clone', @@ -51,3 +51,6 @@ class CidUserTable(tables.Table): "email", ) # sequence = ("view") + +# def render_cid(self, value, record): +# return format_html("""Popup""", record.pk) diff --git a/rad/views.py b/rad/views.py index cdce6608..0767e0dd 100644 --- a/rad/views.py +++ b/rad/views.py @@ -105,41 +105,6 @@ def cid_scores(request, pk, passcode): exams.append((exam_type, Exam.objects.filter(id__in=exam_ids, **kwargs))) - #physics_answers = PhysicsCidUserAnswer.objects.filter(cid=cid) - #anatomy_answers = AnatomyCidUserAnswer.objects.filter(cid=cid) - #rapids_answers = RapidsCidUserAnswer.objects.filter(cid=cid) - #longs_answers = LongsCidUserAnswer.objects.filter(cid=cid) - #sbas_answers = SbasCidUserAnswer.objects.filter(cid=cid) - - ## if ( - ## not physics_answers - ## and not anatomy_answers - ## and not rapids_answers - ## and not longs_answers - ## and not sbas_answers - ## ): - ## raise Http404("cid not found") - - ##kwargs = {"publish_results": True} - - ##if request.user.groups.filter(name="view_all_results").exists(): - ## kwargs = {} - - #physics_exam_ids = physics_answers.values_list("exam").distinct() - #physics_exams = PhysicsExam.objects.filter(id__in=physics_exam_ids, **kwargs) - - #anatomy_exam_ids = anatomy_answers.values_list("exam").distinct() - #anatomy_exams = AnatomyExam.objects.filter(id__in=anatomy_exam_ids, **kwargs) - - #rapids_exam_ids = rapids_answers.values_list("exam").distinct() - #rapid_exams = RapidsExam.objects.filter(id__in=rapids_exam_ids, **kwargs) - - #longs_exam_ids = longs_answers.values_list("exam").distinct() - #longs_exams = LongsExam.objects.filter(id__in=longs_exam_ids, **kwargs) - - #sbas_exam_ids = sbas_answers.values_list("exam").distinct() - #sba_exams = SbasExam.objects.filter(id__in=sbas_exam_ids, **kwargs) - available_exams = cid_user.get_cid_exams() return render( diff --git a/templates/cid_scores.html b/templates/cid_scores.html index 86293137..0a57ab84 100644 --- a/templates/cid_scores.html +++ b/templates/cid_scores.html @@ -26,45 +26,6 @@ {% endif %} {% endfor %} - {% comment %} {% if physics_exams %} -