added intervention modals back into editor.js and html

This commit is contained in:
Thomas Hille
2017-02-27 15:32:51 +01:00
parent b41a858762
commit 2caf4b123e
3 changed files with 40 additions and 2 deletions

View File

@@ -571,6 +571,29 @@ configureEditors: function () {
},
/**
* interventions
* */
initializeInterventionTimer: function() {
$.ajax({
data: {
exercise_id: $('#editor').data('exercise-id'),
user_id: $('#editor').data('user-id')
},
dataType: 'json',
method: 'GET',
url: $('#editor').data('working-times-url'),
success: function (data) {
var avg = data['working_time_avg'];
var accu = data['working_time_accumulated'];
$('#avg-working-time').text(`avg time: ${avg} and accumulated time: ${accu}`);
setTimeout(function() {
$('#intervention-modal').modal('show')
}, 10000);
}
});
},
initializeEverything: function() {
this.initializeRegexes();
@@ -585,6 +608,7 @@ configureEditors: function () {
this.initializeDescriptionToggle();
this.initializeSideBarTooltips();
this.initializeTooltips();
this.initializeInterventionTimer();
this.initPrompt();
this.renderScore();
this.showFirstFile();