Minor - Format code, add docs

1.10.x
Julio Montoya 10 years ago
parent c2eb613a0e
commit 2393040ab8
  1. 5
      main/exercice/Draggable.php
  2. 4
      main/exercice/MatchingDraggable.php
  3. 6
      main/exercice/calculated_answer.class.php
  4. 8
      main/exercice/fill_blanks.class.php
  5. 8
      main/exercice/freeanswer.class.php
  6. 6
      main/exercice/global_multiple_answer.class.php
  7. 4
      main/exercice/multiple_answer_combination.class.php
  8. 1
      main/exercice/multiple_answer_combination_true_false.class.php
  9. 5
      main/exercice/multiple_answer_true_false.class.php
  10. 1
      main/exercice/oral_expression.class.php
  11. 4
      main/exercice/unique_answer.class.php

@ -1,5 +1,4 @@
<?php
/* For licensing terms, see /license.txt */
/**
@ -61,7 +60,7 @@ class Draggable extends Question
if (count($answer->nbrAnswers) > 0) {
$nb_matches = $nb_options = 0;
for ($i = 1; $i <= $answer->nbrAnswers; $i++) {
if ($answer->isCorrect($i)) {
$nb_matches++;
@ -134,7 +133,6 @@ class Draggable extends Question
}
$form->addHtml('</tbody></table>');
$group = array();
$renderer->setElementTemplate(
'<div class="form-group"><div class="col-sm-offset-2">{element}',
@ -220,5 +218,4 @@ class Draggable extends Question
return $header;
}
}

@ -1,5 +1,4 @@
<?php
/* For licensing terms, see /license.txt */
/**
@ -205,7 +204,7 @@ class MatchingDraggable extends Question
/**
* Process the creation of answers
* @param type $form
* @param FormValidator $form
*/
public function processAnswersCreation($form)
{
@ -258,5 +257,4 @@ class MatchingDraggable extends Question
return $header;
}
}

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Class CalculatedAnswer
* This class contains calculated answer form and answer processing functions
@ -24,7 +25,7 @@ class CalculatedAnswer extends Question
/**
* function which redefines Question::createAnswersForm
* @param the formvalidator instance
* @param FormValidator $form
*/
function createAnswersForm($form)
{
@ -161,7 +162,7 @@ class CalculatedAnswer extends Question
$form->addRule('answerVariations', get_lang('GiveAnswerVariations'),'required');
$form->setDefaults(array('answerVariations' => '1'));
global $text, $class;
global $text;
// setting the save button here and not in the question class.php
$form->addButtonSave($text, 'submitQuestion');
@ -273,6 +274,7 @@ class CalculatedAnswer extends Question
)
)
);
return empty($result) ? false : true;
}
}

@ -288,8 +288,6 @@ class FillBlanks extends Question
*/
public function processAnswersCreation($form)
{
global $charset;
$answer = $form->getSubmitValue('answer');
// Due the ckeditor transform the elements to their HTML value
@ -342,9 +340,9 @@ class FillBlanks extends Question
<p>I use a [computer] and a [pen].</p>
becomes
<p>I use a [computer] and a [pen].</p>::100,50:100,50@1
++++++++-------**
--- -- --- -- -
A B (C) (D)(E)
++++++++-------**
--- -- --- -- -
A B (C) (D)(E)
+++++++ : required, weighting of each words
------- : optional, input width to display, 200 if not present
** : equal @1 if "Allow answers order switches" has been checked, @ otherwise

@ -25,11 +25,11 @@ class FreeAnswer extends Question
/**
* function which redifines Question::createAnswersForm
* @param the formvalidator instance
* @param formvalidator $form
*/
function createAnswersForm($form)
{
$form->addElement('text', 'weighting', get_lang('Weighting'), array('class' => 'span1'));
$form->addElement('text', 'weighting', get_lang('Weighting'));
global $text, $class;
// setting the save button here and not in the question class.php
$form->addButtonSave($text, 'submitQuestion');
@ -43,8 +43,8 @@ class FreeAnswer extends Question
}
/**
* abstract function which creates the form to create / edit the answers of the question
* @param FormValidator
* abstract function which creates the form to create/edit the answers of the question
* @param FormValidator $form
*/
function processAnswersCreation($form)
{

@ -21,7 +21,7 @@ class GlobalMultipleAnswer extends Question
/**
* function which redefines Question::createAnswersForm
* @param the FormValidator
* @param FormValidator $form
*/
public function createAnswersForm($form)
{
@ -81,7 +81,7 @@ class GlobalMultipleAnswer extends Question
$defaults['comment[' . $i . ']'] = $answer->comment[$i];
$defaults['correct[' . $i . ']'] = $answer->correct[$i];
//------------- D<EFBFBD>but
// start
$scoreA = $answer->weighting[$i];
}
if ($scoreA > 0) {
@ -162,7 +162,7 @@ class GlobalMultipleAnswer extends Question
/**
* abstract function which creates the form to create / edit the answers of the question
* @param the FormValidator instance
* @param FormValidator $form
*/
function processAnswersCreation($form)
{

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Class MultipleAnswer
*
@ -11,7 +12,6 @@
**/
class MultipleAnswerCombination extends Question
{
static $typePicture = 'mcmac.png';
static $explanationLangVar = 'MultipleSelectCombination';
@ -27,7 +27,7 @@ class MultipleAnswerCombination extends Question
/**
* function which redifines Question::createAnswersForm
* @param $form FormValidator
* @param FormValidator $form
* @param the answers number to display
*/
function createAnswersForm($form)

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Class MultipleAnswer
*

@ -213,7 +213,7 @@ class MultipleAnswerTrueFalse extends Question
}
}
global $text, $class;
global $text;
if ($obj_ex->edit_exercise_in_lp == true) {
// setting the save button here and not in the question class.php
@ -289,7 +289,8 @@ class MultipleAnswerTrueFalse extends Question
$comment = trim($form -> getSubmitValue('comment['.$i.']'));
$goodAnswer = trim($form -> getSubmitValue('correct['.$i.']'));
if (empty($options)) {
//If this is the first time that the question is created when change the default values from the form 1 and 2 by the correct "option id" registered
//If this is the first time that the question is created when
// change the default values from the form 1 and 2 by the correct "option id" registered
$goodAnswer = $sorted_by_position[$goodAnswer]['id'];
}
$questionWeighting += $extra_values[0]; //By default 0 has the correct answers

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Class OralExpression
* This class allows to instantiate an object of type FREE_ANSWER,

@ -259,9 +259,7 @@ class UniqueAnswer extends Question
$form->addHtml('</tbody>');
$form->addHtml('</table>');
$navigator_info = api_get_navigator();
global $text, $class;
global $text;
$buttonGroup = [];
//ie6 fix

Loading…
Cancel
Save