Skip to content

Commit

Permalink
fix: don't display icon in offline mode
Browse files Browse the repository at this point in the history
  • Loading branch information
GlugovGrGlib committed Jun 22, 2024
1 parent bcc957e commit 38c6734
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lms/static/js/courseware/bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 38c6734

Please sign in to comment.