.
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 %}
|
{% if exam.exam_mode %}
|
||||||
<a href="{% url 'anatomy:mark_overview' pk=exam.pk %}">Mark</a> /
|
<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_scores_cid' pk=exam.pk %}">Scores</a> /
|
||||||
|
<a href="{% url 'anatomy:exam_cids' %}">CIDs</a> /
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="{% url 'anatomy:anatomy_create_exam' pk=exam.pk %}">Add New Question</a>
|
<a href="{% url 'anatomy:anatomy_create_exam' pk=exam.pk %}">Add New Question</a>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
+10
-3
@@ -22,7 +22,11 @@ urlpatterns = [
|
|||||||
views.AnatomyQuestionCreate.as_view(),
|
views.AnatomyQuestionCreate.as_view(),
|
||||||
name="anatomy_question_create",
|
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(
|
path(
|
||||||
"question/<int:pk>/update",
|
"question/<int:pk>/update",
|
||||||
views.AnatomyQuestionUpdate.as_view(),
|
views.AnatomyQuestionUpdate.as_view(),
|
||||||
@@ -54,7 +58,9 @@ urlpatterns = [
|
|||||||
),
|
),
|
||||||
path("exam/<int:exam_pk>/<int:sk>/mark", views.mark, name="mark"),
|
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/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(
|
path(
|
||||||
"exam/<int:pk>/mark", views.AnatomyExamViews.mark_overview, name="mark_overview"
|
"exam/<int:pk>/mark", views.AnatomyExamViews.mark_overview, name="mark_overview"
|
||||||
),
|
),
|
||||||
@@ -99,6 +105,7 @@ urlpatterns = [
|
|||||||
path("exam/all", views.AnatomyExamViews.exam_list_all, name="exam_list_all"),
|
path("exam/all", views.AnatomyExamViews.exam_list_all, name="exam_list_all"),
|
||||||
path("exam/create", views.ExamCreate.as_view(), name="exam_create"),
|
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>/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>/update", views.ExamUpdate.as_view(), name="exam_update"),
|
||||||
path("exam/<int:pk>/delete", views.ExamDelete.as_view(), name="exam_delete"),
|
path("exam/<int:pk>/delete", views.ExamDelete.as_view(), name="exam_delete"),
|
||||||
path("exam/json/", views.AnatomyExamViews.active_exams, name="active_exams"),
|
path("exam/json/", views.AnatomyExamViews.active_exams, name="active_exams"),
|
||||||
@@ -158,7 +165,7 @@ urlpatterns = [
|
|||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
"structure-autocomplete",
|
"structure-autocomplete",
|
||||||
views.StructureAutocomplete.as_view(model=Structure, create_field='structure'),
|
views.StructureAutocomplete.as_view(model=Structure, create_field="structure"),
|
||||||
name="structure-autocomplete",
|
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)
|
# @method_decorator(login_required)
|
||||||
def exam_notes(self, request, pk):
|
def exam_notes(self, request, pk):
|
||||||
exam = get_object_or_404(self.Exam, pk=pk)
|
exam = get_object_or_404(self.Exam, pk=pk)
|
||||||
|
|||||||
@@ -12,10 +12,8 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
console.log(window.location.search.substr(1).split("&"))
|
|
||||||
window.location.search.substr(1).split("&").forEach((item) =>
|
window.location.search.substr(1).split("&").forEach((item) =>
|
||||||
{
|
{
|
||||||
console.log(item)
|
|
||||||
s = item.split("=");
|
s = item.split("=");
|
||||||
if (s[0] == "cid") {
|
if (s[0] == "cid") {
|
||||||
$("#cid-box").val(s[1]);
|
$("#cid-box").val(s[1]);
|
||||||
|
|||||||
@@ -12,6 +12,18 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(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) {
|
$("#cid-box, #passcode-box").keypress(function(e) {
|
||||||
// Enter pressed?
|
// Enter pressed?
|
||||||
console.log(e)
|
console.log(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user