.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
{% extends 'anatomy/exams.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% load thumbnail %}
|
||||
<div class="anatomy">
|
||||
<h1>Exam: {{ exam.name }}</h1>
|
||||
|
||||
{{cid_user_count}} users.
|
||||
|
||||
<ol>
|
||||
{% for cid in cid_users %}
|
||||
<li>{{cid}}</li>
|
||||
|
||||
{% endfor %}
|
||||
</ol>
|
||||
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -8,6 +8,7 @@
|
||||
{% if exam.exam_mode %}
|
||||
<a href="{% url 'anatomy:mark_overview' pk=exam.pk %}">Mark</a> /
|
||||
<a href="{% url 'anatomy:exam_scores_cid' pk=exam.pk %}">Scores</a> /
|
||||
<a href="{% url 'anatomy:exam_cids' %}">CIDs</a> /
|
||||
{% endif %}
|
||||
<a href="{% url 'anatomy:anatomy_create_exam' pk=exam.pk %}">Add New Question</a>
|
||||
{% endblock %}
|
||||
|
||||
+12
-5
@@ -22,7 +22,11 @@ urlpatterns = [
|
||||
views.AnatomyQuestionCreate.as_view(),
|
||||
name="anatomy_question_create",
|
||||
),
|
||||
path("create/exam/<int:pk>", views.AnatomyQuestionCreate.as_view(), name="anatomy_create_exam"),
|
||||
path(
|
||||
"create/exam/<int:pk>",
|
||||
views.AnatomyQuestionCreate.as_view(),
|
||||
name="anatomy_create_exam",
|
||||
),
|
||||
path(
|
||||
"question/<int:pk>/update",
|
||||
views.AnatomyQuestionUpdate.as_view(),
|
||||
@@ -54,11 +58,13 @@ urlpatterns = [
|
||||
),
|
||||
path("exam/<int:exam_pk>/<int:sk>/mark", views.mark, name="mark"),
|
||||
path("exam/<int:exam_pk>/<int:sk>/mark/all", views.mark_all, name="mark_all"),
|
||||
path("exam/<int:exam_pk>/<int:sk>/mark/review", views.mark_review, name="mark_review"),
|
||||
path(
|
||||
"exam/<int:exam_pk>/<int:sk>/mark/review", views.mark_review, name="mark_review"
|
||||
),
|
||||
path(
|
||||
"exam/<int:pk>/mark", views.AnatomyExamViews.mark_overview, name="mark_overview"
|
||||
),
|
||||
#path("exam/<int:pk>/<int:sk>/", views.exam_take, name="exam_take"),
|
||||
# path("exam/<int:pk>/<int:sk>/", views.exam_take, name="exam_take"),
|
||||
path(
|
||||
"exam/<int:pk>/question/<int:sk>/",
|
||||
views.AnatomyExamViews.exam_question_detail,
|
||||
@@ -99,6 +105,7 @@ urlpatterns = [
|
||||
path("exam/all", views.AnatomyExamViews.exam_list_all, name="exam_list_all"),
|
||||
path("exam/create", views.ExamCreate.as_view(), name="exam_create"),
|
||||
path("exam/<int:exam_id>/clone", views.ExamClone.as_view(), name="exam_clone"),
|
||||
path("exam/<int:exam_id>/cids", views.AnatomyExamViews.exam_cids, name="exam_cids"),
|
||||
path("exam/<int:pk>/update", views.ExamUpdate.as_view(), name="exam_update"),
|
||||
path("exam/<int:pk>/delete", views.ExamDelete.as_view(), name="exam_delete"),
|
||||
path("exam/json/", views.AnatomyExamViews.active_exams, name="active_exams"),
|
||||
@@ -119,7 +126,7 @@ urlpatterns = [
|
||||
name="exam_json_recreate",
|
||||
),
|
||||
# path("cid/", views.cid_selector, name="cid_selector"),
|
||||
#path("ajax/exam/flag/", views.flag_question, name="flag_question"),
|
||||
# path("ajax/exam/flag/", views.flag_question, name="flag_question"),
|
||||
path("body_part/create/", views.create_body_part, name="create_body_part"),
|
||||
path(
|
||||
"body_part/ajax/get_body_part_id",
|
||||
@@ -158,7 +165,7 @@ urlpatterns = [
|
||||
),
|
||||
path(
|
||||
"structure-autocomplete",
|
||||
views.StructureAutocomplete.as_view(model=Structure, create_field='structure'),
|
||||
views.StructureAutocomplete.as_view(model=Structure, create_field="structure"),
|
||||
name="structure-autocomplete",
|
||||
),
|
||||
]
|
||||
|
||||
@@ -417,6 +417,28 @@ class ExamViews(View, LoginRequiredMixin):
|
||||
},
|
||||
)
|
||||
|
||||
@method_decorator(login_required)
|
||||
def exam_cids(self, request, exam_id):
|
||||
exam = get_object_or_404(self.Exam, pk=exam_id)
|
||||
|
||||
if request.user not in exam.author.all():
|
||||
if not self.check_user_access(request.user, exam_id):
|
||||
raise PermissionDenied
|
||||
|
||||
cid_users = exam.valid_users.all()
|
||||
|
||||
cid_user_count = cid_users.count()
|
||||
|
||||
return render(
|
||||
request,
|
||||
"{}/exam_cids.html".format(self.app_name),
|
||||
{
|
||||
"exam": exam,
|
||||
"cid_users": cid_users,
|
||||
"cid_user_cound": cid_user_count
|
||||
},
|
||||
)
|
||||
|
||||
# @method_decorator(login_required)
|
||||
def exam_notes(self, request, pk):
|
||||
exam = get_object_or_404(self.Exam, pk=pk)
|
||||
|
||||
@@ -12,10 +12,8 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
console.log(window.location.search.substr(1).split("&"))
|
||||
window.location.search.substr(1).split("&").forEach((item) =>
|
||||
{
|
||||
console.log(item)
|
||||
s = item.split("=");
|
||||
if (s[0] == "cid") {
|
||||
$("#cid-box").val(s[1]);
|
||||
|
||||
@@ -12,6 +12,18 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
window.location.search.substr(1).split("&").forEach((item) =>
|
||||
{
|
||||
s = item.split("=");
|
||||
if (s[0] == "cid") {
|
||||
$("#cid-box").val(s[1]);
|
||||
|
||||
}
|
||||
if (s[0] == "passcode") {
|
||||
$("#passcode-box").val(s[1]);
|
||||
}
|
||||
});
|
||||
|
||||
$("#cid-box, #passcode-box").keypress(function(e) {
|
||||
// Enter pressed?
|
||||
console.log(e)
|
||||
|
||||
Reference in New Issue
Block a user