mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-82001 mod_quiz: respect user language in draft save message text.
This commit is contained in:
parent
bcae2164ac
commit
a49c099ae5
@ -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
@ -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() {
|
||||
|
17
mod/quiz/yui/src/autosave/js/autosave.js
vendored
17
mod/quiz/yui/src/autosave/js/autosave.js
vendored
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user