* @return - : modify object to update the switch display_category_name
* $in_txt is an integer 0 or 1
*/
function updateDisplayCategoryName($text)
public function updateDisplayCategoryName($text)
{
$this->display_category_name = $text;
}
@ -333,16 +335,16 @@ class Exercise
* @author - hubert borderiou 28-11-11
* @return - html text : the text to display ay the end of the test.
*/
function selectTextWhenFinished()
public function selectTextWhenFinished()
{
return $this->text_when_finished;
}
/**
* @author - hubert borderiou 28-11-11
* @return - html text : update the text to display ay the end of the test.
* @author Hubert borderiou 28-11-11
* @return string html text : update the text to display ay the end of the test.
*/
function updateTextWhenFinished($text)
public function updateTextWhenFinished($text)
{
$this->text_when_finished = $text;
}
@ -350,9 +352,9 @@ class Exercise
/**
* return 1 or 2 if randomByCat
* @author - hubert borderiou
* @return - integer - quiz random by category
* @return integer - quiz random by category
*/
function selectRandomByCat()
public function selectRandomByCat()
{
return $this->randomByCat;
}
@ -361,11 +363,12 @@ class Exercise
* return 0 if no random by cat
* return 1 if random by cat, categories shuffled
* return 2 if random by cat, categories sorted by alphabetic order
* @author - hubert borderiou
* @author Hubert borderiou
*
* @return - integer - quiz random by category
* @return integer - quiz random by category
*/
function isRandomByCat() {
public function isRandomByCat()
{
$res = EXERCISE_CATEGORY_RANDOM_DISABLED;
if ($this->randomByCat == EXERCISE_CATEGORY_RANDOM_SHUFFLED) {
$res = EXERCISE_CATEGORY_RANDOM_SHUFFLED;
@ -378,10 +381,10 @@ class Exercise
/**
* Sets the random by category value
* @author - Julio Montoya
* @author Julio Montoya
* @param int random by category
*/
function updateRandomByCat($random)
public function updateRandomByCat($random)
{
if (in_array($random, array(EXERCISE_CATEGORY_RANDOM_SHUFFLED, EXERCISE_CATEGORY_RANDOM_ORDERED, EXERCISE_CATEGORY_RANDOM_DISABLED))) {
$this->randomByCat = $random;
@ -397,7 +400,7 @@ class Exercise
*
* @return int results disabled exercise
*/
function selectResultsDisabled()
public function selectResultsDisabled()
{
return $this->results_disabled;
}
@ -409,7 +412,7 @@ class Exercise
*
* @return bool - 0 if not random, otherwise the draws
*/
function isRandom()
public function isRandom()
{
if ($this->random > 0 || $this->random == -1) {
return true;
@ -423,7 +426,7 @@ class Exercise
*
* @author - Juan Carlos Ra�a
*/
function selectRandomAnswers()
public function selectRandomAnswers()
{
return $this->random_answers;
}
@ -431,7 +434,7 @@ class Exercise
/**
* Same as isRandom() but has a name applied to values different than 0 or 1
*/
function getShuffle()
public function getShuffle()
{
return $this->random;
}
@ -442,7 +445,7 @@ class Exercise
* @author - Olivier Brouckaert
* @return - boolean - true if enabled, otherwise false
*/
function selectStatus()
public function selectStatus()
{
return $this->active;
}
@ -451,7 +454,7 @@ class Exercise
* If false the question list will be managed as always if true the question will be filtered depending of the exercise settings (table c_quiz_rel_category)
* @param bool active or inactive grouping
**/
function setCategoriesGrouping($status) {
public function setCategoriesGrouping($status) {
$this->categories_grouping = (bool) $status;
}
@ -653,12 +656,13 @@ class Exercise
/**
* Selects questions randomly in the question list
*
* @author - Olivier Brouckaert
* @author Olivier Brouckaert, Modified by Hubert Borderiou 15 nov 2011
* @param array
* @return array - if the exercise is not set to take questions randomly, returns the question list
* without randomizing, otherwise, returns the list with questions selected randomly
* Modified by Hubert Borderiou 15 nov 2011
*
*/
function selectRandomList($question_list)
public function selectRandomList($question_list)
{
$nbQuestions = $this->selectNbrQuestions();
@ -4740,7 +4744,8 @@ class Exercise
}
/**
* Get list of questions depending of the category random settings, exercise random settings, exercise categories settings
* Get list of questions depending of the category random settings, exercise random settings, and