diff --git a/generic/views.py b/generic/views.py index 8a4790d9..8dfe7098 100644 --- a/generic/views.py +++ b/generic/views.py @@ -362,7 +362,7 @@ class ExamViews(View, LoginRequiredMixin): True if request.POST.get("publish_results") == "true" else False ) 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) else: data = {"status": "error"} diff --git a/templates/exam_overview_js.html b/templates/exam_overview_js.html index d5f57557..5edbf493 100644 --- a/templates/exam_overview_js.html +++ b/templates/exam_overview_js.html @@ -40,7 +40,8 @@ console.log(data); 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. // For eg. A message box showing that the status has been changed