Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 426... Línea 426...
426
     *
426
     *
427
     * @method update_saved_time_display
427
     * @method update_saved_time_display
428
     */
428
     */
429
    update_saved_time_display: function() {
429
    update_saved_time_display: function() {
430
        // We fetch the current language's preferred time format from the language pack.
430
        // We fetch the current language's preferred time format from the language pack.
-
 
431
        require(['core/user_date', 'core/notification'], function(UserDate, Notification) {
-
 
432
            UserDate.get([{
-
 
433
                timestamp: Math.floor(Date.now() / 1000),
431
        var timeFormat = M.util.get_string('strftimedatetimeshortaccurate', 'langconfig');
434
                format: M.util.get_string('strftimedatetimeshortaccurate', 'langconfig'),
432
        var message = M.util.get_string('lastautosave', 'quiz', Y.Date.format(new Date(), {'format': timeFormat}));
435
            }]).then(function(dateStrs) {
433
 
-
 
434
        var infoDiv = Y.one('#mod_quiz_navblock .othernav .autosave_info');
436
                var infoDiv = Y.one('#mod_quiz_navblock .othernav .autosave_info');
435
        infoDiv.set('text', message);
437
                infoDiv.set('text', M.util.get_string('lastautosave', 'quiz', dateStrs[0]));
436
        infoDiv.show();
438
                infoDiv.show();
-
 
439
                return;
-
 
440
            }).catch(Notification.exception);
-
 
441
        });
437
    },
442
    },
Línea 438... Línea 443...
438
 
443
 
439
    is_time_nearly_over: function() {
444
    is_time_nearly_over: function() {
440
        return M.mod_quiz.timer && M.mod_quiz.timer.endtime &&
445
        return M.mod_quiz.timer && M.mod_quiz.timer.endtime &&