MDL-66958 core_grade: Add comparison js for grade saves
[moodle.git] / grade / amd / build / grades / grader / gradingpanel / comparison.min.js
1 define ("core_grades/grades/grader/gradingpanel/comparison",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.compareData=a.fillInitialValues=void 0;var b=function(a){Array.prototype.forEach.call(a.elements,function(a){if("submit"===a.type||"button"===a.type){}else if("radio"===a.type||"checkbox"===a.type){a.dataset.initialValue=JSON.stringify(a.checked)}else if("undefined"!=typeof a.value){a.dataset.initialValue=JSON.stringify(a.value)}else if("select-one"===a.type){Array.prototype.forEach.call(a.options,function(a){a.dataset.initialValue=JSON.stringify(a.selected)})}})};a.fillInitialValues=b;a.compareData=function compareData(a){var c=Array.prototype.some.call(a.elements,function(a){if("submit"===a.type||"button"===a.type){return!1}else if("radio"===a.type||"checkbox"===a.type){if("undefined"!=typeof a.dataset.initialValue){return a.dataset.initialValue!==JSON.stringify(a.checked)}}else if("undefined"!=typeof a.value){if("undefined"!=typeof a.dataset.initialValue){return a.dataset.initialValue!==JSON.stringify(a.value)}}else if("select-one"===a.type){return Array.prototype.some.call(a.options,function(a){if("undefined"!=typeof a.dataset.initialValue){return a.dataset.initialValue!==JSON.stringify(a.selected)}return!1})}return!0});b(a);return c}});
2 //# sourceMappingURL=comparison.min.js.map