Minor - format code

pull/2487/head
jmontoyaa 8 years ago
parent 5d3fdeb8e3
commit c7d398f9de
  1. 18
      main/exercise/exercise.class.php
  2. 2
      main/exercise/exercise_reminder.php
  3. 19
      main/exercise/exercise_submit.php
  4. 2
      main/exercise/overview.php

@ -3051,8 +3051,12 @@ class Exercise
* @param string $currentAnswer
* @return string
*/
public function show_button($question_id, $questionNum, $questions_in_media = array(), $currentAnswer = '')
{
public function show_button(
$question_id,
$questionNum,
$questions_in_media = array(),
$currentAnswer = ''
) {
global $origin, $safe_lp_id, $safe_lp_item_id, $safe_lp_item_view_id;
$nbrQuestions = $this->get_count_question_list();
$all_button = [];
@ -3101,7 +3105,8 @@ class Exercise
$label = get_lang('NextQuestion');
$class = 'btn btn-primary';
}
$class .= ' question-validate-btn'; // used to select it with jquery
// used to select it with jquery
$class .= ' question-validate-btn';
if ($this->type == ONE_PER_PAGE) {
if ($questionNum != 1) {
if ($this->showPreviousButton()) {
@ -3119,7 +3124,7 @@ class Exercise
}
}
//Next question
// Next question
if (!empty($questions_in_media)) {
$all_button[] = Display::button(
'save_question_list',
@ -3148,7 +3153,8 @@ class Exercise
$all_label = get_lang('EndTest');
$class = 'btn btn-warning';
}
$class .= ' question-validate-btn'; // used to select it with jquery
// used to select it with jquery
$class .= ' question-validate-btn';
$all_button[] = Display::button(
'validate_all',
$all_label,
@ -3169,7 +3175,7 @@ class Exercise
* @param string $time_left
* @return string
*/
public function show_time_control_js($time_left)
public function showTimeControlJS($time_left)
{
$time_left = intval($time_left);
return "<script>

@ -89,7 +89,7 @@ if ($time_control) {
$htmlHeadXtra[] = api_get_js('epiclock/javascript/jquery.dateformat.min.js');
$htmlHeadXtra[] = api_get_js('epiclock/javascript/jquery.epiclock.min.js');
$htmlHeadXtra[] = api_get_js('epiclock/renderers/minute/epiclock.minute.js');
$htmlHeadXtra[] = $objExercise->show_time_control_js($time_left);
$htmlHeadXtra[] = $objExercise->showTimeControlJS($time_left);
}
$exe_id = 0;

@ -549,7 +549,7 @@ $time_left = api_strtotime($clock_expired_time, 'UTC') - time();
* for more details of how it works see this link : http://eric.garside.name/docs.html?p=epiclock
*/
if ($time_control) { //Sends the exercise form when the expired time is finished
$htmlHeadXtra[] = $objExercise->show_time_control_js($time_left);
$htmlHeadXtra[] = $objExercise->showTimeControlJS($time_left);
}
//in LP's is enabled the "remember question" feature?
@ -1307,7 +1307,7 @@ if (!empty($error)) {
$remind_highlight = 'no_remind_highlight';
}
$exercise_actions = '';
$exerciseActions = '';
$is_remind_on = false;
$attributes = array('id' =>'remind_list['.$questionId.']');
@ -1351,7 +1351,7 @@ if (!empty($error)) {
// Button save and continue
switch ($objExercise->type) {
case ONE_PER_PAGE:
$exercise_actions .= $objExercise->show_button(
$exerciseActions .= $objExercise->show_button(
$questionId,
$current_question
);
@ -1365,7 +1365,7 @@ if (!empty($error)) {
),
'<span id="save_for_now_'.$questionId.'"></span>&nbsp;'
];
$exercise_actions .= Display::div(
$exerciseActions .= Display::div(
implode(PHP_EOL, $button),
array('class'=>'exercise_save_now_button')
);
@ -1387,12 +1387,12 @@ if (!empty($error)) {
'for' => 'remind_list['.$questionId.']'
)
);
$exercise_actions .= Display::div(
$exerciseActions .= Display::div(
$remind_question_div,
array('class' => 'exercise_save_now_button')
);
}
echo Display::div($exercise_actions, array('class'=>'form-actions'));
echo Display::div($exerciseActions, array('class'=>'form-actions'));
echo '</div>';
$i++;
@ -1404,8 +1404,11 @@ if (!empty($error)) {
}
// end foreach()
if ($objExercise->type == ALL_ON_ONE_PAGE) {
$exercise_actions = $objExercise->show_button($questionId, $current_question);
echo Display::div($exercise_actions, array('class'=>'exercise_actions'));
$exerciseActions = $objExercise->show_button(
$questionId,
$current_question
);
echo Display::div($exerciseActions, array('class'=>'exercise_actions'));
echo '<br>';
}
echo '</form>';

@ -56,7 +56,7 @@ if ($time_control) {
$htmlHeadXtra[] = api_get_js('epiclock/javascript/jquery.dateformat.min.js');
$htmlHeadXtra[] = api_get_js('epiclock/javascript/jquery.epiclock.min.js');
$htmlHeadXtra[] = api_get_js('epiclock/renderers/minute/epiclock.minute.js');
$htmlHeadXtra[] = $objExercise->show_time_control_js($time_left);
$htmlHeadXtra[] = $objExercise->showTimeControlJS($time_left);
}
if ($origin != 'learnpath') {

Loading…
Cancel
Save