fix links

This commit is contained in:
Ross
2020-12-17 18:39:18 +00:00
parent b557305730
commit af749d9aa7
3 changed files with 29 additions and 29 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
{% endif %}
{% for user, value in user_answers_marks.items %}
<h3>Candidate: <a href="{% url 'anatomy:cid_scores' user %}">{{ user_names|get_item:user }}</a></h3>
<h3>Candidate: <a href="{% url 'cid_scores' user %}">{{ user_names|get_item:user }}</a></h3>
<!-- Answers: {{ user_answers_and_marks|get_item:user }}-->
Answers: {% for ans, score in user_answers_and_marks|get_item:user %}
{{ans}} ({{score}}),
+27 -27
View File
@@ -762,33 +762,33 @@ def exam_scores(request, pk):
},
)
def cid_scores(request, pk):
#exam = get_object_or_404(Exam, pk=pk)
# TODO:Need some kind of test for cid
cid = pk
#questions = exam.exam_questions.all()
answers = CidUserAnswer.objects.filter(
cid=cid)
if not answers:
raise Http404("cid not found")
exam_ids = answers.values_list("exam").distinct()
exams = Exam.objects.filter(id__in=exam_ids)
return render(
request,
"anatomy/cid_scores.html",
{
"exams": exams,
"cid": cid,
},
)
#def cid_scores(request, pk):
# #exam = get_object_or_404(Exam, pk=pk)
#
# # TODO:Need some kind of test for cid
# cid = pk
#
# #questions = exam.exam_questions.all()
# answers = CidUserAnswer.objects.filter(
# cid=cid)
#
#
# if not answers:
# raise Http404("cid not found")
#
# exam_ids = answers.values_list("exam").distinct()
#
# exams = Exam.objects.filter(id__in=exam_ids)
#
#
# return render(
# request,
# "anatomy/cid_scores.html",
# {
# "exams": exams,
# "cid": cid,
# },
# )
class AnatomyQuestionCreateBase(LoginRequiredMixin, CreateView):
model = AnatomyQuestion
+1 -1
View File
@@ -5,7 +5,7 @@
<h2>{{ exam.name }}</h2>
{% for user, value in user_answers_marks.items %}
<h3>Candidate: <a href="{% url 'physics:cid_scores' user %}">{{ user_names|get_item:user }}</a></h3>
<h3>Candidate: <a href="{% url 'cid_scores' user %}">{{ user_names|get_item:user }}</a></h3>
<!-- Answers: {{ user_answers_and_marks|get_item:user }}-->
Answers: {% for ans, score in user_answers_and_marks|get_item:user %}
{{ans}} ({{score}}),