Skip to content

Commit

Permalink
refactor: [AXM-361] refactor block disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
NiedielnitsevIvan committed Jun 19, 2024
1 parent e697524 commit 3801f56
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lms/static/js/courseware/bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ function markProblemCompletedAndroid(message) {
function markProblemCompleted(message) {
const data = JSON.parse(message).data;

const problem = new Problem($(".xblock-student_view"));
problem.submitButton.attr({disabled: "disabled"});
problem.gentle_alert("Answer submitted.");
const prob = $(".xblock-student_view");
prob.find('.submit-attempt-container .submit').attr({disabled: "disabled"});
prob.find('.notification-gentle-alert .notification-message').html("Answer submitted.");
prob.find('.notification-gentle-alert').show();


data.split("&").forEach(function (item) {
const [, answer] = item.split('=', 2);
problem.el.find('input[id$="' + answer + '"]').each(function () {
const [input, answer] = item.split('=', 2);
prob.find('input[id$="' + answer + '"], input[id$="' + input + '"]').each(function () {
$(this).attr({disabled: "disabled"})
if (this.type === "checkbox" || this.type === "radio") {
this.checked = true;
} else {
Expand Down

0 comments on commit 3801f56

Please sign in to comment.