Improve exercise answers CSS style

pull/4037/head
Angel Fernando Quiroz Campos 3 years ago
parent 13055a868f
commit 5b619c43f0
  1. 6
      assets/css/app.scss
  2. 12
      assets/css/scss/_exercise.scss
  3. 2
      public/main/exercise/Draggable.php
  4. 2
      public/main/exercise/MatchingDraggable.php
  5. 2
      public/main/exercise/calculated_answer.class.php
  6. 4
      public/main/exercise/exercise.class.php
  7. 2
      public/main/exercise/global_multiple_answer.class.php
  8. 2
      public/main/exercise/matching.class.php
  9. 2
      public/main/exercise/multiple_answer.class.php
  10. 2
      public/main/exercise/multiple_answer_combination.class.php
  11. 2
      public/main/exercise/multiple_answer_true_false.class.php
  12. 4
      public/main/exercise/question.class.php
  13. 2
      public/main/exercise/unique_answer.class.php
  14. 2
      public/main/exercise/unique_answer_no_option.class.php
  15. 6
      public/main/inc/lib/exercise_show_functions.lib.php

@ -129,14 +129,12 @@
@apply bg-gray-50;
}
table thead th {
@apply py-2;
}
table tbody {
@apply bg-white divide-y divide-gray-200;
}
table thead th,
table tbody th,
table tbody td {
@apply px-2 py-1;
}

@ -211,6 +211,10 @@
@apply font-bold p-3;
}
&-description {
@apply mb-4;
}
&--no-ribbon {
@apply border-l-8;
@ -220,4 +224,12 @@
}
}
}
&__detail {
@apply mb-4;
th {
@apply text-left;
}
}
}

@ -212,7 +212,7 @@ class Draggable extends Question
} else {
$header .= '<th>'.get_lang('Elements list').'</th>';
}
$header .= '<th>'.get_lang('Status').'</th>';
$header .= '<th class="text-center">'.get_lang('Status').'</th>';
$header .= '</tr>';
return $header;

@ -266,7 +266,7 @@ class MatchingDraggable extends Question
}
if ($exercise->showExpectedChoice()) {
$header .= '<th>'.get_lang('Status').'</th>';
$header .= '<th class="text-center">'.get_lang('Status').'</th>';
}
$header .= '</tr>';

@ -259,7 +259,7 @@ class CalculatedAnswer extends Question
if ($exercise->showExpectedChoiceColumn()) {
$header .= '<th>'.get_lang('Expected choice').'</th>';
}
$header .= '<th>'.get_lang('Status').'</th>';
$header .= '<th class="text-center">'.get_lang('Status').'</th>';
}
$header .= '</tr>';

