.
This commit is contained in:
@@ -62,6 +62,8 @@
|
||||
</div>
|
||||
<a href="{% url 'longs:exam_json' pk=exam.pk %}">JSON</a>
|
||||
<a href="{% url 'longs:exam_json_recreate' pk=exam.pk %}">Refresh JSON cache</a>
|
||||
<a href="{% url 'longs:refresh_exam_question_json' pk=exam.pk %}">Refresh Question JSON cache</a>
|
||||
|
||||
<button id='button-open-access'>Make questions open access</button>
|
||||
<button id='button-closed-access'>Make questions closed access</button>
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ urlpatterns = [
|
||||
),
|
||||
path("exam/<int:pk>/", views.LongExamViews.exam_overview, name="exam_overview"),
|
||||
path("exam/<int:pk>/json_edit", views.LongExamViews.exam_json_edit, name="exam_json_edit"),
|
||||
path("exam/<int:pk>/question_json_refresh", views.refresh_exam_question_json, name="refresh_exam_question_json"),
|
||||
path("exam/<int:pk>/scores", views.exam_scores_cid, name="exam_scores_cid"),
|
||||
path(
|
||||
"exam/<int:pk>/scores/<int:sk>/",
|
||||
|
||||
+13
-1
@@ -1028,4 +1028,16 @@ def user_answer_delete_multiple(request):
|
||||
for id in answer_ids:
|
||||
CidUserAnswer.objects.get(pk=id).delete()
|
||||
return HttpResponseRedirect(request.path_info)
|
||||
return HttpResponse("/")
|
||||
return HttpResponse("/")
|
||||
|
||||
|
||||
@user_passes_test(lambda u: u.is_superuser)
|
||||
def refresh_exam_question_json(request, pk):
|
||||
exam = Exam.objects.get(pk=pk)
|
||||
|
||||
for question in exam.exam_questions.all():
|
||||
question.recreate_json = True
|
||||
question.save()
|
||||
|
||||
return redirect("longs:exam_overview", pk=pk)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user