/** * return necessaries html objects that represent the object * * @access protected * * @param $ref reference to the object that will contain this rendered object * @param $feedback "show feedback" flag on rendering * @param $rating "show rating" flag on rendering * @param $rating_answer "show correct answer" on rendering * * @return an object of CDOMElement */ protected function renderingHtml(&$ref = null, $feedback = false, $rating = false, $rating_answer = false) { if (!$this->display) { return new CText(''); } //if we don't have to display this question, let's return an empty item if ($_SESSION['sess_id_user_type'] != AMA_TYPE_STUDENT) { $feedback = true; $rating = true; $rating_answer = true; } $out = parent::renderingHtml($ref, $feedback, $rating, $rating_answer); switch ($this->exerciseVariation) { default: case ADA_ERASE_TEST_ERASE: $class = 'answer_cloze_erase_test'; break; case ADA_HIGHLIGHT_TEST_ERASE: $class = 'answer_cloze_highlight_test'; break; } $li = new CLi(); $li->setAttribute('class', $class); $li->addChild(new CText($this->getPreparedText($feedback, $rating, $rating_answer))); $ref->addChild($li); return $out; }
/** * return necessaries html objects that represent the object * * @access protected * * @param $ref reference to the object that will contain this rendered object * @param $feedback "show feedback" flag on rendering * @param $rating "show rating" flag on rendering * @param $rating_answer "show correct answer" on rendering * * @return an object of CDOMElement */ protected function renderingHtml(&$ref = null, $feedback = false, $rating = false, $rating_answer = false) { if (!$this->display) { return new CText(''); } //if we don't have to display this question, let's return an empty item $out = parent::renderingHtml($ref, $feedback, $rating, $rating_answer); $li = new CLi(); $li->setAttribute("class", "answer_cloze_test"); $li->addChild(new CText($this->getPreparedText($feedback, $rating, $rating_answer))); $ref->addChild($li); return $out; }