Merge branch 'MDL-82001-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE

This commit is contained in:
Huong Nguyen 2024-06-12 09:01:39 +07:00
commit 0d1cbfb3b7
No known key found for this signature in database
GPG Key ID: 40D88AB693A3E72A
4 changed files with 34 additions and 19 deletions

View File

@ -428,12 +428,17 @@ M.mod_quiz.autosave = {
*/
update_saved_time_display: function() {
// We fetch the current language's preferred time format from the language pack.
var timeFormat = M.util.get_string('strftimedatetimeshortaccurate', 'langconfig');
var message = M.util.get_string('lastautosave', 'quiz', Y.Date.format(new Date(), {'format': timeFormat}));
var infoDiv = Y.one('#mod_quiz_navblock .othernav .autosave_info');
infoDiv.set('text', message);
infoDiv.show();
require(['core/user_date', 'core/notification'], function(UserDate, Notification) {
UserDate.get([{
timestamp: Math.floor(Date.now() / 1000),
format: M.util.get_string('strftimedatetimeshortaccurate', 'langconfig'),
}]).then(function(dateStrs) {
var infoDiv = Y.one('#mod_quiz_navblock .othernav .autosave_info');
infoDiv.set('text', M.util.get_string('lastautosave', 'quiz', dateStrs[0]));
infoDiv.show();
return;
}).catch(Notification.exception);
});
},
is_time_nearly_over: function() {

File diff suppressed because one or more lines are too long

View File

@ -416,12 +416,17 @@ M.mod_quiz.autosave = {
*/
update_saved_time_display: function() {
// We fetch the current language's preferred time format from the language pack.
var timeFormat = M.util.get_string('strftimedatetimeshortaccurate', 'langconfig');
var message = M.util.get_string('lastautosave', 'quiz', Y.Date.format(new Date(), {'format': timeFormat}));
var infoDiv = Y.one('#mod_quiz_navblock .othernav .autosave_info');
infoDiv.set('text', message);
infoDiv.show();
require(['core/user_date', 'core/notification'], function(UserDate, Notification) {
UserDate.get([{
timestamp: Math.floor(Date.now() / 1000),
format: M.util.get_string('strftimedatetimeshortaccurate', 'langconfig'),
}]).then(function(dateStrs) {
var infoDiv = Y.one('#mod_quiz_navblock .othernav .autosave_info');
infoDiv.set('text', M.util.get_string('lastautosave', 'quiz', dateStrs[0]));
infoDiv.show();
return;
}).catch(Notification.exception);
});
},
is_time_nearly_over: function() {

View File

@ -426,12 +426,17 @@ M.mod_quiz.autosave = {
*/
update_saved_time_display: function() {
// We fetch the current language's preferred time format from the language pack.
var timeFormat = M.util.get_string('strftimedatetimeshortaccurate', 'langconfig');
var message = M.util.get_string('lastautosave', 'quiz', Y.Date.format(new Date(), {'format': timeFormat}));
var infoDiv = Y.one('#mod_quiz_navblock .othernav .autosave_info');
infoDiv.set('text', message);
infoDiv.show();
require(['core/user_date', 'core/notification'], function(UserDate, Notification) {
UserDate.get([{
timestamp: Math.floor(Date.now() / 1000),
format: M.util.get_string('strftimedatetimeshortaccurate', 'langconfig'),
}]).then(function(dateStrs) {
var infoDiv = Y.one('#mod_quiz_navblock .othernav .autosave_info');
infoDiv.set('text', M.util.get_string('lastautosave', 'quiz', dateStrs[0]));
infoDiv.show();
return;
}).catch(Notification.exception);
});
},
is_time_nearly_over: function() {