This commit is contained in:
Ross
2021-07-07 18:14:26 +01:00
parent 2c76fd7156
commit fafe5eccaf
@@ -84,7 +84,7 @@
$(document).ready(function () { $(document).ready(function () {
$(".suggested_answers li").each((n, el) => { $(".suggested_answers li").each((n, el) => {
$(el).append($("<span class='confirm'>[Add Correct]</span>").on("click", function () { $(el).append($("<span class='correct'>[Add Correct]</span>").on("click", function () {
$.ajax({ $.ajax({
url: "{% url 'answer_submit' %}", url: "{% url 'answer_submit' %}",
data: { data: {
@@ -104,7 +104,7 @@
if (data.success) { if (data.success) {
toastr.info('Answer saved') toastr.info('Answer saved')
$(el).find(".confirm").remove() $(el).find(".correct").remove()
} }
// 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
@@ -120,7 +120,7 @@
$(".proposed-answer").each((n, el) => { $(".proposed-answer").each((n, el) => {
// Add button to confirm answer is correct // Add button to confirm answer is correct
$(el).append($("<span class='correct'>[Add Correct]</span>").on("click", function () { $(el).append($("<span class='confirm'>[Add Correct]</span>").on("click", function () {
$.ajax({ $.ajax({
url: "{% url 'answer_suggestion_confirm' %}", url: "{% url 'answer_suggestion_confirm' %}",
data: { data: {
@@ -139,7 +139,7 @@
if (data.success) { if (data.success) {
toastr.info('Answer saved') toastr.info('Answer saved')
$(el).find(".correct").remove() $(el).find(".confirm").remove()
$(el).removeClass("proposed-answer") $(el).removeClass("proposed-answer")
} }
// show some message according to the response. // show some message according to the response.