Minor - Code conventions - refs #7613

1.10.x
Angel Fernando Quiroz Campos 11 years ago
parent beffaccfe3
commit 01e9946d8b
  1. 641
      main/exercice/exercise.class.php
  2. 438
      main/exercice/question.class.php
  3. 6
      main/inc/lib/exercise.lib.php

File diff suppressed because it is too large Load Diff

@ -32,18 +32,21 @@ abstract class Question
public static $explanationLangVar = ''; public static $explanationLangVar = '';
public $question_table_class = 'table table-striped'; public $question_table_class = 'table table-striped';
public static $questionTypes = array( public static $questionTypes = array(
UNIQUE_ANSWER => array('unique_answer.class.php' , 'UniqueAnswer'), UNIQUE_ANSWER => array('unique_answer.class.php', 'UniqueAnswer'),
MULTIPLE_ANSWER => array('multiple_answer.class.php' , 'MultipleAnswer'), MULTIPLE_ANSWER => array('multiple_answer.class.php', 'MultipleAnswer'),
FILL_IN_BLANKS => array('fill_blanks.class.php' , 'FillBlanks'), FILL_IN_BLANKS => array('fill_blanks.class.php', 'FillBlanks'),
MATCHING => array('matching.class.php' , 'Matching'), MATCHING => array('matching.class.php', 'Matching'),
FREE_ANSWER => array('freeanswer.class.php' , 'FreeAnswer'), FREE_ANSWER => array('freeanswer.class.php', 'FreeAnswer'),
ORAL_EXPRESSION => array('oral_expression.class.php' , 'OralExpression'), ORAL_EXPRESSION => array('oral_expression.class.php', 'OralExpression'),
HOT_SPOT => array('hotspot.class.php' , 'HotSpot'), HOT_SPOT => array('hotspot.class.php', 'HotSpot'),
HOT_SPOT_DELINEATION => array('hotspot.class.php' , 'HotspotDelineation'), HOT_SPOT_DELINEATION => array('hotspot.class.php', 'HotspotDelineation'),
MULTIPLE_ANSWER_COMBINATION => array('multiple_answer_combination.class.php', 'MultipleAnswerCombination'), MULTIPLE_ANSWER_COMBINATION => array('multiple_answer_combination.class.php', 'MultipleAnswerCombination'),
UNIQUE_ANSWER_NO_OPTION => array('unique_answer_no_option.class.php', 'UniqueAnswerNoOption'), UNIQUE_ANSWER_NO_OPTION => array('unique_answer_no_option.class.php', 'UniqueAnswerNoOption'),
MULTIPLE_ANSWER_TRUE_FALSE => array('multiple_answer_true_false.class.php', 'MultipleAnswerTrueFalse'), MULTIPLE_ANSWER_TRUE_FALSE => array('multiple_answer_true_false.class.php', 'MultipleAnswerTrueFalse'),
MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE => array('multiple_answer_combination_true_false.class.php', 'MultipleAnswerCombinationTrueFalse'), MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE => array(
'multiple_answer_combination_true_false.class.php',
'MultipleAnswerCombinationTrueFalse'
),
GLOBAL_MULTIPLE_ANSWER => array('global_multiple_answer.class.php' , 'GlobalMultipleAnswer'), GLOBAL_MULTIPLE_ANSWER => array('global_multiple_answer.class.php' , 'GlobalMultipleAnswer'),
CALCULATED_ANSWER => array('calculated_answer.class.php' , 'CalculatedAnswer'), CALCULATED_ANSWER => array('calculated_answer.class.php' , 'CalculatedAnswer'),
UNIQUE_ANSWER_IMAGE => ['UniqueAnswerImage.php', 'UniqueAnswerImage'] UNIQUE_ANSWER_IMAGE => ['UniqueAnswerImage.php', 'UniqueAnswerImage']
@ -115,7 +118,7 @@ abstract class Question
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION); $TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION); $TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$sql = "SELECT question,description,ponderation,position,type,picture,level,extra $sql = "SELECT question, description, ponderation, position, type, picture, level, extra
FROM $TBL_QUESTIONS FROM $TBL_QUESTIONS
WHERE c_id = $course_id AND id = $id "; WHERE c_id = $course_id AND id = $id ";
@ -253,7 +256,7 @@ abstract class Question
public function selectPicturePath() public function selectPicturePath()
{ {
if (!empty($this->picture)) { if (!empty($this->picture)) {
return api_get_path(WEB_COURSE_PATH).$this->course['path'].'/document/images/'.$this->picture; return api_get_path(WEB_COURSE_PATH) . $this->course['path'] . '/document/images/' . $this->picture;
} }
return false; return false;
} }
@ -306,7 +309,7 @@ abstract class Question
*/ */
public function updateDescription($description) public function updateDescription($description)
{ {
$this->description=$description; $this->description = $description;
} }
/** /**
@ -317,7 +320,7 @@ abstract class Question
*/ */
public function updateWeighting($weighting) public function updateWeighting($weighting)
{ {
$this->weighting=$weighting; $this->weighting = $weighting;
} }
/** /**
@ -326,7 +329,7 @@ abstract class Question
*/ */
public function updateCategory($in_category) public function updateCategory($in_category)
{ {
$this->category=$in_category; $this->category = $in_category;
} }
/** /**
@ -335,7 +338,7 @@ abstract class Question
*/ */
public function updateScoreAlwaysPositive($in_positive) public function updateScoreAlwaysPositive($in_positive)
{ {
$this->scoreAlwaysPositive=$in_positive; $this->scoreAlwaysPositive = $in_positive;
} }
/** /**
@ -344,7 +347,7 @@ abstract class Question
*/ */
public function updateUncheckedMayScore($in_positive) public function updateUncheckedMayScore($in_positive)
{ {
$this->uncheckedMayScore=$in_positive; $this->uncheckedMayScore = $in_positive;
} }
/** /**
@ -366,17 +369,22 @@ abstract class Question
foreach ($category_list as $category_id) { foreach ($category_list as $category_id) {
$category_id = intval($category_id); $category_id = intval($category_id);
$question_id = intval($this->id); $question_id = intval($this->id);
$sql = "SELECT count(*) AS nb FROM $TBL_QUESTION_REL_CATEGORY $sql = "SELECT count(*) AS nb
WHERE category_id = $category_id AND question_id = $question_id AND c_id=".api_get_course_int_id(); FROM $TBL_QUESTION_REL_CATEGORY
WHERE
category_id = $category_id
AND question_id = $question_id
AND c_id=".api_get_course_int_id();
$res = Database::query($sql); $res = Database::query($sql);
$row = Database::fetch_array($res); $row = Database::fetch_array($res);
if ($row['nb'] > 0) { if ($row['nb'] > 0) {
//DO nothing //DO nothing
//$sql = "UPDATE $TBL_QUESTION_REL_CATEGORY SET category_id = $category_id WHERE question_id=$question_id AND c_id=".api_get_course_int_id(); //$sql = "UPDATE $TBL_QUESTION_REL_CATEGORY SET category_id = $category_id
//WHERE question_id=$question_id AND c_id=".api_get_course_int_id();
//$res = Database::query($sql); //$res = Database::query($sql);
} else { } else {
$sql = "INSERT INTO $TBL_QUESTION_REL_CATEGORY (c_id, question_id, category_id) $sql = "INSERT INTO $TBL_QUESTION_REL_CATEGORY (c_id, question_id, category_id)
VALUES (".api_get_course_int_id().", $question_id, $category_id)"; VALUES (" . api_get_course_int_id() . ", $question_id, $category_id)";
Database::query($sql); Database::query($sql);
} }
} }
@ -400,14 +408,16 @@ abstract class Question
$category_id = intval($in_category); $category_id = intval($in_category);
$question_id = intval($this->id); $question_id = intval($this->id);
$sql = "SELECT count(*) AS nb FROM $TBL_QUESTION_REL_CATEGORY $sql = "SELECT count(*) AS nb FROM $TBL_QUESTION_REL_CATEGORY
WHERE question_id=$question_id AND c_id=".api_get_course_int_id(); WHERE question_id = $question_id AND c_id=" . api_get_course_int_id();
$res = Database::query($sql); $res = Database::query($sql);
$row = Database::fetch_array($res); $row = Database::fetch_array($res);
if ($row['nb'] > 0){ if ($row['nb'] > 0){
$sql = "UPDATE $TBL_QUESTION_REL_CATEGORY SET category_id=$category_id WHERE question_id=$question_id AND c_id=".api_get_course_int_id(); $sql = "UPDATE $TBL_QUESTION_REL_CATEGORY SET category_id = $category_id
WHERE question_id = $question_id AND c_id = " . api_get_course_int_id();
Database::query($sql); Database::query($sql);
} else { } else {
$sql = "INSERT INTO $TBL_QUESTION_REL_CATEGORY VALUES (".api_get_course_int_id().", $question_id, $category_id)"; $sql = "INSERT INTO $TBL_QUESTION_REL_CATEGORY
VALUES (" . api_get_course_int_id() . ", $question_id, $category_id)";
Database::query($sql); Database::query($sql);
} }
} }
@ -424,7 +434,7 @@ abstract class Question
$TBL_QUESTION_REL_CATEGORY = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY); $TBL_QUESTION_REL_CATEGORY = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);
$question_id = intval($this->id); $question_id = intval($this->id);
$sql = "DELETE FROM $TBL_QUESTION_REL_CATEGORY $sql = "DELETE FROM $TBL_QUESTION_REL_CATEGORY
WHERE question_id=$question_id AND c_id=".api_get_course_int_id(); WHERE question_id = $question_id AND c_id = " . api_get_course_int_id();
Database::query($sql); Database::query($sql);
} }
@ -436,7 +446,7 @@ abstract class Question
*/ */
public function updatePosition($position) public function updatePosition($position)
{ {
$this->position=$position; $this->position = $position;
} }
/** /**
@ -447,7 +457,7 @@ abstract class Question
*/ */
public function updateLevel($level) public function updateLevel($level)
{ {
$this->level=$level; $this->level = $level;
} }
/** /**
@ -468,10 +478,13 @@ abstract class Question
// if we really change the type // if we really change the type
if ($type != $this->type) { if ($type != $this->type) {
// if we don't change from "unique answer" to "multiple answers" (or conversely) // if we don't change from "unique answer" to "multiple answers" (or conversely)
if (!in_array($this->type, array(UNIQUE_ANSWER,MULTIPLE_ANSWER)) || !in_array($type,array(UNIQUE_ANSWER,MULTIPLE_ANSWER))) { if (
!in_array($this->type, array(UNIQUE_ANSWER, MULTIPLE_ANSWER)) ||
!in_array($type, array(UNIQUE_ANSWER, MULTIPLE_ANSWER))
) {
// removes old answers // removes old answers
$sql = "DELETE FROM $TBL_REPONSES $sql = "DELETE FROM $TBL_REPONSES
WHERE c_id = $course_id AND question_id = ".intval($this->id).""; WHERE c_id = $course_id AND question_id = " . intval($this->id);
Database::query($sql); Database::query($sql);
} }
@ -497,9 +510,9 @@ abstract class Question
if (mkdir($picturePath, api_get_permissions_for_new_directories())) { if (mkdir($picturePath, api_get_permissions_for_new_directories())) {
// document path // document path
$documentPath = api_get_path(SYS_COURSE_PATH) . $this->course['path'] . "/document"; $documentPath = api_get_path(SYS_COURSE_PATH) . $this->course['path'] . "/document";
$path = str_replace($documentPath,'',$picturePath); $path = str_replace($documentPath, '', $picturePath);
$title_path = basename($picturePath); $title_path = basename($picturePath);
$doc_id = add_document($this->course, $path, 'folder', 0,$title_path); $doc_id = add_document($this->course, $path, 'folder', 0, $title_path);
api_item_property_update($this->course, TOOL_DOCUMENT, $doc_id, 'FolderCreated', api_get_user_id()); api_item_property_update($this->course, TOOL_DOCUMENT, $doc_id, 'FolderCreated', api_get_user_id());
} }
} }
@ -507,18 +520,24 @@ abstract class Question
// if the question has got an ID // if the question has got an ID
if ($this->id) { if ($this->id) {
$extension = pathinfo($PictureName, PATHINFO_EXTENSION); $extension = pathinfo($PictureName, PATHINFO_EXTENSION);
$this->picture = 'quiz-'.$this->id.'.jpg'; $this->picture = 'quiz-' . $this->id . '.jpg';
$o_img = new Image($Picture); $o_img = new Image($Picture);
$o_img->send_image($picturePath.'/'.$this->picture, -1, 'jpg'); $o_img->send_image($picturePath . '/' . $this->picture, -1, 'jpg');
$document_id = add_document( $document_id = add_document(
$this->course, $this->course,
'/images/' . $this->picture, 'file', '/images/' . $this->picture,
'file',
filesize($picturePath . '/' . $this->picture), filesize($picturePath . '/' . $this->picture),
$this->picture $this->picture
); );
if ($document_id) { if ($document_id) {
return api_item_property_update($this->course, TOOL_DOCUMENT, return api_item_property_update(
$document_id, 'DocumentAdded', api_get_user_id()); $this->course,
TOOL_DOCUMENT,
$document_id,
'DocumentAdded',
api_get_user_id()
);
} }
} }
@ -526,8 +545,8 @@ abstract class Question
} }
/** /**
* Resizes a picture || Warning!: can only be called after uploadPicture, or if picture is already available in object. * Resizes a picture || Warning!: can only be called after uploadPicture,
* * or if picture is already available in object.
* @author Toon Keppens * @author Toon Keppens
* @param string $Dimension - Resizing happens proportional according to given dimension: height|width|any * @param string $Dimension - Resizing happens proportional according to given dimension: height|width|any
* @param integer $Max - Maximum size * @param integer $Max - Maximum size
@ -540,15 +559,15 @@ abstract class Question
// if the question has an ID // if the question has an ID
if ($this->id) { if ($this->id) {
// Get dimensions from current image. // Get dimensions from current image.
$my_image = new Image($picturePath.'/'.$this->picture); $my_image = new Image($picturePath . '/' . $this->picture);
$current_image_size = $my_image->get_image_size(); $current_image_size = $my_image->get_image_size();
$current_width = $current_image_size['width']; $current_width = $current_image_size['width'];
$current_height = $current_image_size['height']; $current_height = $current_image_size['height'];
if($current_width < $Max && $current_height <$Max) if ($current_width < $Max && $current_height < $Max)
return true; return true;
elseif($current_height == "") elseif ($current_height == "")
return false; return false;
// Resize according to height. // Resize according to height.
@ -582,7 +601,7 @@ abstract class Question
} }
$my_image->resize($new_width, $new_height); $my_image->resize($new_width, $new_height);
$result = $my_image->send_image($picturePath.'/'.$this->picture); $result = $my_image->send_image($picturePath . '/' . $this->picture);
if ($result) { if ($result) {
return true; return true;
@ -603,11 +622,11 @@ abstract class Question
global $picturePath; global $picturePath;
// if the question has got an ID and if the picture exists // if the question has got an ID and if the picture exists
if($this->id) { if ($this->id) {
$picture=$this->picture; $picture = $this->picture;
$this->picture=''; $this->picture = '';
return @unlink($picturePath.'/'.$picture)?true:false; return @unlink($picturePath . '/' . $picture) ? true : false;
} }
return false; return false;
@ -624,24 +643,36 @@ abstract class Question
{ {
$course_id = $course_info['real_id']; $course_id = $course_info['real_id'];
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION); $TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$destination_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document/images'; $destination_path = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document/images';
$source_path = api_get_path(SYS_COURSE_PATH).$this->course['path'].'/document/images'; $source_path = api_get_path(SYS_COURSE_PATH) . $this->course['path'] . '/document/images';
// if the question has got an ID and if the picture exists // if the question has got an ID and if the picture exists
if ($this->id && !empty($this->picture)) { if ($this->id && !empty($this->picture)) {
$picture=explode('.',$this->picture); $picture = explode('.', $this->picture);
$extension = $picture[sizeof($picture)-1]; $extension = $picture[sizeof($picture) - 1];
$picture = 'quiz-'.$questionId.'.'.$extension; $picture = 'quiz-' . $questionId . '.' . $extension;
$result = @copy($source_path.'/'.$this->picture, $destination_path.'/'.$picture) ? true : false; $result = @copy($source_path . '/' . $this->picture, $destination_path . '/' . $picture) ? true : false;
//If copy was correct then add to the database //If copy was correct then add to the database
if ($result) { if ($result) {
$sql = "UPDATE $TBL_QUESTIONS SET picture='".Database::escape_string($picture)."' $sql = "UPDATE $TBL_QUESTIONS SET picture='" . Database::escape_string($picture) . "'
WHERE c_id = $course_id AND id='".intval($questionId)."'"; WHERE c_id = $course_id AND id='" . intval($questionId) . "'";
Database::query($sql); Database::query($sql);
$document_id = add_document($course_info, '/images/'.$picture, 'file', filesize($destination_path.'/'.$picture), $picture); $document_id = add_document(
$course_info,
'/images/' . $picture,
'file',
filesize($destination_path . '/' . $picture),
$picture
);
if ($document_id) { if ($document_id) {
return api_item_property_update($course_info, TOOL_DOCUMENT, $document_id, 'DocumentAdded', api_get_user_id()); return api_item_property_update(
$course_info,
TOOL_DOCUMENT,
$document_id,
'DocumentAdded',
api_get_user_id()
);
} }
} }
@ -659,14 +690,14 @@ abstract class Question
* @param string $Picture - temporary path of the picture to move * @param string $Picture - temporary path of the picture to move
* @param string $PictureName - Name of the picture * @param string $PictureName - Name of the picture
*/ */
public function setTmpPicture($Picture,$PictureName) public function setTmpPicture($Picture, $PictureName)
{ {
global $picturePath; global $picturePath;
$PictureName = explode('.',$PictureName); $PictureName = explode('.', $PictureName);
$Extension = $PictureName[sizeof($PictureName)-1]; $Extension = $PictureName[sizeof($PictureName) - 1];
// saves the picture into a temporary file // saves the picture into a temporary file
@move_uploaded_file($Picture,$picturePath.'/tmp.'.$Extension); @move_uploaded_file($Picture, $picturePath . '/tmp.' . $Extension);
} }
/** /**
@ -698,15 +729,15 @@ abstract class Question
// if the question has got an ID and if the picture exists // if the question has got an ID and if the picture exists
if ($this->id) { if ($this->id) {
if (file_exists($picturePath.'/tmp.jpg')) { if (file_exists($picturePath . '/tmp.jpg')) {
$Extension='jpg'; $Extension = 'jpg';
} elseif(file_exists($picturePath.'/tmp.gif')) { } elseif (file_exists($picturePath . '/tmp.gif')) {
$Extension='gif'; $Extension = 'gif';
} elseif(file_exists($picturePath.'/tmp.png')) { } elseif (file_exists($picturePath . '/tmp.png')) {
$Extension='png'; $Extension = 'png';
} }
$this->picture='quiz-'.$this->id.'.'.$Extension; $this->picture = 'quiz-' . $this->id . '.' . $Extension;
return @rename($picturePath.'/tmp.'.$Extension,$picturePath.'/'.$this->picture)?true:false; return @rename($picturePath . '/tmp.' . $Extension, $picturePath . '/' . $this->picture) ? true : false;
} }
return false; return false;
} }
@ -737,16 +768,17 @@ abstract class Question
// question already exists // question already exists
if(!empty($id)) { if(!empty($id)) {
$sql="UPDATE $TBL_QUESTIONS SET $sql = "UPDATE $TBL_QUESTIONS
question ='".Database::escape_string($question)."', SET
description ='".Database::escape_string($description)."', question = '" . Database::escape_string($question) . "',
ponderation ='".Database::escape_string($weighting)."', description = '" . Database::escape_string($description) . "',
position ='".Database::escape_string($position)."', ponderation = '" . Database::escape_string($weighting) . "',
type ='".Database::escape_string($type)."', position = '" . Database::escape_string($position) . "',
picture ='".Database::escape_string($picture)."', type = '" . Database::escape_string($type) . "',
extra ='".Database::escape_string($extra)."', picture = '" . Database::escape_string($picture) . "',
level ='".Database::escape_string($level)."' extra = '" . Database::escape_string($extra) . "',
WHERE c_id = $c_id AND id = ".intval($id).""; level = '" . Database::escape_string($level) . "'
WHERE c_id = $c_id AND id = " . intval($id);
Database::query($sql); Database::query($sql);
$this->saveCategory($category); $this->saveCategory($category);
@ -759,7 +791,7 @@ abstract class Question
api_get_user_id() api_get_user_id()
); );
} }
if (api_get_setting('search_enabled')=='true') { if (api_get_setting('search_enabled') == 'true') {
if ($exerciseId != 0) { if ($exerciseId != 0) {
$this -> search_engine_edit($exerciseId); $this -> search_engine_edit($exerciseId);
} else { } else {
@ -776,23 +808,26 @@ abstract class Question
$TBL_EXERCICE_QUESTION as test_question $TBL_EXERCICE_QUESTION as test_question
WHERE WHERE
question.id = test_question.question_id AND question.id = test_question.question_id AND
test_question.exercice_id = ".intval($exerciseId)." AND test_question.exercice_id = " . intval($exerciseId) . " AND
question.c_id = $c_id AND question.c_id = $c_id AND
test_question.c_id = $c_id "; test_question.c_id = $c_id ";
$result = Database::query($sql); $result = Database::query($sql);
$current_position = Database::result($result,0,0); $current_position = Database::result($result,0,0);
$this->updatePosition($current_position+1); $this->updatePosition($current_position+1);
$position = $this->position; $position = $this->position;
$sql = "INSERT INTO $TBL_QUESTIONS (c_id, question, description, ponderation, position, type, picture, extra, level) VALUES ( $sql = "INSERT INTO $TBL_QUESTIONS (
c_id, question, description, ponderation, position, type, picture, extra, level
)
VALUES (
$c_id, $c_id,
'".Database::escape_string($question)."', '" . Database::escape_string($question) . "',
'".Database::escape_string($description)."', '" . Database::escape_string($description) . "',
'".Database::escape_string($weighting)."', '" . Database::escape_string($weighting) . "',
'".Database::escape_string($position)."', '" . Database::escape_string($position) . "',
'".Database::escape_string($type)."', '" . Database::escape_string($type) . "',
'".Database::escape_string($picture)."', '" . Database::escape_string($picture) . "',
'".Database::escape_string($extra)."', '" . Database::escape_string($extra) . "',
'".Database::escape_string($level)."' '" . Database::escape_string($level) . "'
)"; )";
Database::query($sql); Database::query($sql);
@ -815,8 +850,21 @@ abstract class Question
$TBL_ANSWERS = Database::get_course_table( $TBL_ANSWERS = Database::get_course_table(
TABLE_QUIZ_ANSWER TABLE_QUIZ_ANSWER
); );
$sql = "INSERT INTO $TBL_ANSWERS (c_id, question_id , answer, correct, comment, ponderation, position, hotspot_coordinates, hotspot_type) $sql = "INSERT INTO $TBL_ANSWERS (
VALUES (".$c_id.", ".intval($this->id).", '', NULL , '', '10' , '1', '0;0|0|0', 'square')"; c_id, question_id , answer, correct, comment, ponderation, position, hotspot_coordinates,
hotspot_type
)
VALUES (
$c_id,
" . intval($this->id) . ",
'',
NULL,
'',
'10',
'1',
'0;0|0|0',
'square'
)";
Database::query($sql); Database::query($sql);
$id = Database::insert_id(); $id = Database::insert_id();
if ($id) { if ($id) {
@ -829,8 +877,13 @@ abstract class Question
$TBL_ANSWERS = Database::get_course_table( $TBL_ANSWERS = Database::get_course_table(
TABLE_QUIZ_ANSWER TABLE_QUIZ_ANSWER
); );
$sql = "INSERT INTO $TBL_ANSWERS (c_id, question_id , answer , correct , comment , ponderation , position , hotspot_coordinates , hotspot_type ) $sql = "INSERT INTO $TBL_ANSWERS (
VALUES (".$c_id.", ".intval($this->id).", '', NULL , '', '10' , '1', '0;0|0|0', 'delineation')"; c_id, question_id, answer, correct, comment, ponderation, position, hotspot_coordinates,
hotspot_type
)
VALUES (
$c_id, " . intval($this->id) . ", '', NULL , '', '10' , '1', '0;0|0|0', 'delineation'
)";
Database::query($sql); Database::query($sql);
$id = Database::insert_id(); $id = Database::insert_id();
@ -876,10 +929,13 @@ abstract class Question
$tbl_se_ref = Database::get_main_table(TABLE_MAIN_SEARCH_ENGINE_REF); $tbl_se_ref = Database::get_main_table(TABLE_MAIN_SEARCH_ENGINE_REF);
if ($addQs || $rmQs) { if ($addQs || $rmQs) {
//there's only one row per question on normal db and one document per question on search engine db //there's only one row per question on normal db and one document per question on search engine db
$sql = 'SELECT * FROM %s WHERE course_code=\'%s\' AND tool_id=\'%s\' AND ref_id_second_level=%s LIMIT 1'; $sql = 'SELECT * FROM %
WHERE course_code=\'%s\' AND tool_id=\'%s\' AND ref_id_second_level=%s LIMIT 1';
$sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, $this->id); $sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, $this->id);
} else { } else {
$sql = 'SELECT * FROM %s WHERE course_code=\'%s\' AND tool_id=\'%s\' AND ref_id_high_level=%s AND ref_id_second_level=%s LIMIT 1'; $sql = 'SELECT * FROM %s
WHERE course_code=\'%s\' AND tool_id=\'%s\'
AND ref_id_high_level=%s AND ref_id_second_level=%s LIMIT 1';
$sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, $exerciseId, $this->id); $sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, $exerciseId, $this->id);
} }
$res = Database::query($sql); $res = Database::query($sql);
@ -890,21 +946,27 @@ abstract class Question
$di = new ChamiloIndexer(); $di = new ChamiloIndexer();
if ($addQs) { if ($addQs) {
$question_exercises = array((int)$exerciseId); $question_exercises = array((int) $exerciseId);
} else { } else {
$question_exercises = array(); $question_exercises = array();
} }
isset($_POST['language'])? $lang=Database::escape_string($_POST['language']): $lang = 'english'; isset($_POST['language']) ? $lang = Database::escape_string($_POST['language']) : $lang = 'english';
$di->connectDb(NULL, NULL, $lang); $di->connectDb(NULL, NULL, $lang);
// retrieve others exercise ids // retrieve others exercise ids
$se_ref = Database::fetch_array($res); $se_ref = Database::fetch_array($res);
$se_doc = $di->get_document((int)$se_ref['search_did']); $se_doc = $di->get_document((int)$se_ref['search_did']);
if ($se_doc !== FALSE) { if ($se_doc !== FALSE) {
if ( ($se_doc_data=$di->get_document_data($se_doc)) !== FALSE ) { if (($se_doc_data = $di->get_document_data($se_doc)) !== FALSE) {
$se_doc_data = unserialize($se_doc_data); $se_doc_data = unserialize($se_doc_data);
if (isset($se_doc_data[SE_DATA]['type']) && $se_doc_data[SE_DATA]['type'] == SE_DOCTYPE_EXERCISE_QUESTION) { if (
if (isset($se_doc_data[SE_DATA]['exercise_ids']) && is_array($se_doc_data[SE_DATA]['exercise_ids'])) { isset($se_doc_data[SE_DATA]['type']) &&
$se_doc_data[SE_DATA]['type'] == SE_DOCTYPE_EXERCISE_QUESTION
) {
if (
isset($se_doc_data[SE_DATA]['exercise_ids']) &&
is_array($se_doc_data[SE_DATA]['exercise_ids'])
) {
foreach ($se_doc_data[SE_DATA]['exercise_ids'] as $old_value) { foreach ($se_doc_data[SE_DATA]['exercise_ids'] as $old_value) {
if (!in_array($old_value, $question_exercises)) { if (!in_array($old_value, $question_exercises)) {
$question_exercises[] = $old_value; $question_exercises[] = $old_value;
@ -915,7 +977,7 @@ abstract class Question
} }
} }
if ($rmQs) { if ($rmQs) {
while ( ($key=array_search($exerciseId, $question_exercises)) !== FALSE) { while (($key = array_search($exerciseId, $question_exercises)) !== FALSE) {
unset($question_exercises[$key]); unset($question_exercises[$key]);
} }
} }
@ -928,7 +990,11 @@ abstract class Question
$xapian_data = array( $xapian_data = array(
SE_COURSE_ID => $course_id, SE_COURSE_ID => $course_id,
SE_TOOL_ID => TOOL_QUIZ, SE_TOOL_ID => TOOL_QUIZ,
SE_DATA => array('type' => SE_DOCTYPE_EXERCISE_QUESTION, 'exercise_ids' => $question_exercises, 'question_id' => (int)$this->id), SE_DATA => array(
'type' => SE_DOCTYPE_EXERCISE_QUESTION,
'exercise_ids' => $question_exercises,
'question_id' => (int)$this->id
),
SE_USER => (int)api_get_user_id(), SE_USER => (int)api_get_user_id(),
); );
$ic_slide->xapian_data = serialize($xapian_data); $ic_slide->xapian_data = serialize($xapian_data);
@ -947,23 +1013,46 @@ abstract class Question
if ($did || $rmQs) { if ($did || $rmQs) {
// save it to db // save it to db
if ($addQs || $rmQs) { if ($addQs || $rmQs) {
$sql = 'DELETE FROM %s WHERE course_code=\'%s\' AND tool_id=\'%s\' AND ref_id_second_level=\'%s\''; $sql = "DELETE FROM %s
WHERE course_code = '%s' AND tool_id = '%s' AND ref_id_second_level = '%s'";
$sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, $this->id); $sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, $this->id);
} else { } else {
$sql = 'DELETE FROM %s WHERE course_code=\'%s\' AND tool_id=\'%s\' AND ref_id_high_level=\'%s\' AND ref_id_second_level=\'%s\''; $sql = "DELETE FROM %S
WHERE
course_code = '%s'
AND tool_id = '%s'
AND tool_id = '%s'
AND ref_id_high_level = '%s'
AND ref_id_second_level = '%s'";
$sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, $exerciseId, $this->id); $sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, $exerciseId, $this->id);
} }
Database::query($sql); Database::query($sql);
if ($rmQs) { if ($rmQs) {
if (!empty($question_exercises)) { if (!empty($question_exercises)) {
$sql = 'INSERT INTO %s (id, course_code, tool_id, ref_id_high_level, ref_id_second_level, search_did) $sql = "INSERT INTO %s (
VALUES (NULL , \'%s\', \'%s\', %s, %s, %s)'; id, course_code, tool_id, ref_id_high_level, ref_id_second_level, search_did
$sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, array_shift($question_exercises), $this->id, $did); )
VALUES (
NULL, '%s', '%s', %s, %s, %s
)";
$sql = sprintf(
$sql,
$tbl_se_ref,
$course_id,
TOOL_QUIZ,
array_shift($question_exercises),
$this->id,
$did
);
Database::query($sql); Database::query($sql);
} }
} else { } else {
$sql = 'INSERT INTO %s (id, course_code, tool_id, ref_id_high_level, ref_id_second_level, search_did) $sql = "INSERT INTO %s (
VALUES (NULL , \'%s\', \'%s\', %s, %s, %s)'; id, course_code, tool_id, ref_id_high_level, ref_id_second_level, search_did
)
VALUES (
NULL , '%s', '%s', %s, %s, %s
)";
$sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, $exerciseId, $this->id, $did); $sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, $exerciseId, $this->id, $did);
Database::query($sql); Database::query($sql);
} }
@ -985,14 +1074,14 @@ abstract class Question
$exerciseRelQuestionTable = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION); $exerciseRelQuestionTable = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$id = $this->id; $id = $this->id;
// checks if the exercise ID is not in the list // checks if the exercise ID is not in the list
if (!in_array($exerciseId,$this->exerciseList)) { if (!in_array($exerciseId, $this->exerciseList)) {
$this->exerciseList[]= $exerciseId; $this->exerciseList[] = $exerciseId;
$new_exercise = new Exercise(); $new_exercise = new Exercise();
$new_exercise->read($exerciseId); $new_exercise->read($exerciseId);
$count = $new_exercise->selectNbrQuestions(); $count = $new_exercise->selectNbrQuestions();
$count++; $count++;
$sql="INSERT INTO $exerciseRelQuestionTable (c_id, question_id, exercice_id, question_order) VALUES $sql="INSERT INTO $exerciseRelQuestionTable (c_id, question_id, exercice_id, question_order)
({$this->course['real_id']}, ".intval($id).", ".intval($exerciseId).", '$count' )"; VALUES ({$this->course['real_id']}, " . intval($id) . ", " . intval($exerciseId) . ", '$count')";
Database::query($sql); Database::query($sql);
// we do not want to reindex if we had just saved adnd indexed the question // we do not want to reindex if we had just saved adnd indexed the question
@ -1016,7 +1105,7 @@ abstract class Question
$id = $this->id; $id = $this->id;
// searches the position of the exercise ID in the list // searches the position of the exercise ID in the list
$pos=array_search($exerciseId,$this->exerciseList); $pos = array_search($exerciseId, $this->exerciseList);
$course_id = api_get_course_int_id(); $course_id = api_get_course_int_id();
@ -1027,20 +1116,31 @@ abstract class Question
// deletes the position in the array containing the wanted exercise ID // deletes the position in the array containing the wanted exercise ID
unset($this->exerciseList[$pos]); unset($this->exerciseList[$pos]);
//update order of other elements //update order of other elements
$sql = "SELECT question_order FROM $TBL_EXERCICE_QUESTION $sql = "SELECT question_order
WHERE c_id = $course_id AND question_id = ".intval($id)." AND exercice_id = ".intval($exerciseId).""; FROM $TBL_EXERCICE_QUESTION
WHERE
c_id = $course_id
AND question_id = " . intval($id) . "
AND exercice_id = " . intval($exerciseId);
$res = Database::query($sql); $res = Database::query($sql);
if (Database::num_rows($res)>0) { if (Database::num_rows($res)>0) {
$row = Database::fetch_array($res); $row = Database::fetch_array($res);
if (!empty($row['question_order'])) { if (!empty($row['question_order'])) {
$sql = "UPDATE $TBL_EXERCICE_QUESTION SET question_order = question_order-1 $sql = "UPDATE $TBL_EXERCICE_QUESTION
WHERE c_id = $course_id AND exercice_id = ".intval($exerciseId)." AND question_order > ".$row['question_order']; SET question_order = question_order-1
WHERE
c_id = $course_id
AND exercice_id = " . intval($exerciseId) . "
AND question_order > " . $row['question_order'];
$res = Database::query($sql); $res = Database::query($sql);
} }
} }
$sql = "DELETE FROM $TBL_EXERCICE_QUESTION $sql = "DELETE FROM $TBL_EXERCICE_QUESTION
WHERE c_id = $course_id AND question_id = ".intval($id)." AND exercice_id = ".intval($exerciseId).""; WHERE
c_id = $course_id
AND question_id = " . intval($id) . "
AND exercice_id = " . intval($exerciseId);
Database::query($sql); Database::query($sql);
return true; return true;
@ -1078,27 +1178,30 @@ abstract class Question
if (!empty($row['question_order'])) { if (!empty($row['question_order'])) {
$sql = "UPDATE $TBL_EXERCICE_QUESTION $sql = "UPDATE $TBL_EXERCICE_QUESTION
SET question_order = question_order-1 SET question_order = question_order-1
WHERE c_id = $course_id AND exercice_id = ".intval($row['exercice_id'])." AND question_order > ".$row['question_order']; WHERE
c_id= $course_id
AND exercice_id = " . intval($row['exercice_id']) . "
AND question_order > " . $row['question_order'];
Database::query($sql); Database::query($sql);
} }
} }
} }
$sql = "DELETE FROM $TBL_EXERCICE_QUESTION WHERE c_id = $course_id AND question_id = ".intval($id).""; $sql = "DELETE FROM $TBL_EXERCICE_QUESTION WHERE c_id = $course_id AND question_id = " . intval($id) . "";
Database::query($sql); Database::query($sql);
$sql = "DELETE FROM $TBL_QUESTIONS WHERE c_id = $course_id AND id = ".intval($id).""; $sql = "DELETE FROM $TBL_QUESTIONS WHERE c_id = $course_id AND id = " . intval($id) . "";
Database::query($sql); Database::query($sql);
$sql = "DELETE FROM $TBL_REPONSES WHERE c_id = $course_id AND question_id = ".intval($id).""; $sql = "DELETE FROM $TBL_REPONSES WHERE c_id = $course_id AND question_id = " . intval($id) . "";
Database::query($sql); Database::query($sql);
// remove the category of this question in the question_rel_category table // remove the category of this question in the question_rel_category table
$sql = "DELETE FROM $TBL_QUIZ_QUESTION_REL_CATEGORY $sql = "DELETE FROM $TBL_QUIZ_QUESTION_REL_CATEGORY
WHERE c_id = $course_id AND question_id = ".intval($id)." AND c_id=".api_get_course_int_id(); WHERE c_id = $course_id AND question_id = " . intval($id) . " AND c_id=" . api_get_course_int_id();
Database::query($sql); Database::query($sql);
api_item_property_update($this->course, TOOL_QUIZ, $id,'QuizQuestionDeleted',api_get_user_id()); api_item_property_update($this->course, TOOL_QUIZ, $id, 'QuizQuestionDeleted', api_get_user_id());
$this->removePicture(); $this->removePicture();
// resets the object // resets the object
@ -1106,11 +1209,11 @@ abstract class Question
} else { } else {
// just removes the exercise from the list // just removes the exercise from the list
$this->removeFromList($deleteFromEx); $this->removeFromList($deleteFromEx);
if (api_get_setting('search_enabled')=='true' && extension_loaded('xapian')) { if (api_get_setting('search_enabled') == 'true' && extension_loaded('xapian')) {
// disassociate question with this exercise // disassociate question with this exercise
$this -> search_engine_edit($deleteFromEx, FALSE, TRUE); $this->search_engine_edit($deleteFromEx, FALSE, TRUE);
} }
api_item_property_update($this->course, TOOL_QUIZ, $id,'QuizQuestionDeleted',api_get_user_id()); api_item_property_update($this->course, TOOL_QUIZ, $id, 'QuizQuestionDeleted', api_get_user_id());
} }
} }
@ -1160,8 +1263,19 @@ abstract class Question
$options = self::readQuestionOption($this->id, $this->course['real_id']); $options = self::readQuestionOption($this->id, $this->course['real_id']);
//Inserting in the new course db / or the same course db //Inserting in the new course db / or the same course db
$sql = "INSERT INTO $TBL_QUESTIONS (c_id, question, description, ponderation, position, type, level, extra ) $sql = "INSERT INTO $TBL_QUESTIONS (
VALUES('$course_id', '".Database::escape_string($question)."','".Database::escape_string($description)."','".Database::escape_string($weighting)."','".Database::escape_string($position)."','".Database::escape_string($type)."' ,'".Database::escape_string($level)."' ,'".Database::escape_string($extra)."' )"; c_id, question, description, ponderation, position, type, level, extra
)
VALUES (
'$course_id',
'" . Database::escape_string($question) . "',
'" . Database::escape_string($description) . "',
'" . Database::escape_string($weighting) . "',
'" . Database::escape_string($position) . "',
'" . Database::escape_string($type) . "',
'" . Database::escape_string($level) . "',
'" . Database::escape_string($extra) . "'
)";
Database::query($sql); Database::query($sql);
$new_question_id = Database::insert_id(); $new_question_id = Database::insert_id();
@ -1237,7 +1351,7 @@ abstract class Question
if (class_exists($class_name)) { if (class_exists($class_name)) {
return new $class_name(); return new $class_name();
} else { } else {
echo 'Can\'t instanciate class '.$class_name.' of type '.$type; echo 'Can\'t instanciate class ' . $class_name . ' of type ' . $type;
} }
} }
} }
@ -1268,7 +1382,6 @@ abstract class Question
document.getElementById ( \'HiddenFCK\' + editorInstanceName ).className = "media"; document.getElementById ( \'HiddenFCK\' + editorInstanceName ).className = "media";
} }
} }
</script>'; </script>';
// question name // question name
@ -1437,17 +1550,17 @@ abstract class Question
require_once $a_type[0]; require_once $a_type[0];
// get the picture of the type and the langvar which describes it // get the picture of the type and the langvar which describes it
$img = $explanation = ''; $img = $explanation = '';
eval('$img = '.$a_type[1].'::$typePicture;'); eval('$img = ' . $a_type[1] . '::$typePicture;');
eval('$explanation = get_lang('.$a_type[1].'::$explanationLangVar);'); eval('$explanation = get_lang(' . $a_type[1] . '::$explanationLangVar);');
echo '<li>'; echo '<li>';
echo '<div class="icon-image">'; echo '<div class="icon-image">';
if ($objExercise->exercise_was_added_in_lp == true) { if ($objExercise->exercise_was_added_in_lp == true) {
$img = pathinfo($img); $img = pathinfo($img);
$img = $img['filename'].'_na.'.$img['extension']; $img = $img['filename'] . '_na.' . $img['extension'];
echo Display::return_icon($img, $explanation, null, ICON_SIZE_BIG); echo Display::return_icon($img, $explanation, null, ICON_SIZE_BIG);
} else { } else {
echo '<a href="admin.php?'.api_get_cidreq().'&newQuestion=yes&answerType='.$i.'">'. echo '<a href="admin.php?' . api_get_cidreq() . '&newQuestion=yes&answerType=' . $i . '">' .
Display::return_icon($img, $explanation, null, ICON_SIZE_BIG).'</a>'; Display::return_icon($img, $explanation, null, ICON_SIZE_BIG) . '</a>';
} }
echo '</div>'; echo '</div>';
echo '</li>'; echo '</li>';
@ -1458,10 +1571,10 @@ abstract class Question
if ($objExercise->exercise_was_added_in_lp == true) { if ($objExercise->exercise_was_added_in_lp == true) {
echo Display::return_icon('database_na.png', get_lang('GetExistingQuestion'), null, ICON_SIZE_BIG); echo Display::return_icon('database_na.png', get_lang('GetExistingQuestion'), null, ICON_SIZE_BIG);
} else { } else {
if ($feedback_type==1) { if ($feedback_type == 1) {
echo $url = '<a href="question_pool.php?'.api_get_cidreq().'&type=1&fromExercise='.$exerciseId.'">'; echo $url = "<a href=\"question_pool.php?" . api_get_cidreq() . "&type=1&fromExercise=$exerciseId\">";
} else { } else {
echo $url = '<a href="question_pool.php?'.api_get_cidreq().'&fromExercise='.$exerciseId.'">'; echo $url = '<a href="question_pool.php?' . api_get_cidreq() . '&fromExercise=' . $exerciseId . '">';
} }
echo Display::return_icon('database.png', get_lang('GetExistingQuestion'), null, ICON_SIZE_BIG); echo Display::return_icon('database.png', get_lang('GetExistingQuestion'), null, ICON_SIZE_BIG);
} }
@ -1598,9 +1711,12 @@ abstract class Question
$header .= $this->show_media_content(); $header .= $this->show_media_content();
} }
$header .= Display::page_subheader2($counter_label.". ".$question_title); $header .= Display::page_subheader2($counter_label . ". " . $question_title);
$header .= Display::div('<div class="rib rib-'.$class.'"><h3>'.$score_label.'</h3></div> <h4>'.$score['result'].' </h4>', array('class'=>'ribbon')); $header .= Display::div(
$header .= Display::div($this->description, array('id'=>'question_description')); "<div class=\"rib rib-$class\"><h3>$score_label'</h3></div> <h4>{$score['result']}</h4>",
array('class' => 'ribbon')
);
$header .= Display::div($this->description, array('id' => 'question_description'));
return $header; return $header;
} }
@ -1640,11 +1756,21 @@ abstract class Question
r.c_id = $course_id"; r.c_id = $course_id";
$rs_max = Database::query($sql); $rs_max = Database::query($sql);
$row_max = Database::fetch_object($rs_max); $row_max = Database::fetch_object($rs_max);
$max_position = $row_max->max_position +1; $max_position = $row_max->max_position + 1;
// Insert the new question // Insert the new question
$sql = "INSERT INTO $tbl_quiz_question (c_id, question, description, ponderation, position, type, level) $sql = "INSERT INTO $tbl_quiz_question (
VALUES ($course_id, '".Database::escape_string($question_name)."', '".Database::escape_string($question_description)."', '$max_score', $max_position, $type, $level)"; c_id, question, description, ponderation, position, type, level
)
VALUES (
$course_id,
'" . Database::escape_string($question_name) . "',
'" . Database::escape_string($question_description) . "',
'$max_score',
$max_position,
$type,
$level
)";
Database::query($sql); Database::query($sql);
// Get the question ID // Get the question ID
@ -1679,8 +1805,8 @@ abstract class Question
$tabQuestionList = Question::get_question_type_list(); // [0]=file to include [1]=type name $tabQuestionList = Question::get_question_type_list(); // [0]=file to include [1]=type name
require_once $tabQuestionList[$type][0]; require_once $tabQuestionList[$type][0];
eval('$img = '.$tabQuestionList[$type][1].'::$typePicture;'); eval('$img = ' . $tabQuestionList[$type][1] . '::$typePicture;');
eval('$explanation = get_lang('.$tabQuestionList[$type][1].'::$explanationLangVar);'); eval('$explanation = get_lang(' . $tabQuestionList[$type][1] . '::$explanationLangVar);');
return array($img, $explanation); return array($img, $explanation);
} }
@ -1688,15 +1814,25 @@ abstract class Question
* Get course medias * Get course medias
* @param int course id * @param int course id
*/ */
static function get_course_medias($course_id, $start = 0, $limit = 100, $sidx = "question", $sord = "ASC", $where_condition = array()) static function get_course_medias(
$course_id,
$start = 0,
$limit = 100,
$sidx = "question",
$sord = "ASC",
$where_condition = array()
)
{ {
$table_question = Database::get_course_table(TABLE_QUIZ_QUESTION); $table_question = Database::get_course_table(TABLE_QUIZ_QUESTION);
$default_where = array('c_id = ? AND parent_id = 0 AND type = ?' => array($course_id, MEDIA_QUESTION)); $default_where = array('c_id = ? AND parent_id = 0 AND type = ?' => array($course_id, MEDIA_QUESTION));
$result = Database::select('*', $table_question, $result = Database::select(
'*',
$table_question,
array( array(
'limit' => " $start, $limit", 'limit' => " $start, $limit",
'where' => $default_where, 'where' => $default_where,
'order' => "$sidx $sord") 'order' => "$sidx $sord"
)
); );
return $result; return $result;
} }
@ -1713,7 +1849,7 @@ abstract class Question
$result = Database::select( $result = Database::select(
'count(*) as count', 'count(*) as count',
$table_question, $table_question,
array('where'=>array('c_id = ? AND parent_id = 0 AND type = ?' => array($course_id, MEDIA_QUESTION))), array('where' => array('c_id = ? AND parent_id = 0 AND type = ?' => array($course_id, MEDIA_QUESTION))),
'first' 'first'
); );

@ -223,7 +223,8 @@ class ExerciseLib
} }
if ($show_comment) { if ($show_comment) {
if (in_array( if (
in_array(
$answerType, $answerType,
array( array(
MULTIPLE_ANSWER, MULTIPLE_ANSWER,
@ -329,7 +330,8 @@ class ExerciseLib
$s .= $answer_input; $s .= $answer_input;
} }
} elseif ($answerType == MULTIPLE_ANSWER || } elseif (
$answerType == MULTIPLE_ANSWER ||
$answerType == MULTIPLE_ANSWER_TRUE_FALSE || $answerType == MULTIPLE_ANSWER_TRUE_FALSE ||
$answerType == GLOBAL_MULTIPLE_ANSWER $answerType == GLOBAL_MULTIPLE_ANSWER
) { ) {

Loading…
Cancel
Save