Minor - format code

pull/2487/head
jmontoyaa 8 years ago
parent b26e1ae46d
commit 0436bea0e4
  1. 3
      main/exercise/Draggable.php
  2. 3
      main/exercise/MatchingDraggable.php
  3. 2
      main/exercise/UniqueAnswerImage.php
  4. 6
      main/exercise/admin.php
  5. 3
      main/exercise/calculated_answer.class.php
  6. 3
      main/exercise/fill_blanks.class.php
  7. 5
      main/exercise/freeanswer.class.php
  8. 3
      main/exercise/global_multiple_answer.class.php
  9. 27
      main/exercise/matching.class.php
  10. 6
      main/exercise/multiple_answer.class.php
  11. 5
      main/exercise/multiple_answer_combination.class.php
  12. 3
      main/exercise/multiple_answer_true_false.class.php
  13. 3
      main/exercise/oral_expression.class.php
  14. 3
      main/exercise/question_admin.inc.php
  15. 15
      main/exercise/question_list_admin.inc.php
  16. 3
      main/exercise/unique_answer.class.php

@ -22,8 +22,7 @@ class Draggable extends Question
}
/**
* Function which redefines Question::createAnswersForm
* @param FormValidator $form
* @inheritdoc
*/
public function createAnswersForm($form)
{

@ -23,8 +23,7 @@ class MatchingDraggable extends Question
}
/**
* function which redefines Question::createAnswersForm
* @param FormValidator $form
* @inheritdoc
*/
public function createAnswersForm($form)
{

@ -24,7 +24,7 @@ class UniqueAnswerImage extends UniqueAnswer
}
/**
* @param FormValidator $form
* @inheritdoc
* @throws Exception
*/
public function createAnswersForm($form)

