/** * renders a table row by filling wor data to table row template * * @access public * @global ilCtrl $ilCtrl * @global ilLanguage $lng * @param array $rowData */ public function fillRow($rowData) { global $ilCtrl, $lng; if ($this->tableMode == self::TBL_MODE_ADMINISTRATION) { $list = new ilAdvancedSelectionListGUI(); $list->setListTitle($lng->txt('actions')); $list->setId("advsl_hint_{$rowData['hint_id']}_actions"); if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) { $editPointsHref = $ilCtrl->getLinkTargetByClass('ilAssQuestionHintGUI', ilAssQuestionHintGUI::CMD_SHOW_FORM); $editPointsHref = ilUtil::appendUrlParameterString($editPointsHref, "hint_id={$rowData['hint_id']}", true); $list->addItem($lng->txt('tst_question_hints_table_link_edit_hint_points'), '', $editPointsHref); $editPageHref = $ilCtrl->getLinkTargetByClass('ilasshintpagegui', 'edit'); $editPageHref = ilUtil::appendUrlParameterString($editPageHref, "hint_id={$rowData['hint_id']}", true); $list->addItem($lng->txt('tst_question_hints_table_link_edit_hint_page'), '', $editPageHref); } else { $editHref = $ilCtrl->getLinkTargetByClass('ilAssQuestionHintGUI', ilAssQuestionHintGUI::CMD_SHOW_FORM); $editHref = ilUtil::appendUrlParameterString($editHref, "hint_id={$rowData['hint_id']}", true); $list->addItem($lng->txt('tst_question_hints_table_link_edit_hint'), '', $editHref); } $deleteHref = $ilCtrl->getLinkTarget($this->parent_obj, ilAssQuestionHintsGUI::CMD_CONFIRM_DELETE); $deleteHref = ilUtil::appendUrlParameterString($deleteHref, "hint_id={$rowData['hint_id']}", true); $list->addItem($lng->txt('tst_question_hints_table_link_delete_hint'), '', $deleteHref); $this->tpl->setVariable('ACTIONS', $list->getHTML()); $this->tpl->setVariable('HINT_ID', $rowData['hint_id']); $hintIndex = $rowData['hint_index'] * self::INDEX_TO_POSITION_FACTOR; } else { $showHref = $this->parent_obj->getHintPresentationLinkTarget($rowData['hint_id']); $this->tpl->setVariable('HINT_HREF', $showHref); $hintIndex = ilAssQuestionHint::getHintIndexLabel($lng, $rowData['hint_index']); } $this->tpl->setVariable('HINT_INDEX', $hintIndex); $this->tpl->setVariable('HINT_TEXT', $rowData['hint_text']); $this->tpl->setVariable('HINT_POINTS', $rowData['hint_points']); }
/** * imports the given feedback content as generic feedback for the given question id * for either the complete or incomplete solution * * @access public * @param integer $questionId * @param boolean $solutionCompleted * @param string $feedbackContent */ public function importGenericFeedback($questionId, $solutionCompleted, $feedbackContent) { if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) { $pageObjectId = $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted); $pageObjectType = $this->getGenericFeedbackPageObjectType(); $this->createPageObject($pageObjectType, $pageObjectId, $feedbackContent); } else { $this->saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent); } }
/** * returns the fact wether the presentation of the question sync2pool form * is required after saving the form or not * * @access private * @return boolean $isSyncAfterSaveRequired */ private function isSyncAfterSaveRequired() { global $ilUser; if (!$_GET["calling_test"]) { return false; } if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) { return false; } if (!$this->questionOBJ->_questionExistsInPool($this->questionOBJ->original_id)) { return false; } if (!assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) { return false; } return true; }