Proyectos de Subversion Moodle

Rev

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

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