MDL-68913 assign: Address coding style issues

This commit is contained in:
Andrew Nicols
2021-11-11 10:55:39 +08:00
parent 940097de9e
commit fb7caf7982
5 changed files with 8 additions and 12 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
define ("mod_assign/timer",["exports","core/notification","core/str"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var d=0,e=null,f=null,g=function(a){var b=Math.floor(a/3600),c=Math.floor(a/60)%60;return[b,c,a%60].filter(function(a,b){return 0!==a||0<b}).map(function(a){return"".concat(a).padStart(2,"0")}).join(":")},h=function(){if(e){clearTimeout(e)}},i=function(){var a=new Date().getTime(),j=Math.floor((d-a)/1e3);if(0>=j){f.classList.add("alert","alert-danger");f.innerHTML="00:00:00";if(document.getElementById("mod_assign_timelimit_block")){(0,c.get_string)("caneditsubmission","mod_assign").done(function(a){return b.default.addNotification({type:"error",message:a})}).fail(b.default.exception)}h();return}else if(300>j){f.classList.remove("alert-warning");f.classList.add("alert","alert-danger")}else if(900>j){f.classList.remove("alert-danger");f.classList.add("alert","alert-warning")}f.innerHTML=g(j);e=setTimeout(i,500)},j=function(a){f=document.getElementById(a);d=M.pageloadstarttime.getTime()+1e3*f.dataset.starttime;i()};a.init=j});
define ("mod_assign/timer",["exports","core/notification","core/str"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var d=0,e=null,f=null,g=function(a){var b=Math.floor(a/3600),c=Math.floor(a/60)%60;return[b,c,a%60].filter(function(a,b){return 0!==a||0<b}).map(function(a){return"".concat(a).padStart(2,"0")}).join(":")},h=function(){if(e){clearTimeout(e)}},i=function(){var a=new Date().getTime(),j=Math.floor((d-a)/1e3);if(0>=j){f.classList.add("alert","alert-danger");f.innerHTML="00:00:00";if(document.getElementById("mod_assign_timelimit_block")){(0,c.get_string)("caneditsubmission","mod_assign").then(function(a){return b.default.addNotification({message:a})}).catch(b.default.exception)}h();return}else if(300>j){f.classList.remove("alert-warning");f.classList.add("alert","alert-danger")}else if(900>j){f.classList.remove("alert-danger");f.classList.add("alert","alert-warning")}f.innerHTML=g(j);e=setTimeout(i,500)},j=function(a){f=document.getElementById(a);d=M.pageloadstarttime.getTime()+1e3*f.dataset.starttime;i()};a.init=j});
//# sourceMappingURL=timer.min.js.map
File diff suppressed because one or more lines are too long
+2 -6
View File
@@ -92,12 +92,8 @@ const update = () => {
// Only add a notification on the assign submission page.
if (document.getElementById("mod_assign_timelimit_block")) {
getString('caneditsubmission', 'mod_assign')
.done(
str => Notification.addNotification({
type: "error",
message: str
})
).fail(Notification.exception);
.then(message => Notification.addNotification({message}))
.catch(Notification.exception);
}
stop();
@@ -23,8 +23,6 @@
*/
namespace mod_assign\output;
defined('MOODLE_INTERNAL') || die();
use renderable;
use renderer_base;
use stdClass;
+4 -2
View File
@@ -153,10 +153,12 @@ if ($ADMIN->fulltree) {
$name = new lang_string('enabletimelimit', 'mod_assign');
$description = new lang_string('enabletimelimit_help', 'mod_assign');
$setting = new admin_setting_configcheckbox('assign/enabletimelimit',
$setting = new admin_setting_configcheckbox(
'assign/enabletimelimit',
$name,
$description,
0);
0
);
$settings->add($setting);
$name = new lang_string('gradingduedate', 'mod_assign');