.
This commit is contained in:
+1
-1
@@ -362,7 +362,7 @@ class ExamViews(View, LoginRequiredMixin):
|
|||||||
True if request.POST.get("publish_results") == "true" else False
|
True if request.POST.get("publish_results") == "true" else False
|
||||||
)
|
)
|
||||||
exam.save()
|
exam.save()
|
||||||
data = {"status": "success", "publish_results": exam.publish_results}
|
data = {"status": "success", "publish_results": exam.publish_results, "name": exam.name}
|
||||||
return JsonResponse(data, status=200)
|
return JsonResponse(data, status=200)
|
||||||
else:
|
else:
|
||||||
data = {"status": "error"}
|
data = {"status": "error"}
|
||||||
|
|||||||
@@ -40,7 +40,8 @@
|
|||||||
console.log(data);
|
console.log(data);
|
||||||
|
|
||||||
if (data.status == "success") {
|
if (data.status == "success") {
|
||||||
toastr.info('Publish results state changed.')
|
toastr.info(`Exam: ${data.name}
|
||||||
|
Published state changed to: ${data.publish_results}.`)
|
||||||
}
|
}
|
||||||
// show some message according to the response.
|
// show some message according to the response.
|
||||||
// For eg. A message box showing that the status has been changed
|
// For eg. A message box showing that the status has been changed
|
||||||
|
|||||||
Reference in New Issue
Block a user