Fix exercise question UI BT#17381

pull/3294/head
Julio Montoya 6 years ago
parent 4443fd947b
commit adbe2bbbf0
  1. 37
      main/exercise/MultipleAnswerTrueFalseDegreeCertainty.php
  2. 29
      main/exercise/global_multiple_answer.class.php
  3. 10
      main/exercise/multiple_answer_true_false.class.php

@ -65,22 +65,21 @@ class MultipleAnswerTrueFalseDegreeCertainty extends Question
$renderer = &$form->defaultRenderer();
$defaults = [];
$html = '<table class="data_table"><tr style="text-align: center;"><th>'
.get_lang('Number')
.'</th><th>'
.get_lang('True')
.'</th><th>'
.get_lang('False')
.'</th><th>'
.get_lang('Answer')
.'</th>';
$form->addHeader(get_lang('Answers'));
$html = '<table class="table table-striped table-hover">
<tr>
<th width="10px">'.get_lang('Number').'</th>
<th width="10px">'.get_lang('True').'</th>
<th width="10px">'.get_lang('False').'</th>
<th width="50%">'.get_lang('Answer').'</th>';
// show column comment when feedback is enable
if ($objEx->getFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) {
$html .= '<th>'.get_lang('Comment').'</th>';
$html .= '<th width="50%">'.get_lang('Comment').'</th>';
}
$html .= '</tr>';
$form->addElement('label', get_lang('Answers').'<br /> <img src="../img/fill_field.png">', $html);
$form->addHtml($html);
$correct = 0;
$answer = null;
@ -831,17 +830,17 @@ class MultipleAnswerTrueFalseDegreeCertainty extends Question
$colWidth = $widthTable / 5;
$html .= '<tr>
<td class="firstLine borderRight '.$classGlobalChart.'"
colspan="2"
<td class="firstLine borderRight '.$classGlobalChart.'"
colspan="2"
style="width:'.($colWidth * 2).'px; line-height: 15px; font-size:'.$textSize.'%;">'.
sprintf(get_lang('IncorrectAnswersX'), $nbResponsesInc).'
</td>
<td class="firstLine borderRight '.$classGlobalChart.'"
<td class="firstLine borderRight '.$classGlobalChart.'"
style="width:'.$colWidth.'px; line-height: 15px; font-size :'.$textSize.'%;">'.
sprintf(get_lang('IgnoranceAnswersX'), $nbResponsesIng).'
</td>
<td class="firstLine '.$classGlobalChart.'"
colspan="2"
<td class="firstLine '.$classGlobalChart.'"
colspan="2"
style="width:'.($colWidth * 2).'px; line-height: 15px; font-size:'.$textSize.'%;">'.
sprintf(get_lang('CorrectAnswersX'), $nbResponsesCor).'
</td>
@ -1147,8 +1146,8 @@ class MultipleAnswerTrueFalseDegreeCertainty extends Question
$tblAnswerOption = Database::get_course_table(TABLE_QUIZ_QUESTION_OPTION);
$courseId = api_get_course_int_id();
$optionId = (int) $optionId;
$sql = "SELECT position
FROM $tblAnswerOption
$sql = "SELECT position
FROM $tblAnswerOption
WHERE c_id = $courseId AND id = $optionId";
$res = Database::query($sql);
@ -1232,7 +1231,7 @@ class MultipleAnswerTrueFalseDegreeCertainty extends Question
$tableTrackEExercise = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$exeId = (int) $exeId;
$sql = "SELECT exe_exo_id
$sql = "SELECT exe_exo_id
FROM $tableTrackEExercise
WHERE exe_id=".$exeId;
$res = Database::query($sql);

@ -32,27 +32,18 @@ class GlobalMultipleAnswer extends Question
$obj_ex = Session::read('objExercise');
$form->addHeader(get_lang('Answers'));
/* Mise en variable de Affichage "Reponses" et son icone, "N<EFBFBD>", "Vrai", "Reponse" */
$html = '<table class="data_table">
$html = '<table class="table table-striped table-hover">
<tr>
<th width="10px">
'.get_lang('Number').'
</th>
<th width="10px">
'.get_lang('True').'
</th>
<th width="50%">
'.get_lang('Answer').'
</th>';
$html .= '<th>'.get_lang('Comment').'</th>';
$html .= '</tr>';
$form->addElement(
'label',
get_lang('Answers').
'<br /> '.Display::return_icon('fill_field.png'),
$html
);
<th width="10px">'.get_lang('Number').'</th>
<th width="10px">'.get_lang('True').'</th>
<th width="50%">'.get_lang('Answer').'</th>
<th width="50%">'.get_lang('Comment').'</th>
</tr>
';
$form->addHtml($html);
$defaults = [];
$correct = 0;
$answer = false;

@ -45,14 +45,14 @@ class MultipleAnswerTrueFalse extends Question
$html = '<table class="table table-striped table-hover">';
$html .= '<thead>';
$html .= '<tr>';
$html .= '<th>'.get_lang('Number').'</th>';
$html .= '<th>'.get_lang('True').'</th>';
$html .= '<th>'.get_lang('False').'</th>';
$html .= '<th>'.get_lang('Answer').'</th>';
$html .= '<th width="10px">'.get_lang('Number').'</th>';
$html .= '<th width="10px">'.get_lang('True').'</th>';
$html .= '<th width="10px">'.get_lang('False').'</th>';
$html .= '<th width="50%">'.get_lang('Answer').'</th>';
// show column comment when feedback is enable
if ($obj_ex->getFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) {
$html .= '<th>'.get_lang('Comment').'</th>';
$html .= '<th width="50%">'.get_lang('Comment').'</th>';
}
$html .= '</tr>';

Loading…
Cancel
Save