33 private \ILIAS\TestQuestionPool\InternalRequestService
$request;
52 $this->main_tpl = $DIC->ui()->mainTemplate();
53 $this->
ctrl = $DIC[
'ilCtrl'];
54 $this->request = $DIC->testQuestionPool()->internal()->request();
55 $this->
lng = $DIC->language();
56 $this->rbac_system = $DIC->rbac()->system();
58 if ($this->request->raw(
'qpool_ref_id')) {
59 $this->
setPoolRefId($this->request->raw(
'qpool_ref_id'));
60 } elseif ($this->request->raw(
'qpool_obj_id')) {
61 $this->
setPoolObjId($this->request->raw(
'qpool_obj_id'));
65 $this->
lng->loadLanguageModule(
'assessment');
67 $this->
ctrl->saveParameter($this, [
'qpool_ref_id',
'qpool_obj_id',
'q_id',
'q_type']);
70 $this->new_id_listeners = [];
71 $this->new_id_listener_cnt = 0;
76 $this->selfassessmenteditingmode = $a_selfassessmenteditingmode;
86 $this->defaultnroftries = $a_defaultnroftries;
96 $this->page_config = $a_val;
104 public function addNewIdListener(
object $a_object,
string $a_method,
string $a_parameters =
''): void
107 $this->new_id_listeners[$cnt][
'object'] = $a_object;
108 $this->new_id_listeners[$cnt][
'method'] = $a_method;
109 $this->new_id_listeners[$cnt][
'parameters'] = $a_parameters;
110 $this->new_id_listener_cnt++;
115 $cmd = $this->
ctrl->getCmd();
116 $next_class = $this->
ctrl->getNextClass();
118 switch ($next_class) {
124 $q_gui->object->setSelfAssessmentEditingMode(
128 $q_gui->object->setDefaultNrOfTries(
133 if (is_object($this->page_config)) {
134 $q_gui->object->setPreventRteUsage($this->
getPageConfig()->getPreventRteUsage());
139 $object = $this->new_id_listeners[
$i][
'object'];
140 $method = $this->new_id_listeners[
$i][
'method'];
141 $parameters = $this->new_id_listeners[
$i][
'parameters'];
142 $q_gui->addNewIdListener(
149 $count = $q_gui->object->usageNumber();
151 if ($this->rbac_system->checkAccess(
'write', $this->getPoolRefId())) {
152 $this->main_tpl->setOnScreenMessage(
'info', sprintf($this->
lng->txt(
'qpl_question_is_in_use'), $count));
155 $this->
ctrl->setCmdClass(get_class($q_gui));
156 $ret = (string) $this->
ctrl->forwardCommand($q_gui);
165 $this->questionid = $a_questionid;
166 $this->
ctrl->setParameter($this,
'q_id', $this->questionid);
176 $this->poolrefid = $a_poolrefid;
177 $this->
ctrl->setParameter($this,
'qpool_ref_id', $this->poolrefid);
193 $this->poolobjid = $a_poolobjid;
194 $this->
ctrl->setParameter($this,
'qpool_obj_id', $this->poolobjid);
204 $this->questiontype = $a_questiontype;
205 $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='')
bool $selfassessmenteditingmode
setQuestionType(?string $a_questiontype)
ILIAS TestQuestionPool InternalRequestService $request