From 38c6734710c6c3be366b659adacaeb89b27d9959 Mon Sep 17 00:00:00 2001 From: Glib Glugovskiy Date: Sat, 22 Jun 2024 18:42:50 +0300 Subject: [PATCH] fix: don't display icon in offline mode --- lms/static/js/courseware/bridge.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lms/static/js/courseware/bridge.js b/lms/static/js/courseware/bridge.js index c988ceec76d5..c8b095f905d5 100644 --- a/lms/static/js/courseware/bridge.js +++ b/lms/static/js/courseware/bridge.js @@ -36,15 +36,20 @@ function sendMessageToAndroid(message) { function markProblemCompleted(message) { const data = JSON.parse(message).data; const problemContainer = $(".xblock-student_view"); + const submitButton = problemContainer.find(".submit-attempt-container .submit"); const notificationContainer = problemContainer.find(".notification-gentle-alert"); + submitButton.attr({disabled: "disabled"}); - notificationContainer.find(".notification-message").text("Answer submitted."); + notificationContainer.find(".notification-message").text("Answer submitted"); + notificationContainer.find(".icon").remove(); notificationContainer.show(); data.split("&").forEach(function (item) { const [inputId, answer] = item.split('=', 2); - problemContainer.find(`input[id$="${answer}"], input[id$="${inputId}"]`).each(function () { + problemContainer.find( + `input[id$="${answer}"], input[id$="${inputId}"]` + ).each(function () { this.disabled = true; if (this.type === "checkbox" || this.type === "radio") { this.checked = true;