show flash message if permitted execution time is exceeded during test execution
This commit is contained in:
@ -394,10 +394,17 @@ $(function() {
|
|||||||
$('#results ul').first().html('');
|
$('#results ul').first().html('');
|
||||||
$('.test-count .number').html(response.length);
|
$('.test-count .number').html(response.length);
|
||||||
clearOutput();
|
clearOutput();
|
||||||
|
|
||||||
_.each(response, function(result, index) {
|
_.each(response, function(result, index) {
|
||||||
printOutput(result, false, index);
|
printOutput(result, false, index);
|
||||||
printScoringResult(result, index);
|
printScoringResult(result, index);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (_.some(response, function(result) {
|
||||||
|
return result.status === 'timeout';
|
||||||
|
})) {
|
||||||
|
showTimeoutMessage();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var renderCode = function(event) {
|
var renderCode = function(event) {
|
||||||
@ -559,10 +566,7 @@ $(function() {
|
|||||||
|
|
||||||
var showStatus = function(output) {
|
var showStatus = function(output) {
|
||||||
if (output.status === 'timeout') {
|
if (output.status === 'timeout') {
|
||||||
$.flash.danger({
|
showTimeoutMessage();
|
||||||
icon: ['fa', 'fa-clock-o'],
|
|
||||||
text: $('#editor').data('message-timeout')
|
|
||||||
});
|
|
||||||
} else if (output.stderr) {
|
} else if (output.stderr) {
|
||||||
$.flash.danger({
|
$.flash.danger({
|
||||||
icon: ['fa', 'fa-bug'],
|
icon: ['fa', 'fa-bug'],
|
||||||
@ -580,6 +584,13 @@ $(function() {
|
|||||||
$('a[data-toggle="tab"]').eq(index || 0).tab('show');
|
$('a[data-toggle="tab"]').eq(index || 0).tab('show');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var showTimeoutMessage = function() {
|
||||||
|
$.flash.danger({
|
||||||
|
icon: ['fa', 'fa-clock-o'],
|
||||||
|
text: $('#editor').data('message-timeout')
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
var showWorkspaceTab = function(event) {
|
var showWorkspaceTab = function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
showTab(1);
|
showTab(1);
|
||||||
|
Reference in New Issue
Block a user