33 private \ILIAS\TestQuestionPool\InternalRequestService
$request;
53 $this->main_tpl = $DIC->ui()->mainTemplate();
54 $this->
ctrl = $DIC[
'ilCtrl'];
55 $this->request = $DIC->testQuestionPool()->internal()->request();
56 $this->
lng = $DIC->language();
57 $this->rbac_system = $DIC->rbac()->system();
58 $this->questioninfo = $DIC->testQuestionPool()->questionInfo();
60 if ($this->request->raw(
'qpool_ref_id')) {
61 $this->
setPoolRefId($this->request->raw(
'qpool_ref_id'));
62 } elseif ($this->request->raw(
'qpool_obj_id')) {
63 $this->
setPoolObjId($this->request->raw(
'qpool_obj_id'));
67 $this->
lng->loadLanguageModule(
'assessment');
69 $this->
ctrl->saveParameter($this, [
'qpool_ref_id',
'qpool_obj_id',
'q_id',
'q_type']);
72 $this->new_id_listeners = [];
73 $this->new_id_listener_cnt = 0;
78 $this->selfassessmenteditingmode = $a_selfassessmenteditingmode;
88 $this->defaultnroftries = $a_defaultnroftries;
98 $this->page_config = $a_val;
106 public function addNewIdListener(
object $a_object,
string $a_method,
string $a_parameters =
''): void
109 $this->new_id_listeners[$cnt][
'object'] = $a_object;
110 $this->new_id_listeners[$cnt][
'method'] = $a_method;
111 $this->new_id_listeners[$cnt][
'parameters'] = $a_parameters;
112 $this->new_id_listener_cnt++;
117 $cmd = $this->
ctrl->getCmd();
118 $next_class = $this->
ctrl->getNextClass();
120 switch ($next_class) {
126 $q_gui->object->setSelfAssessmentEditingMode(
130 $q_gui->object->setDefaultNrOfTries(
135 if (is_object($this->page_config)) {
136 $q_gui->object->setPreventRteUsage($this->
getPageConfig()->getPreventRteUsage());
137 $q_gui->setInLearningModuleContext(get_class($this->page_config) === ilLMPageConfig::class);
142 $object = $this->new_id_listeners[$i][
'object'];
143 $method = $this->new_id_listeners[$i][
'method'];
144 $parameters = $this->new_id_listeners[$i][
'parameters'];
145 $q_gui->addNewIdListener(
152 $count = $this->questioninfo->usageNumber($q_gui->object->getId());
154 if ($this->rbac_system->checkAccess(
'write', $this->getPoolRefId())) {
155 $this->main_tpl->setOnScreenMessage(
'info', sprintf($this->
lng->txt(
'qpl_question_is_in_use'), $count));
158 $this->
ctrl->setCmdClass(get_class($q_gui));
159 $ret = (string) $this->
ctrl->forwardCommand($q_gui);
168 $this->questionid = $a_questionid;
169 $this->
ctrl->setParameter($this,
'q_id', $this->questionid);
179 $this->poolrefid = $a_poolrefid;
180 $this->
ctrl->setParameter($this,
'qpool_ref_id', $this->poolrefid);
196 $this->poolobjid = $a_poolobjid;
197 $this->
ctrl->setParameter($this,
'qpool_obj_id', $this->poolobjid);
207 $this->questiontype = $a_questiontype;
208 $this->
ctrl->setParameter($this,
'q_type', $this->questiontype);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilRbacSystem $rbac_system
ilGlobalTemplateInterface $main_tpl
setDefaultNrOfTries(?int $a_defaultnroftries)
setQuestionId(?int $a_questionid)
ilPageConfig $page_config
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setPoolRefId(?int $a_poolrefid)
getSelfAssessmentEditingMode()
setSelfAssessmentEditingMode(bool $a_selfassessmenteditingmode)
setPoolObjId(?int $a_poolobjid)
setPageConfig(ilPageConfig $a_val)
addNewIdListener(object $a_object, string $a_method, string $a_parameters='')
ILIAS TestQuestionPool QuestionInfoService $questioninfo
bool $selfassessmenteditingmode
setQuestionType(?string $a_questiontype)
ILIAS TestQuestionPool InternalRequestService $request