Display question description collapsed - refs #8078

1.10.x
Angel Fernando Quiroz Campos 9 years ago
parent f029cfdaf3
commit 9b2d4e5e57
  1. 25
      main/exercice/exercise_submit.php
  2. 31
      main/inc/lib/display.lib.php

@ -738,10 +738,6 @@ if ($time_control) {
echo '<div style="display:none" class="warning-message" id="expired-message-id">'.get_lang('ExerciseExpiredTimeMessage').'</div>';
}
if (!empty($objExercise->description)){
echo Display::panelCollapse(get_lang('ExerciseDescriptionLabel'), $objExercise->description, 'exercise-description', null, 'description', 'exercise-collapse');
}
if ($origin != 'learnpath') {
echo '<div id="highlight-plugin" class="glossary-content">';
}
@ -877,6 +873,8 @@ if (!empty($error)) {
$(".question-validate-btn").first().trigger("click");
return false;
});*/
$(\'form#exercise_form\').prepend($(\'#exercise-description\'));
});
function previous_question(question_num) {
@ -1156,15 +1154,26 @@ if (!empty($error)) {
if ($objExercise->type == ALL_ON_ONE_PAGE) {
$exercise_actions = $objExercise->show_button($questionId, $current_question);
echo Display::div($exercise_actions, array('class'=>'exercise_actions'));
echo '<br>';
}
echo '</form>';
echo '</div>';
if (!empty($objExercise->description)){
echo Display::panelCollapse(
get_lang('ExerciseDescriptionLabel'),
$objExercise->description,
'exercise-description',
[],
'description',
'exercise-collapse',
false
);
}
}
if ($origin != 'learnpath') {
// So we are not in learnpath tool
echo '</div>'; //End glossary div
Display :: display_footer();
} else {
echo '</body></html>';
}
Display :: display_footer();

@ -2259,16 +2259,27 @@ class Display
$arrow = false
) {
if (!empty($idAccordion)) {
$html = null;
$html .= '<div class="panel-group" id="'.$idAccordion.'" role="tablist" aria-multiselectable="true">' . PHP_EOL;
$html .= '<div class="panel panel-default" id="'.$id.'">' . PHP_EOL;
$html .= '<div class="panel-heading" role="tab"><h4 class="panel-title">' . PHP_EOL;
$html .= '<a class="' . ($arrow===true?'arrow':'') . ' '.($open===true?'':'collapsed').'" role="button" data-toggle="collapse" data-parent="#'.$idAccordion.'" href="#'.$idCollapse.'" aria-expanded="true" aria-controls="'.$idCollapse.'">'.$title.'</a>' . PHP_EOL;
$html .= '</h4></div>' . PHP_EOL;
$html .= '<div id="'.$idCollapse.'" class="panel-collapse collapse '.($open===true?'in':'').'" role="tabpanel">' . PHP_EOL;
$html .= '<div class="panel-body">'.$content.'</div>' . PHP_EOL;
$html .= '</div></div></div>' . PHP_EOL;
$headerClass = '';
$headerClass .= $arrow ? 'arrow ' : '';
$headerClass .= $open ? '' : 'collapsed';
$contentClass = 'panel-collapse collapse ';
$contentClass .= $open ? 'in' : '';
$ariaExpanded = $open ? 'true' : 'false';
$html = <<<HTML
<div class="panel-group" id="$idAccordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-default" id="$id">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a class="$headerClass" role="button" data-toggle="collapse" data-parent="#$idAccordion" href="#$idCollapse" aria-expanded="$ariaExpanded" aria-controls="$idCollapse">$title</a>
</h4>
</div>
<div id="$idCollapse" class="$contentClass" role="tabpanel">
<div class="panel-body">$content</div>
</div>
</div>
</div>
HTML;
} else {
if (!empty($id)) {
$params['id'] = $id;

Loading…
Cancel
Save