This commit is contained in:
Ross
2022-01-03 17:16:25 +00:00
parent cf6395cef3
commit f5aa2693d3
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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"}
+2 -1
View File
@@ -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