Minor - format code

pull/2458/head
jmontoyaa 8 years ago
parent 03cb1c3773
commit 45baa90571
  1. 8
      main/exercise/MatchingDraggable.php
  2. 6
      main/exercise/global_multiple_answer.class.php
  3. 10
      main/exercise/matching.class.php
  4. 13
      main/exercise/multiple_answer.class.php
  5. 2
      main/exercise/multiple_answer_combination.class.php
  6. 1
      main/exercise/multiple_answer_true_false.class.php
  7. 4
      main/exercise/oral_expression.class.php

@ -99,10 +99,10 @@ class MatchingDraggable extends Question
$html = '<table class="table table-striped table-hover">
<thead>
<tr>
<th width="10">' . get_lang('Number').'</th>
<th width="85%">' . get_lang('Answer').'</th>
<th width="15%">' . get_lang('MatchesTo').'</th>
<th width="10">' . get_lang('Weighting').'</th>
<th width="10">'.get_lang('Number').'</th>
<th width="85%">'.get_lang('Answer').'</th>
<th width="15%">'.get_lang('MatchesTo').'</th>
<th width="10">'.get_lang('Weighting').'</th>
</tr>
</thead>
<tbody>';

@ -35,13 +35,13 @@ class GlobalMultipleAnswer extends Question
$html = '<table class="data_table">
<tr>
<th width="10px">
' . get_lang('Number').'
'.get_lang('Number').'
</th>
<th width="10px">
' . get_lang('True').'
'.get_lang('True').'
</th>
<th width="50%">
' . get_lang('Answer').'
'.get_lang('Answer').'
</th>';
$html .= '<th>'.get_lang('Comment').'</th>';

@ -41,7 +41,7 @@ class Matching extends Question
if (isset($this->id)) {
$answer = new Answer($this->id);
$answer->read();
if (count($answer->nbrAnswers) > 0) {
if (!empty($answer->nbrAnswers) && count($answer->nbrAnswers) > 0) {
for ($i = 1; $i <= $answer->nbrAnswers; $i++) {
$correct = $answer->isCorrect($i);
if (empty($correct)) {
@ -105,10 +105,10 @@ class Matching extends Question
$html = '<table class="table table-striped table-hover">
<thead>
<tr>
<th width="5%">' . get_lang('Number').'</th>
<th width="70%">' . get_lang('Answer').'</th>
<th width="15%">' . get_lang('MatchesTo').'</th>
<th width="10%">' . get_lang('Weighting').'</th>
<th width="5%">'.get_lang('Number').'</th>
<th width="70%">'.get_lang('Answer').'</th>
<th width="15%">'.get_lang('MatchesTo').'</th>
<th width="10%">'.get_lang('Weighting').'</th>
</tr>
</thead>
<tbody>';

@ -38,7 +38,8 @@ class MultipleAnswer extends Question
'Height' => '125'
];
$nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 4; // The previous default value was 2. See task #1759.
// The previous default value was 2. See task #1759.
$nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 4;
$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
$obj_ex = Session::read('objExercise');
@ -48,11 +49,11 @@ class MultipleAnswer extends Question
$html = '<table class="table table-striped table-hover">
<thead>
<tr>
<th width="10">' . get_lang('Number').'</th>
<th width="10">' . get_lang('True').'</th>
<th width="50%">' . get_lang('Answer').'</th>
<th width="50%">' . get_lang('Comment').'</th>
<th width="10">' . get_lang('Weighting').'</th>
<th width="10">'.get_lang('Number').'</th>
<th width="10">'.get_lang('True').'</th>
<th width="50%">'.get_lang('Answer').'</th>
<th width="50%">'.get_lang('Comment').'</th>
<th width="10">'.get_lang('Weighting').'</th>
</tr>
</thead>
<tbody>';

@ -198,8 +198,8 @@ class MultipleAnswerCombination extends Question
if ($goodAnswer) {
$weighting = abs($weighting);
} else {
// $weighting = -$weighting;
$weighting = abs($weighting);
// $weighting = -$weighting;
}
if ($weighting > 0) {
$questionWeighting += $weighting;

@ -62,7 +62,6 @@ class MultipleAnswerTrueFalse extends Question
$form->addHeader(get_lang('Answers'));
$form->addHtml($html);
$correct = 0;
$answer = null;
if (!empty($this->id)) {

@ -123,7 +123,9 @@ class OralExpression extends Question
mkdir($this->storePath.$this->sessionId.'/'.$this->exerciseId.'/'.$this->id);
}
if (!empty($this->userId) && !is_dir($this->storePath.$this->sessionId.'/'.$this->exerciseId.'/'.$this->id.'/'.$this->userId)) {
if (!empty($this->userId) &&
!is_dir($this->storePath.$this->sessionId.'/'.$this->exerciseId.'/'.$this->id.'/'.$this->userId)
) {
mkdir($this->storePath.$this->sessionId.'/'.$this->exerciseId.'/'.$this->id.'/'.$this->userId);
}

Loading…
Cancel
Save