Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 414... Línea 414...
414
     *
414
     *
415
     * @method update_saved_time_display
415
     * @method update_saved_time_display
416
     */
416
     */
417
    update_saved_time_display: function() {
417
    update_saved_time_display: function() {
418
        // We fetch the current language's preferred time format from the language pack.
418
        // We fetch the current language's preferred time format from the language pack.
-
 
419
        require(['core/user_date', 'core/notification'], function(UserDate, Notification) {
-
 
420
            UserDate.get([{
-
 
421
                timestamp: Math.floor(Date.now() / 1000),
419
        var timeFormat = M.util.get_string('strftimedatetimeshortaccurate', 'langconfig');
422
                format: M.util.get_string('strftimedatetimeshortaccurate', 'langconfig'),
420
        var message = M.util.get_string('lastautosave', 'quiz', Y.Date.format(new Date(), {'format': timeFormat}));
423
            }]).then(function(dateStrs) {
421
 
-
 
422
        var infoDiv = Y.one('#mod_quiz_navblock .othernav .autosave_info');
424
                var infoDiv = Y.one('#mod_quiz_navblock .othernav .autosave_info');
423
        infoDiv.set('text', message);
425
                infoDiv.set('text', M.util.get_string('lastautosave', 'quiz', dateStrs[0]));
424
        infoDiv.show();
426
                infoDiv.show();
-
 
427
                return;
-
 
428
            }).catch(Notification.exception);
-
 
429
        });
425
    },
430
    },
Línea 426... Línea 431...
426
 
431
 
427
    is_time_nearly_over: function() {
432
    is_time_nearly_over: function() {
428
        return M.mod_quiz.timer && M.mod_quiz.timer.endtime &&
433
        return M.mod_quiz.timer && M.mod_quiz.timer.endtime &&