Fixing bug when entering the exercise_reminder.php and there's no alert if the time limit is on could fix bug #5304

skala
Julio Montoya 13 years ago
parent 7e727f0d01
commit e85be7bc49
  1. 14
      main/exercice/exercise.class.php
  2. 9
      main/exercice/exercise_reminder.php
  3. 4
      main/exercice/exercise_submit.php

@ -1662,8 +1662,7 @@ class Exercise {
send_form();
}
});
$('#clock_warning').dialog('open');
$('#clock_warning').dialog('open');
$('#counter_to_redirect').epiclock({
mode: $.epiclock.modes.countdown,
@ -1677,7 +1676,12 @@ class Exercise {
function send_form() {
//console.log('send_form');
$('#exercise_form').submit();
if ($('#exercise_form').length) {
$('#exercise_form').submit();
} else {
//In reminder
final_submit();
}
}
function onExpiredTimeExercise() {
@ -3601,7 +3605,9 @@ class Exercise {
}
function return_time_left_div() {
return '<div id="exercise_clock_warning" class="well count_down"></div>';
$html = '<div id="clock_warning" style="display:none">'.Display::return_message(get_lang('ReachedTimeLimit'), 'warning').' '.sprintf(get_lang('YouWillBeRedirectedInXSeconds'), '<span id="counter_to_redirect" class="red_alert"></span>').'</div>';
$html .= '<div id="exercise_clock_warning" class="well count_down"></div>';
return $html;
}
}
endif;

@ -112,14 +112,14 @@ if ($time_control) {
echo Display::div('', array('id'=>'message'));
echo '<script>
echo '<script>
lp_data = $.param({"learnpath_id": '.$learnpath_id.', "learnpath_item_id" : '.$learnpath_item_id.', "learnpath_item_view_id": '.$learnpath_item_view_id.'});
function final_submit() {
//Normal inputs
window.location = "exercise_result.php?origin='.$origin.'&exe_id='.$exe_id.'&" + lp_data;
}
}
function review_questions() {
var is_checked = 1;
$("input[type=checkbox]").each(function () {
@ -207,7 +207,6 @@ foreach ($question_list as $questionId) {
$label_attributes['for'] = $check_id;
$label_attributes['class'] = "checkbox";
$checkbox = Display::input('checkbox', 'remind_list['.$questionId.']', '', $attributes);
$url = 'exercise_submit.php?exerciseId='.$objExercise->id.'&num='.$counter.'&reminder=1';
@ -232,10 +231,8 @@ $exercise_actions = Display::url(get_lang('EndTest'), 'javascript://', array('on
$exercise_actions .= '&nbsp;'.Display::url(get_lang('ReviewQuestions'), 'javascript://', array('onclick'=>'review_questions();','class'=>'btn'));
echo Display::div('', array('class'=>'clear'));
echo Display::div($exercise_actions, array('class'=>'form-actions'));
if ($origin != 'learnpath') {
//we are not in learnpath tool
Display::display_footer();

@ -922,9 +922,7 @@ if (!empty($error)) {
return false;
}
</script>';
echo '<div id="clock_warning" style="display:none">'.Display::return_message(get_lang('ReachedTimeLimit'), 'warning').' '.sprintf(get_lang('YouWillBeRedirectedInXSeconds'), '<span id="counter_to_redirect" class="red_alert"></span>').'</div>';
echo '<form id="exercise_form" method="post" action="'.api_get_self().'?'.api_get_cidreq().'&autocomplete=off&gradebook='.$gradebook."&exerciseId=" . $exerciseId .'" name="frm_exercise" '.$onsubmit.'>
<input type="hidden" name="formSent" value="1" />
<input type="hidden" name="exerciseId" value="'.$exerciseId . '" />

Loading…
Cancel
Save