.
This commit is contained in:
@@ -1,21 +1,25 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
Anatomy
|
Anatomy
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block navigation %}
|
{% block navigation %}
|
||||||
Anatomy:
|
Anatomy:
|
||||||
{% if request.user.is_authenticated %}
|
{% if request.user.is_authenticated %}
|
||||||
<a href="{% url 'anatomy:index' %}">Packets</a> /
|
<a href="{% url 'anatomy:index' %}">Packets</a> /
|
||||||
<a href="{% url 'anatomy:exam_list' %}">Exams</a> /
|
<a href="{% url 'anatomy:exam_list' %}">Exams</a> /
|
||||||
<a href="{% url 'anatomy:exam_create' %}" title="Create a new exam">Create Exam</a> /
|
<a href="{% url 'anatomy:exam_create' %}" title="Create a new exam">Create Exam</a> /
|
||||||
<a href="{% url 'anatomy:question_list' %}">Questions</a> /
|
<a href="{% url 'anatomy:question_list' %}">Questions</a> /
|
||||||
<a href="{% url 'anatomy:anatomy_question_create' %}" title="Create a new question">Create Question</a>
|
<a href="{% url 'anatomy:anatomy_question_create' %}" title="Create a new question">Create Question</a>
|
||||||
{% if request.user.is_superuser %}
|
{% if request.user.is_superuser %}
|
||||||
/ <a href="{% url 'anatomy:user_answer_table_view' %}" title="User answers">Answers</a>
|
/ <a href="{% url 'anatomy:user_answer_table_view' %}" title="User answers">Answers</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
{% if simple_content %}
|
||||||
|
{{simple_content}}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
+8
-1
@@ -78,9 +78,16 @@ urlpatterns = [
|
|||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
"exam/<int:pk>/scores",
|
"exam/<int:pk>/scores",
|
||||||
cache_page(60 * 1)(views.exam_scores_cid),
|
views.exam_scores_cid,
|
||||||
|
# cache_page(60 * 1)(views.exam_scores_cid),
|
||||||
name="exam_scores_cid",
|
name="exam_scores_cid",
|
||||||
),
|
),
|
||||||
|
path(
|
||||||
|
"exam/<int:pk>/scores/refresh",
|
||||||
|
views.exam_scores_refresh,
|
||||||
|
# cache_page(60 * 1)(views.exam_scores_cid),
|
||||||
|
name="exam_scores_refresh",
|
||||||
|
),
|
||||||
path(
|
path(
|
||||||
"exam/<int:pk>/scores/<int:sk>/<str:passcode>/",
|
"exam/<int:pk>/scores/<int:sk>/<str:passcode>/",
|
||||||
views.exam_scores_cid_user,
|
views.exam_scores_cid_user,
|
||||||
|
|||||||
@@ -450,6 +450,30 @@ def mark(request, exam_pk, sk, unmarked_exam_answers_only=True, review=False):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@login_required
|
||||||
|
def exam_scores_refresh(request, pk):
|
||||||
|
exam = get_object_or_404(Exam, pk=pk)
|
||||||
|
|
||||||
|
if not exam.exam_mode:
|
||||||
|
raise Http404("Packet not in exam mode")
|
||||||
|
|
||||||
|
questions = exam.exam_questions.all()
|
||||||
|
|
||||||
|
cids = (
|
||||||
|
CidUserAnswer.objects.filter(question__in=questions, exam__id=pk)
|
||||||
|
)
|
||||||
|
|
||||||
|
# Force a score update
|
||||||
|
for c in cids:
|
||||||
|
c.get_answer_score(cached=False)
|
||||||
|
|
||||||
|
return render(
|
||||||
|
request,
|
||||||
|
"anatomy/base.html",
|
||||||
|
{
|
||||||
|
"simple_content": "Answer scores updated",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def exam_scores_cid(request, pk):
|
def exam_scores_cid(request, pk):
|
||||||
|
|||||||
Reference in New Issue
Block a user