@ -4561,7 +4561,7 @@ class Exercise
}
echo '</td>';
}
echo '<td>'.$status.'</td>';
echo '<td class="text-center">'.$status.'</td>';
} else {
if (in_array($answerType, [MATCHING, MATCHING_DRAGGABLE])) {
if (isset($real_list[$i_answer_correct_answer]) &&
@ -4605,7 +4605,7 @@ class Exercise
$status = Display::label(get_lang('Correct'), 'success');
}
echo '<td>'.$s_answer_label.'</td>';
echo '<td>'.$status.'</td>';
echo '<td class="text-center">'.$status.'</td>';
} else {
echo '<td>'.$s_answer_label.'</td>';
echo '<td>'.$user_answer.'</td>';

@ -255,7 +255,7 @@ class GlobalMultipleAnswer extends Question
$header .= '<th>'.get_lang('Answer').'</th>';
if ($exercise->showExpectedChoice()) {
$header .= '<th>'.get_lang('Status').'</th>';
$header .= '<thclass="text-center">'.get_lang('Status').'</th>';
}
$header .= '<th>'.get_lang('Comment').'</th>';
$header .= '</tr>';

@ -285,7 +285,7 @@ class Matching extends Question
}
if ($exercise->showExpectedChoice()) {
$header .= '<th>'.get_lang('Status').'</th>';
$header .= '<th class="text-center">'.get_lang('Status').'</th>';
}
$header .= '</tr>';

@ -222,7 +222,7 @@ class MultipleAnswer extends Question
$header .= '<th>'.get_lang('Answer').'</th>';
if ($exercise->showExpectedChoice()) {
$header .= '<th>'.get_lang('Status').'</th>';
$header .= '<th class="text-center">'.get_lang('Status').'</th>';
}
if (false === $exercise->hideComment) {

@ -224,7 +224,7 @@ class MultipleAnswerCombination extends Question
$header .= '<th>'.get_lang('Answer').'</th>';
if ($exercise->showExpectedChoice()) {
$header .= '<th>'.get_lang('Status').'</th>';
$header .= '<th class="text-center">'.get_lang('Status').'</th>';
}
if (false === $exercise->hideComment) {
$header .= '<th>'.get_lang('Comment').'</th>';

@ -317,7 +317,7 @@ class MultipleAnswerTrueFalse extends Question
$header .= '<th>'.get_lang('Answer').'</th>';
if ($exercise->showExpectedChoice()) {
$header .= '<th>'.get_lang('Status').'</th>';
$header .= '<th class="text-center">'.get_lang('Status').'</th>';
}
if (EXERCISE_FEEDBACK_TYPE_EXAM != $exercise->getFeedbackType() ||
in_array(

@ -38,7 +38,7 @@ abstract class Question
public $feedback;
public $typePicture = 'new_question.png';
public $explanationLangVar = '';
public $question_table_class = 'table table-striped';
public $question_table_class = 'table table-striped question-answer-result__detail';
public $questionTypeWithFeedback;
public $extra;
public $export = false;
@ -1730,7 +1730,7 @@ abstract class Question
// Do not show the description (the text to read) if the question is of type READING_COMPREHENSION
$header .= Display::div(
$this->description,
['class' => 'question_description']
['class' => 'question-answer-result__header-description']
);
} else {
/** @var ReadingComprehension $this */

@ -445,7 +445,7 @@ class UniqueAnswer extends Question
$header .= '<th>'.get_lang('Answer').'</th>';
if ($exercise->showExpectedChoice()) {
$header .= '<th>'.get_lang('Status').'</th>';
$header .= '<th class="text-center">'.get_lang('Status').'</th>';
}
if (false === $exercise->hideComment) {
$header .= '<th>'.get_lang('Comment').'</th>';

@ -404,7 +404,7 @@ class UniqueAnswerNoOption extends Question
}
$header .= '<th>'.get_lang('Answer').'</th>';
if ($exercise->showExpectedChoice()) {
$header .= '<th>'.get_lang('Status').'</th>';
$header .= '<th class="text-center">'.get_lang('Status').'</th>';
}
if (false === $exercise->hideComment) {
$header .= '<th>'.get_lang('Comment').'</th>';

@ -423,7 +423,7 @@ class ExerciseShowFunctions
if ($answerCorrect || ($answerCorrect && $studentChoiceInt === $answerCorrectChoice)) {
$status = Display::label(get_lang('Correct'), 'success');
}
echo '<td width="20%">';
echo '<td class="text-center">';
// Show only status for the selected student answer BT#16256
if ($studentChoice) {
echo $status;
@ -551,7 +551,7 @@ class ExerciseShowFunctions
$status = Display::label(get_lang('Correct'), 'success');
}
}
$content .= '<td width="20%">';
$content .= '<td class="text-center">';
$content .= $status;
$content .= '</td>';
}
@ -779,7 +779,7 @@ class ExerciseShowFunctions
$status = Display::label(get_lang('Correct'), 'success');
}
}
echo '<td width="20%">';
echo '<td class="text-center">';
echo $status;
echo '</td>';
}

Loading…
Cancel
Save