@ -311,14 +313,14 @@ class ExerciseLink extends AbstractLink
if ($tbl_exercise=='') {
return false;
} elseif (!isset($this->exercise_data)) {
if ($this->is_hp == 1) {
$ref_id = intval($this->get_ref_id());
$sql = "SELECT * FROM $tbl_exercise ex, $TBL_ITEM_PROPERTY ip
WHERE ip.ref = ex.id AND ip.c_id = $this->course_id AND ex.c_id = $this->course_id AND ip.tool = '".TOOL_DOCUMENT."' AND (ex.path LIKE '%htm%')AND (ex.path LIKE '%HotPotatoes_files%') AND ip.visibility = 1";
} else {
if ($this->is_hp == 1) {
$ref_id = intval($this->get_ref_id());
$sql = "SELECT * FROM $tbl_exercise ex, $TBL_ITEM_PROPERTY ip
WHERE ip.ref = ex.id AND ip.c_id = $this->course_id AND ex.c_id = $this->course_id AND ip.tool = '".TOOL_DOCUMENT."' AND (ex.path LIKE '%htm%')AND (ex.path LIKE '%HotPotatoes_files%') AND ip.visibility = 1";
} else {
$sql = 'SELECT * FROM '.$tbl_exercise.'
WHERE c_id = '.$this->course_id.' AND id = '.(int)$this->get_ref_id().' ';
}
WHERE c_id = '.$this->course_id.' AND id = '.(int)$this->get_ref_id().' ';