|
|
|
@ -190,9 +190,9 @@ class Answer |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Reads answer information from the data base ordered by parameter |
|
|
|
|
* @param string Field we want to order by |
|
|
|
|
* @param string DESC or ASC |
|
|
|
|
* @param string $field |
|
|
|
|
* @param string $field Field we want to order by |
|
|
|
|
* @param string $order DESC or ASC |
|
|
|
|
* |
|
|
|
|
* @author Frederic Vauthier |
|
|
|
|
*/ |
|
|
|
|
public function readOrderedBy($field, $order = 'ASC') |
|
|
|
@ -387,11 +387,18 @@ class Answer |
|
|
|
|
$list = array(); |
|
|
|
|
for ($i = 1; $i <= $this->nbrAnswers; $i++) { |
|
|
|
|
if (!empty($this->answer[$i])) { |
|
|
|
|
|
|
|
|
|
//Avoid problems when parsing elements with accents |
|
|
|
|
if ($decode) { |
|
|
|
|
$this->answer[$i] = api_html_entity_decode($this->answer[$i], ENT_QUOTES, api_get_system_encoding()); |
|
|
|
|
$this->comment[$i] = api_html_entity_decode($this->comment[$i], ENT_QUOTES, api_get_system_encoding()); |
|
|
|
|
$this->answer[$i] = api_html_entity_decode( |
|
|
|
|
$this->answer[$i], |
|
|
|
|
ENT_QUOTES, |
|
|
|
|
api_get_system_encoding() |
|
|
|
|
); |
|
|
|
|
$this->comment[$i] = api_html_entity_decode( |
|
|
|
|
$this->comment[$i], |
|
|
|
|
ENT_QUOTES, |
|
|
|
|
api_get_system_encoding() |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$list[] = array( |
|
|
|
@ -402,7 +409,7 @@ class Answer |
|
|
|
|
'hotspot_coord' => $this->hotspot_coordinates[$i], |
|
|
|
|
'hotspot_type' => $this->hotspot_type[$i], |
|
|
|
|
'correct' => $this->correct[$i], |
|
|
|
|
'destination' => $this->destination[$i] |
|
|
|
|
'destination' => $this->destination[$i], |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -423,6 +430,7 @@ class Answer |
|
|
|
|
$list[$i] = $this->weighting[$i]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $list; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -499,8 +507,7 @@ class Answer |
|
|
|
|
* returns answer hotspot coordinates |
|
|
|
|
* |
|
|
|
|
* @author Olivier Brouckaert |
|
|
|
|
* @param integer Answer ID |
|
|
|
|
* @param integer $id |
|
|
|
|
* @param integer $id Answer ID |
|
|
|
|
* @return integer Answer position |
|
|
|
|
*/ |
|
|
|
|
public function selectHotspotCoordinates($id) |
|
|
|
@ -512,8 +519,7 @@ class Answer |
|
|
|
|
* returns answer hotspot type |
|
|
|
|
* |
|
|
|
|
* @author Toon Keppens |
|
|
|
|
* @param integer Answer ID |
|
|
|
|
* @param integer $id |
|
|
|
|
* @param integer $id Answer ID |
|
|
|
|
* @return integer Answer position |
|
|
|
|
*/ |
|
|
|
|
public function selectHotspotType($id) |
|
|
|
@ -971,7 +977,6 @@ class Answer |
|
|
|
|
public function isCorrectByAutoId($needle) |
|
|
|
|
{ |
|
|
|
|
$key = 0; |
|
|
|
|
|
|
|
|
|
foreach ($this->autoId as $autoIdKey => $autoId) { |
|
|
|
|
if ($autoId == $needle) { |
|
|
|
|
$key = $autoIdKey; |
|
|
|
|