/** * returns the fact wether the feedback editing form has to be saveable or not. * this depends on the additional content editing mode and the current question type, * as well as on fact wether the question is writable for current user or not, * or the fact if we are in self assessment mode or not * * @access private * @return boolean $isFormSaveable */ private function isFormSaveable() { $isAdditionalContentEditingModePageObject = $this->questionOBJ->isAdditionalContentEditingModePageObject(); $isSaveableInPageObjectEditingMode = $this->feedbackOBJ->isSaveableInPageObjectEditingMode(); if ($isAdditionalContentEditingModePageObject && !$isSaveableInPageObjectEditingMode) { return false; } $hasWriteAccess = $this->access->checkAccess("write", "", $_GET['ref_id']); $isSelfAssessmentEditingMode = $this->questionOBJ->getSelfAssessmentEditingMode(); return $hasWriteAccess || $isSelfAssessmentEditingMode; }
/** * Constructor * * @access public * @param assQuestion $questionOBJ * @param ilCtrl $ctrl * @param ilTabsGUI $tabs * @param ilLanguage $lng */ public function __construct(assQuestion $questionOBJ, ilCtrl $ctrl, ilTabsGUI $tabs, ilLanguage $lng) { parent::__construct($questionOBJ, $ctrl, $tabs, $lng); if (!isset($_GET['feedback_id']) || !(int) $_GET['feedback_id']) { ilUtil::sendFailure('invalid feedback id given: ' . (int) $_GET['feedback_id'], true); $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW); } if (!isset($_GET['feedback_type']) || !ilAssQuestionFeedback::isValidFeedbackPageObjectType($_GET['feedback_type'])) { ilUtil::sendFailure('invalid feedback type given: ' . $_GET['feedback_type'], true); $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW); } }
/** * Collects all text in the question which could contain media objects * which were created with the Rich Text Editor */ protected function getRTETextWithMediaObjects() { // must be called in parent classes. add additional RTE text in the parent // classes and call this method to add the standard RTE text $collected = $this->getQuestion(); $collected .= $this->feedbackOBJ->getGenericFeedbackContent($this->getId(), false); $collected .= $this->feedbackOBJ->getGenericFeedbackContent($this->getId(), true); for ($i = 0; $i <= $this->getTotalAnswers(); $i++) { $collected .= $this->feedbackOBJ->getSpecificAnswerFeedbackContent($this->getId(), $i); } foreach ($this->suggested_solutions as $solution_array) { $collected .= $solution_array["value"]; } return $collected; }