.
This commit is contained in:
@@ -27,6 +27,9 @@ from physics.models import Exam as PhysicsExam
|
|||||||
from anatomy.models import CidUserAnswer as AnatomyCidUserAnswer
|
from anatomy.models import CidUserAnswer as AnatomyCidUserAnswer
|
||||||
from anatomy.models import Exam as AnatomyExam
|
from anatomy.models import Exam as AnatomyExam
|
||||||
|
|
||||||
|
from rapids.models import CidUserAnswer as RapidsCidUserAnswer
|
||||||
|
from rapids.models import Exam as RapidsExam
|
||||||
|
|
||||||
from anatomy.views import active_exams as active_anatomy_exams, postExamAnswers as postAnatomyExamAnswers
|
from anatomy.views import active_exams as active_anatomy_exams, postExamAnswers as postAnatomyExamAnswers
|
||||||
from rapids.views import active_exams as active_rapid_exams, postExamAnswers as postRapidExamAnswers
|
from rapids.views import active_exams as active_rapid_exams, postExamAnswers as postRapidExamAnswers
|
||||||
|
|
||||||
@@ -56,6 +59,8 @@ def cid_scores(request, pk):
|
|||||||
cid=cid)
|
cid=cid)
|
||||||
anatomy_answers = AnatomyCidUserAnswer.objects.filter(
|
anatomy_answers = AnatomyCidUserAnswer.objects.filter(
|
||||||
cid=cid)
|
cid=cid)
|
||||||
|
rapids_answers = RapidsCidUserAnswer.objects.filter(
|
||||||
|
cid=cid)
|
||||||
|
|
||||||
|
|
||||||
if not physics_answers and not anatomy_answers:
|
if not physics_answers and not anatomy_answers:
|
||||||
@@ -67,6 +72,9 @@ def cid_scores(request, pk):
|
|||||||
anatomy_exam_ids = anatomy_answers.values_list("exam").distinct()
|
anatomy_exam_ids = anatomy_answers.values_list("exam").distinct()
|
||||||
anatomy_exams = AnatomyExam.objects.filter(id__in=anatomy_exam_ids)
|
anatomy_exams = AnatomyExam.objects.filter(id__in=anatomy_exam_ids)
|
||||||
|
|
||||||
|
rapids_exam_ids = rapids_answers.values_list("exam").distinct()
|
||||||
|
rapids_exams = RapidsExam.objects.filter(id__in=rapids_exam_ids)
|
||||||
|
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
@@ -74,6 +82,7 @@ def cid_scores(request, pk):
|
|||||||
{
|
{
|
||||||
"physics_exams": physics_exams,
|
"physics_exams": physics_exams,
|
||||||
"anatomy_exams": anatomy_exams,
|
"anatomy_exams": anatomy_exams,
|
||||||
|
"rapids_exams": rapids_exams,
|
||||||
"cid": cid,
|
"cid": cid,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -16,5 +16,11 @@
|
|||||||
<li><a href="{% url 'anatomy:exam_scores_cid_user' pk=exam.pk sk=cid %}">{{exam.name}}</a></li>
|
<li><a href="{% url 'anatomy:exam_scores_cid_user' pk=exam.pk sk=cid %}">{{exam.name}}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
<h3>Rapids</h3>
|
||||||
|
<ul>
|
||||||
|
{% for exam in rapids_exams %}
|
||||||
|
<li><a href="{% url 'rapids:exam_scores_cid_user' pk=exam.pk sk=cid %}">{{exam.name}}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user