@ -293,14 +293,14 @@ if (!empty($gradebook) && $gradebook=='view') {
}
$interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises'));
if (isset($_GET['newQuestion']) || isset($_GET['editQuestion']) ) {
if (isset($_GET['newQuestion']) || isset($_GET['editQuestion'])) {
$interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$objExercise->id, "name" => $objExercise->name);
} else {
$interbreadcrumb[] = array("url" => "#", "name" => $objExercise->name);
}
// shows a link to go back to the question pool
if (!$exerciseId && $nameTools != get_lang('ExerciseManagement')){
if (!$exerciseId && $nameTools != get_lang('ExerciseManagement')) {
$interbreadcrumb[]=array(
"url" => api_get_path(WEB_CODE_PATH)."exercise/question_pool.php?fromExercise=$fromExercise&".api_get_cidreq(),
"name" => get_lang('QuestionPool')
@ -309,7 +309,7 @@ if (!$exerciseId && $nameTools != get_lang('ExerciseManagement')){
// if the question is duplicated, disable the link of tool name
if ($modifyIn == 'thisExercise') {
if($buttonBack) {
if ($buttonBack) {
$modifyIn='allExercises';
} else {
$noPHP_SELF=true;

@ -26,8 +26,7 @@ class CalculatedAnswer extends Question
}
/**
* function which redefines Question::createAnswersForm
* @param FormValidator $form
* @inheritdoc
*/
public function createAnswersForm($form)
{

@ -28,8 +28,7 @@ class FillBlanks extends Question
}
/**
* function which redefines Question::createAnswersForm
* @param FormValidator $form
* @inheritdoc
*/
public function createAnswersForm($form)
{

@ -24,10 +24,9 @@ class FreeAnswer extends Question
}
/**
* function which redifines Question::createAnswersForm
* @param formvalidator $form
* @inheritdoc
*/
function createAnswersForm($form)
public function createAnswersForm($form)
{
$form->addElement('text', 'weighting', get_lang('Weighting'));
global $text, $class;

@ -22,8 +22,7 @@ class GlobalMultipleAnswer extends Question
}
/**
* function which redefines Question::createAnswersForm
* @param FormValidator $form
* @inheritdoc
*/
public function createAnswersForm($form)
{

@ -2,15 +2,15 @@
/* For licensing terms, see /license.txt */
/**
* Class Matching
* Matching questions type class
* Class Matching
* Matching questions type class
*
* This class allows to instantiate an object of
* type MULTIPLE_ANSWER (MULTIPLE CHOICE, MULTIPLE ANSWER)
* extending the class question
* This class allows to instantiate an object of
* type MULTIPLE_ANSWER (MULTIPLE CHOICE, MULTIPLE ANSWER)
* extending the class question
*
* @author Eric Marguin
* @package chamilo.exercise
* @author Eric Marguin
* @package chamilo.exercise
*/
class Matching extends Question
{
@ -43,7 +43,6 @@ class Matching extends Question
if (isset($this->id)) {
$answer = new Answer($this->id);
$answer->read();
if (count($answer->nbrAnswers) > 0) {
for ($i = 1; $i <= $answer->nbrAnswers; $i++) {
$correct = $answer->isCorrect($i);
@ -121,7 +120,9 @@ class Matching extends Question
if ($nb_matches < 1) {
$nb_matches = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
Display::addFlash(
Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'))
);
}
for ($i = 1; $i <= $nb_matches; ++$i) {
@ -172,22 +173,21 @@ class Matching extends Question
if ($nb_options < 1) {
$nb_options = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
Display::addFlash(
Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'))
);
}
for ($i = 1; $i <= $nb_options; ++$i) {
$renderer = &$form->defaultRenderer();
$renderer->setElementTemplate(
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error -->{element}</td>',
"option[$i]"
);
$form->addHtml('<tr>');
$form->addHtml('<td>' . chr(64 + $i) . '</td>');
$form->addText("option[$i]", null);
$form->addHtml('</tr>');
}
@ -228,7 +228,6 @@ class Matching extends Question
$nb_options = $form->getSubmitValue('nb_options');
$this->weighting = 0;
$position = 0;
$objAnswer = new Answer($this->id);
// Insert the options

@ -28,11 +28,9 @@ class MultipleAnswer extends Question
}
/**
* function which redifines Question::createAnswersForm
* @param the formvalidator instance
* @param the answers number to display
* @inheritdoc
*/
function createAnswersForm($form)
public function createAnswersForm($form)
{
$editorConfig = array(
'ToolbarSet' => 'TestProposedAnswer',

@ -29,10 +29,9 @@ class MultipleAnswerCombination extends Question
}
/**
* function which redefines Question::createAnswersForm
* @param FormValidator $form
* @inheritdoc
*/
function createAnswersForm($form)
public function createAnswersForm($form)
{
$nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 2;
$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));

@ -29,8 +29,7 @@ class MultipleAnswerTrueFalse extends Question
}
/**
* function which redefines Question::createAnswersForm
* @param FormValidator $form
* @inheritdoc
*/
public function createAnswersForm($form)
{

@ -33,8 +33,7 @@ class OralExpression extends Question
}
/**
* function which redefine Question::createAnswersForm
* @param FormValidator $form
* @inheritdoc
*/
public function createAnswersForm($form)
{

@ -2,7 +2,6 @@
/* For licensing terms, see /license.txt */
/**
* Statement (?) administration
* This script allows to manage the statements of questions.
* It is included from the script admin.php
* @package chamilo.exercise
@ -35,7 +34,7 @@ if (is_object($objQuestion)) {
$form_title_extra = isset($typesInformation[$type][1]) ? get_lang($typesInformation[$type][1]) : null;
// form title
$form->addElement('header', $text.': '.$form_title_extra);
$form->addHeader($text.': '.$form_title_extra);
// question form elements
$objQuestion->createForm($form);

@ -204,7 +204,10 @@ if (!$inATest) {
$styleLevel = "level";
$styleScore = "score";
$category_list = TestCategory::getListOfCategoriesNameForTest($objExercise->id, false);
$category_list = TestCategory::getListOfCategoriesNameForTest(
$objExercise->id,
false
);
if (is_array($questionList)) {
foreach ($questionList as $id) {
@ -214,7 +217,6 @@ if (!$inATest) {
}
/** @var Question $objQuestionTmp */
$objQuestionTmp = Question::read($id);
$question_class = get_class($objQuestionTmp);
$clone_link = '<a href="'.api_get_self().'?'.api_get_cidreq().'&clone_question='.$id.'">'.
Display::return_icon('cd.png',get_lang('Copy'), array(), ICON_SIZE_SMALL).'</a>';
@ -248,17 +250,14 @@ if (!$inATest) {
), array ('class'=>'btn-actions'));
$title = Security::remove_XSS($objQuestionTmp->selectTitle());
/* $move = Display::return_icon(
'all_directions.png',
get_lang('Move'),
array('class'=>'moved', 'style'=>'margin-bottom:-0.3em;')
); */
$move = Display::returnFontAwesomeIcon("arrows moved", 'lg');
// Question name
$questionName = Display::tag(
'td',
'<a href="#" title = "'.Security::remove_XSS($title).'">'.$move.' '.cut($title, 42).'</a>',
'<a href="#" title = "'.Security::remove_XSS($title).'">
'.$move.' '.cut($title, 42).'
</a>',
array('class' => $styleQuestion)
);

@ -30,8 +30,7 @@ class UniqueAnswer extends Question
}
/**
* function which redefines Question::createAnswersForm
* @param FormValidator $form
* @inheritdoc
*/
public function createAnswersForm($form)
{

Loading…
Cancel
Save