|
|
|
@ -1,8 +1,6 @@ |
|
|
|
|
<?php |
|
|
|
|
/* For licensing terms, see /license.txt */ |
|
|
|
|
/** |
|
|
|
|
* Code |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* |
|
|
|
|
* Class Matching |
|
|
|
@ -14,24 +12,27 @@ |
|
|
|
|
* @author Eric Marguin |
|
|
|
|
* @package chamilo.exercise |
|
|
|
|
*/ |
|
|
|
|
class Matching extends Question { |
|
|
|
|
class Matching extends Question |
|
|
|
|
{ |
|
|
|
|
static $typePicture = 'matching.gif'; |
|
|
|
|
static $explanationLangVar = 'Matching'; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Constructor |
|
|
|
|
*/ |
|
|
|
|
function Matching(){ |
|
|
|
|
public function Matching() |
|
|
|
|
{ |
|
|
|
|
parent::question(); |
|
|
|
|
$this->type = MATCHING; |
|
|
|
|
$this->isContent = $this-> getIsContent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* function which redifines Question::createAnswersForm |
|
|
|
|
* @param the formvalidator instance |
|
|
|
|
* function which redefines Question::createAnswersForm |
|
|
|
|
* @param FormValidator $form |
|
|
|
|
*/ |
|
|
|
|
function createAnswersForm ($form) { |
|
|
|
|
public function createAnswersForm ($form) |
|
|
|
|
{ |
|
|
|
|
$defaults = array(); |
|
|
|
|
$navigator_info = api_get_navigator(); |
|
|
|
|
|
|
|
|
@ -194,10 +195,10 @@ class Matching 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) { |
|
|
|
|
|
|
|
|
|
public function processAnswersCreation($form) |
|
|
|
|
{ |
|
|
|
|
$nb_matches = $form -> getSubmitValue('nb_matches'); |
|
|
|
|
$nb_options = $form -> getSubmitValue('nb_options'); |
|
|
|
|
$this -> weighting = 0; |
|
|
|
@ -225,7 +226,14 @@ class Matching extends Question { |
|
|
|
|
$this->save(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function return_header($feedback_type = null, $counter = null, $score = null) { |
|
|
|
|
/** |
|
|
|
|
* @param null $feedback_type |
|
|
|
|
* @param null $counter |
|
|
|
|
* @param null $score |
|
|
|
|
* @return string |
|
|
|
|
*/ |
|
|
|
|
public function return_header($feedback_type = null, $counter = null, $score = null) |
|
|
|
|
{ |
|
|
|
|
$header = parent::return_header($feedback_type, $counter, $score); |
|
|
|
|
$header .= '<table class="'.$this->question_table_class .'">'; |
|
|
|
|
$header .= '<tr> |
|
|
|
|