Use buttons instead of anchors in exercise submit - refs BT#12444

remotes/angel/1.11.x
Angel Fernando Quiroz Campos 8 years ago
parent d45b2a57b2
commit a8b5750640
  1. 30
      main/exercise/exercise.class.php
  2. 15
      main/exercise/exercise_submit.php

@ -6962,18 +6962,36 @@ class Exercise
$exercise_actions .= $this->show_button($questionId, $current_question, null, $remindList);
break;
case ALL_ON_ONE_PAGE:
$button = '<a href="javascript://" class="btn" onclick="save_now(\''.$questionId.'\', null, true, 1); ">'.get_lang('SaveForNow').'</a>';
$button .= '<span id="save_for_now_'.$questionId.'" class="exercise_save_mini_message"></span>&nbsp;';
$exercise_actions .= Display::div($button, array('class'=>'exercise_save_now_button'));
$button = [
Display::button(
'save_now',
get_lang('SaveForNow'),
['type' => 'button', 'class' => 'btn btn-primary', 'data-question' => $questionId]
),
'<span id="save_for_now_'.$questionId.'" class="exercise_save_mini_message"></span>'
];
$exercise_actions .= Display::div(
implode(PHP_EOL, $button),
array('class'=>'exercise_save_now_button')
);
break;
}
if (!empty($questions_in_media)) {
$count_of_questions_inside_media = count($questions_in_media);
if ($count_of_questions_inside_media > 1) {
$button = '<a href="javascript://" class="btn" onclick="save_now(\''.$questionId.'\', false, false, 0); ">'.get_lang('SaveForNow').'</a>';
$button .= '<span id="save_for_now_'.$questionId.'" class="exercise_save_mini_message"></span>&nbsp;';
$exercise_actions = Display::div($button, array('class'=>'exercise_save_now_button'));
$button = [
Display::button(
'save_now',
get_lang('SaveForNow'),
['type' => 'button', 'class' => 'btn btn-primary', 'data-question' => $questionId]
),
'<span id="save_for_now_'.$questionId.'" class="exercise_save_mini_message"></span>&nbsp;'
];
$exercise_actions = Display::div(
implode(PHP_EOL, $button),
array('class'=>'exercise_save_now_button')
);
}
if ($last_question_in_media && $this->type == ONE_PER_PAGE) {

@ -1278,9 +1278,18 @@ if (!empty($error)) {
$exercise_actions .= $objExercise->show_button($questionId, $current_question);
break;
case ALL_ON_ONE_PAGE :
$button = '<a href="javascript://" class="btn btn-info" onclick="save_now(\''.$questionId.'\'); ">'.get_lang('SaveForNow').'</a>';
$button .= '<span id="save_for_now_'.$questionId.'"></span>&nbsp;';
$exercise_actions .= Display::div($button, array('class'=>'exercise_save_now_button'));
$button = [
Display::button(
'save_now',
get_lang('SaveForNow'),
['type' => 'button', 'class' => 'btn btn-info', 'data-question' => $questionId]
),
'<span id="save_for_now_'.$questionId.'"></span>&nbsp;'
];
$exercise_actions .= Display::div(
implode(PHP_EOL, $button),
array('class'=>'exercise_save_now_button')
);
break;
}

Loading…
Cancel
Save