19 declare(strict_types=0);
    76         $this->
ctrl = $DIC->ctrl();
    77         $this->db = $DIC->database();
    78         $this->
ctrl->saveParameter($this, array(
"ref_id"));
    80         $this->
logger = $DIC->logger()->crs();
    81         $this->ilErr = $DIC[
'ilErr'];
    82         $this->
lng = $DIC->language();
    83         $this->
lng->loadLanguageModule(
'crs');
    84         $this->tpl = $DIC->ui()->mainTemplate();
    85         $this->tree = $DIC->repositoryTree();
    86         $this->
tabs = $DIC->tabs();
    87         $this->
access = $DIC->access();
    88         $this->rbacsystem = $DIC->rbac()->system();
    89         $this->
toolbar = $DIC->toolbar();
    90         $this->
help = $DIC->help();
    92         $this->workflow = $DIC->ui()->factory()->listing()->workflow();
    93         $this->renderer = $DIC->ui()->renderer();
    94         $this->
http = $DIC->http();
    97         $this->course_id = $a_course_id;
   104         $this->
tabs->setTabActive(
'crs_objectives');
   106         $cmd = $this->
ctrl->getCmd();
   108         if (!$cmd = $this->
ctrl->getCmd()) {
   117         if ($this->
http->wrapper()->query()->has(
'objective_id')) {
   118             return $this->
http->wrapper()->query()->retrieve(
   128         if ($this->
http->wrapper()->post()->has(
'objective')) {
   129             return $this->
http->wrapper()->post()->retrieve(
   131                 $this->
refinery->kindlyTo()->listOf(
   141         if ($this->
http->wrapper()->query()->has(
'tt')) {
   142             return $this->
http->wrapper()->query()->retrieve(
   158         if (!$this->
access->checkAccess(
"write", 
'', $this->course_obj->getRefId())) {
   159             $this->ilErr->raiseError($this->
lng->txt(
"msg_no_perm_write"), $this->ilErr->MESSAGE);
   161         $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.crs_objectives.html', 
'Modules/Course');
   163             $this->
lng->txt(
'crs_add_objective'),
   164             $this->
ctrl->getLinkTarget($this, 
"'create")
   168         $table->setTitle($this->
lng->txt(
'crs_objectives'), 
'', $this->
lng->txt(
'crs_objectives'));
   171         $this->tpl->setVariable(
'OBJECTIVES_TABLE', $table->getHTML());
   176         $this->
tabs->setSubTabActive(
'crs_objective_overview_question_assignment');
   178         if (!$this->
access->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
   179             $this->ilErr->raiseError($this->
lng->txt(
'permission_denied'), $this->ilErr->WARNING);
   184             $this->
lng->txt(
'crs_objectives_edit_question_assignments'),
   186             $this->
lng->txt(
'crs_objectives')
   189         $this->tpl->setContent($table->getHTML());
   194         if (!$this->
access->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
   195             $this->ilErr->raiseError($this->
lng->txt(
'permission_denied'), $this->ilErr->WARNING);
   198         $post_self_limit = [];
   199         if ($this->
http->wrapper()->post()->has(
'self')) {
   200             $post_self_limit = $this->
http->wrapper()->post()->retrieve(
   202                 $this->
refinery->kindlyTo()->dictOf(
   203                     $this->
refinery->kindlyTo()->float()
   207         $post_final_limit = [];
   208         if ($this->
http->wrapper()->post()->has(
'final')) {
   209             $post_final_limit = $this->
http->wrapper()->post()->retrieve(
   211                 $this->
refinery->kindlyTo()->dictOf(
   212                     $this->
refinery->kindlyTo()->float()
   217         foreach ($post_self_limit as $objective_id => $limit) {
   219             $max_points = $qst->getSelfAssessmentPoints();
   221             if ($limit < 0 || $limit > $max_points) {
   222                 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'crs_objective_limit_err'));
   227         foreach ($post_final_limit as $objective_id => $limit) {
   229             $max_points = $qst->getFinalTestPoints();
   231             if ($limit < 0 || $limit > $max_points) {
   232                 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'crs_objective_limit_err'));
   238         foreach ($post_self_limit as $objective_id => $limit) {
   246         foreach ($post_final_limit as $objective_id => $limit) {
   254         $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
   263             throw new RuntimeException(
'Course objectives GUI initialized without valid course instance');
   287         if ($a_active != 
"") {
   288             $this->
help->setScreenIdComponent(
"crs");
   289             $this->
help->setScreenId(
"crs_objective");
   290             $this->
help->setSubScreenId($a_active);
   299         $this->
ctrl->saveParameter($this, 
'objective_id');
   309         $this->tpl->setContent($form->
getHTML());
   319             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'crs_no_objective_selected'), 
true);
   320             $this->
ctrl->redirect($this, 
'listObjectives');
   331         $this->tpl->setContent($form->
getHTML());
   334     protected function save(): void
   336         if (!$this->
access->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
   337             $this->ilErr->raiseError($this->
lng->txt(
'permission_denied'), $this->ilErr->WARNING);
   340         $this->
ctrl->saveParameter($this, 
'objective_id');
   344             $this->objective->setTitle($form->
getInput(
'title'));
   345             $this->objective->setDescription($form->
getInput(
'description'));
   346             $this->objective->setPasses(0);
   349                 $objective_id = $this->objective->add();
   350                 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'crs_added_objective'), 
true);
   352                 $this->objective->update();
   353                 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'crs_objective_modified'), 
true);
   366             $this->
ctrl->returnToParent($this);
   368         $this->
ctrl->setParameter($this, 
'objective_id', $objective_id);
   369         $this->
ctrl->redirect($this, 
'materialAssignment');
   374         if (!$this->
access->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
   375             $this->ilErr->raiseError($this->
lng->txt(
'permission_denied'), $this->ilErr->WARNING);
   378             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'crs_no_objective_selected'), 
true);
   379             $this->
ctrl->redirect($this, 
'listObjectives');
   383         $this->
ctrl->saveParameter($this, 
'objective_id');
   392             $this->
lng->txt(
'crs_objective_wiz_materials'),
   394             $this->
lng->txt(
'crs_objectives')
   398         $this->
initWizard(self::STEP_MATERIAL_ASSIGNMENT);
   399         $this->tpl->setContent($table->getHTML());
   407         if ($this->
http->wrapper()->post()->has($key)) {
   408             return $this->
http->wrapper()->post()->retrieve(
   410                 $this->
refinery->kindlyTo()->listOf(
   423         if ($this->
http->wrapper()->post()->has($key)) {
   424             return $this->
http->wrapper()->post()->retrieve(
   426                 $this->
refinery->kindlyTo()->listOf(
   427                     $this->
refinery->kindlyTo()->string()
   436         if (!$this->
access->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
   437             $this->ilErr->raiseError($this->
lng->txt(
'permission_denied'), $this->ilErr->WARNING);
   440             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'crs_no_objective_selected'), 
true);
   441             $this->
ctrl->redirect($this, 
'listObjectives');
   451         foreach ($visibleMaterials as $node_id) {
   453             if (!in_array($node_id, $materials)) {
   454                 $this->objectives_lm_obj->deleteMaterial($node_id, $obj_id);
   457             if ($this->objectives_lm_obj->isMaterialAssigned($node_id, $obj_id)) {
   460             $this->objectives_lm_obj->setLMRefId($node_id);
   461             $this->objectives_lm_obj->setLMObjId($obj_id);
   462             $this->objectives_lm_obj->setType($this->
objectDataCache->lookupType($obj_id));
   463             $this->objectives_lm_obj->add();
   466         foreach ($visibleChapters as $chapter) {
   467             list(
$ref_id, $chapter_id) = explode(
'_', $chapter);
   468             if (!in_array($chapter, $chapters)) {
   469                 $this->objectives_lm_obj->deleteMaterial(
$ref_id, $chapter_id);
   472             if ($this->objectives_lm_obj->isMaterialAssigned(
$ref_id, $chapter_id)) {
   475             $this->objectives_lm_obj->setLMRefId(
$ref_id);
   476             $this->objectives_lm_obj->setLMObjId($chapter_id);
   478             $this->objectives_lm_obj->add();
   481         $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'crs_objectives_assigned_lm'));
   483             $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'crs_objectives_assigned_lm'), 
true);
   484             $this->
ctrl->returnToParent($this);
   491         } elseif (!$this->
getSettings()->hasSeparateQualifiedTests()) {
   494             $this->
ctrl->redirectByClass(ilLOEditorGUI::class);
   500         if (!$this->
access->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
   501             $this->ilErr->raiseError($this->
lng->txt(
'permission_denied'), $this->ilErr->WARNING);
   504             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'crs_no_objective_selected'), 
true);
   505             $this->
ctrl->redirect($this, 
'listObjectives');
   510         $this->
ctrl->saveParameter($this, 
'objective_id');
   529             $this->
lng->txt(
'crs_objective_wiz_self'),
   531             $this->
lng->txt(
'crs_objective')
   536         $this->
initWizard(self::STEP_INITIAL_TEST_ASSIGNMENT);
   537         $this->tpl->setContent($table->getHTML());
   542         $checked_questions = [];
   543         if ($this->
http->wrapper()->post()->has(
'questions')) {
   544             $checked_questions = $this->
http->wrapper()->post()->retrieve(
   546                 $this->
refinery->kindlyTo()->dictOf(
   547                     $this->
refinery->kindlyTo()->string()
   552         if (!$this->
access->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
   553             $this->ilErr->raiseError($this->
lng->txt(
'permission_denied'), $this->ilErr->WARNING);
   556             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'crs_no_objective_selected'), 
true);
   557             $this->
ctrl->redirect($this, 
'listObjectives');
   562         foreach ($this->objectives_qst_obj->getSelfAssessmentQuestions() as $question) {
   563             $id = $question[
'ref_id'] . 
'_' . $question[
'question_id'];
   564             if (!in_array(
$id, $checked_questions)) {
   565                 $this->objectives_qst_obj->delete($question[
'qst_ass_id']);
   569         foreach ($checked_questions as $question_id) {
   570             list($test_ref_id, $qst_id) = explode(
'_', $question_id);
   571             $test_obj_id = $this->
objectDataCache->lookupObjId((
int) $test_ref_id);
   573             if ($this->objectives_qst_obj->isSelfAssessmentQuestion($qst_id)) {
   577             $this->objectives_qst_obj->setTestRefId($test_ref_id);
   578             $this->objectives_qst_obj->setTestObjId($test_obj_id);
   579             $this->objectives_qst_obj->setQuestionId($qst_id);
   580             $this->objectives_qst_obj->add();
   586         if ($checked_questions) {
   587             $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'crs_objectives_assigned_lm'));
   591                 case self::MODE_CREATE:
   595                 case self::MODE_UPDATE:
   597                     $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'crs_objectives_assigned_lm'));
   604         if (!$this->
access->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
   605             $this->ilErr->raiseError($this->
lng->txt(
'permission_denied'), $this->ilErr->WARNING);
   608             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'crs_no_objective_selected'), 
true);
   609             $this->
ctrl->redirect($this, 
'listObjectives');
   614         $this->
ctrl->saveParameter($this, 
'objective_id');
   618         $this->
initWizard(self::STEP_INITIAL_TEST_LIMIT);
   621         $this->tpl->setContent($this->
form->getHTML());
   626         if (!$this->
access->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
   627             $this->ilErr->raiseError($this->
lng->txt(
'permission_denied'), $this->ilErr->WARNING);
   630             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'crs_no_objective_selected'), 
true);
   631             $this->
ctrl->redirect($this, 
'listObjectives');
   636         $limit = $this->
http->wrapper()->post()->retrieve(
   639                 $this->refinery->kindlyTo()->int(),
   643         if ($limit < 1 || $limit > 100) {
   644             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'crs_objective_err_limit'));
   649         foreach ($this->objectives_qst_obj->getSelfAssessmentTests() as $test) {
   651             $this->objectives_qst_obj->setTestSuggestedLimit($limit);
   652             $this->objectives_qst_obj->updateTest($test[
'test_objective_id']);
   656         $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'), 
true);
   657         if (!$this->
settings->hasSeparateQualifiedTests()) {
   661         $this->
ctrl->returnToParent($this);
   666         if (!$this->
access->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
   667             $this->ilErr->raiseError($this->
lng->txt(
'permission_denied'), $this->ilErr->WARNING);
   670             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'crs_no_objective_selected'), 
true);
   671             $this->
ctrl->redirect($this, 
'listObjectives');
   676         $this->
ctrl->saveParameter($this, 
'objective_id');
   696             $this->
lng->txt(
'crs_objective_wiz_final'),
   698             $this->
lng->txt(
'crs_objective')
   702         $this->
initWizard(self::STEP_FINAL_TEST_ASSIGNMENT);
   703         $this->tpl->setContent($table->getHTML());
   708         if ($a_tst_type === 0) {
   712         $tst_ref_id = $this->
getSettings()->getTestByType($a_tst_type);
   713         if ($tst_ref_id === 0) {
   721         $this->
ctrl->saveParameter($this, 
'objective_id');
   726         $this->
ctrl->setParameter($this, 
'tt', $this->test_type);
   735             $this->
initWizard(self::STEP_INITIAL_TEST_ASSIGNMENT);
   737             $this->
initWizard(self::STEP_FINAL_TEST_ASSIGNMENT);
   740         $this->tpl->setContent($form->
getHTML());
   749             $form->
setTitle($this->
lng->txt(
'crs_loc_form_random_limits_it'));
   751             $form->
setTitle($this->
lng->txt(
'crs_loc_form_random_limits_qt'));
   758         $options->setRequired(
true);
   760         $ass_qpl = 
new ilRadioOption($this->
lng->txt(
'crs_loc_rand_assign_qpl'), 
'1');
   761         $options->addOption($ass_qpl);
   765         $qpl->setMulti(
true, 
false);
   766         $qpl->setOptions($this->getRandomTestQplOptions());
   769             $this->course_obj->getId(),
   775         $qpl->setValue((
string) ($sequences[0] ?? 
''));
   776         $qpl->setMultiValues($sequences);
   777         $ass_qpl->addSubItem($qpl);
   783                 $this->course_obj->getId(),
   789         $per->setMinValue(1);
   790         $per->setMaxValue(100);
   791         $per->setRequired(
true);
   792         $ass_qpl->addSubItem($per);
   797     protected function getRandomTestQplOptions(): array
   800         $tst_ref_id = $this->
getSettings()->getTestByType($this->test_type);
   816         $list->loadDefinitions();
   818         $translater->loadLabels($list);
   820         $options[0] = $this->
lng->txt(
'select_one');
   821         foreach ($list as $definition) {
   823             $title = $definition->getPoolTitle();
   825             $filterTitle = array();
   826             $filterTitle[] = $translater->getTaxonomyFilterLabel($definition->getMappedTaxonomyFilter());
   827             $filterTitle[] = $translater->getTypeFilterLabel($definition->getTypeFilter());
   828             if (!empty($filterTitle)) {
   829                 $title .= 
' -> ' . implode(
' / ', $filterTitle);
   831             $options[$definition->getId()] = $title;
   838         $this->
ctrl->saveParameter($this, 
'objective_id');
   846                 $this->course_obj->getId(),
   852             $qst->deleteByTestType(
   858             foreach (array_unique((array) $form->
getInput(
'qpl')) as $qpl_id) {
   860                     $this->course_obj->getId(),
   871             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
   876         $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'), 
true);
   881             $this->
ctrl->returnToParent($this);
   883             $this->
ctrl->redirect($this, 
'finalTestAssignment');
   889         $checked_questions = [];
   890         if ($this->
http->wrapper()->post()->has(
'questions')) {
   891             $checked_questions = $this->
http->wrapper()->post()->retrieve(
   893                 $this->
refinery->kindlyTo()->dictOf(
   894                     $this->
refinery->kindlyTo()->string()
   899         if (!$this->
access->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
   900             $this->ilErr->raiseError($this->
lng->txt(
'permission_denied'), $this->ilErr->WARNING);
   903             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'crs_no_objective_selected'), 
true);
   904             $this->
ctrl->redirect($this, 
'listObjectives');
   910         foreach ($this->objectives_qst_obj->getFinalTestQuestions() as $question) {
   911             $id = $question[
'ref_id'] . 
'_' . $question[
'question_id'];
   912             if (!in_array(
$id, $checked_questions)) {
   913                 $this->objectives_qst_obj->delete($question[
'qst_ass_id']);
   917         foreach ($checked_questions as $question_id) {
   918             list($test_ref_id, $qst_id) = explode(
'_', $question_id);
   919             $test_obj_id = $this->
objectDataCache->lookupObjId((
int) $test_ref_id);
   921             if ($this->objectives_qst_obj->isFinalTestQuestion($qst_id)) {
   926             $this->objectives_qst_obj->setTestRefId($test_ref_id);
   927             $this->objectives_qst_obj->setTestObjId($test_obj_id);
   928             $this->objectives_qst_obj->setQuestionId($qst_id);
   929             $this->objectives_qst_obj->add();
   934         $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'crs_objectives_assigned_lm'));
   936         if ($checked_questions) {
   948         if (!$this->
access->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
   949             $this->ilErr->raiseError($this->
lng->txt(
'permission_denied'), $this->ilErr->WARNING);
   952             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'crs_no_objective_selected'), 
true);
   953             $this->
ctrl->returnToParent($this);
   958         $this->
ctrl->saveParameter($this, 
'objective_id');
   962         $this->
initWizard(self::STEP_FINAL_TEST_LIMIT);
   965         $this->tpl->setContent($this->
form->getHTML());
   970         if (!$this->
access->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
   971             $this->ilErr->raiseError($this->
lng->txt(
'permission_denied'), $this->ilErr->WARNING);
   974             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'crs_no_objective_selected'), 
true);
   975             $this->
ctrl->redirect($this, 
'listObjectives');
   981         if ($this->
http->wrapper()->post()->has(
'limit')) {
   982             $limit = $this->
http->wrapper()->post()->retrieve(
   988         if ($limit < 1 || $limit > 100) {
   989             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'crs_objective_err_limit'));
   994         foreach ($this->objectives_qst_obj->getFinalTests() as $test) {
   996             $this->objectives_qst_obj->setTestSuggestedLimit($limit);
   997             $this->objectives_qst_obj->updateTest($test[
'test_objective_id']);
  1002             $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'), 
true);
  1004             $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'crs_added_objective'), 
true);
  1006         $this->
ctrl->returnToParent($this);
  1011         if (!is_object($this->
form)) {
  1014         $this->
form->setFormAction($this->
ctrl->getFormAction($this));
  1015         $this->
form->setTableWidth(
'100%');
  1021             case 'selfAssessment':
  1022                 $this->
form->setTitle($this->
lng->txt(
'crs_objective_wiz_self_limit'));
  1023                 $this->
form->addCommandButton(
'updateSelfAssessmentLimits', $this->
lng->txt(
'crs_wiz_next'));
  1025                 $tests = $this->objectives_qst_obj->getSelfAssessmentTests();
  1026                 $max_points = $this->objectives_qst_obj->getSelfAssessmentPoints();
  1031                 $this->
form->setTitle($this->
lng->txt(
'crs_objective_wiz_final_limit'));
  1032                 $this->
form->addCommandButton(
'updateFinalTestLimits', $this->
lng->txt(
'crs_wiz_next'));
  1034                 $tests = $this->objectives_qst_obj->getFinalTests();
  1035                 $max_points = $this->objectives_qst_obj->getFinalTestPoints();
  1042         $tpl = 
new ilTemplate(
'tpl.crs_objective_qst_summary.html', 
true, 
true, 
'Modules/Course');
  1046         foreach ($tests as $test) {
  1047             $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ . 
': ' . print_r($test, 
true));
  1049             $limit = $test[
'limit'];
  1051             foreach ($this->objectives_qst_obj->getQuestionsOfTest($test[
'obj_id']) as $question) {
  1052                 $tpl->setCurrentBlock(
'qst');
  1053                 $tpl->setVariable(
'QST_TITLE', $question[
'title']);
  1054                 if (strlen($question[
'description'])) {
  1055                     $tpl->setVariable(
'QST_DESCRIPTION', $question[
'description']);
  1057                 $tpl->setVariable(
'QST_POINTS', $question[
'points'] . 
' ' .
  1058                     $this->
lng->txt(
'crs_objective_points'));
  1059                 $tpl->parseCurrentBlock();
  1061             $tpl->setCurrentBlock(
'tst');
  1064                 $tpl->setVariable(
'TST_DESC', $desc);
  1066             $tpl->setVariable(
'TST_TYPE_IMG', 
ilObject::_getIcon($test[
'obj_id'], 
'tiny', 
'tst'));
  1067             $tpl->setVariable(
'TST_ALT_IMG', $this->
lng->txt(
'obj_tst'));
  1068             $tpl->parseCurrentBlock();
  1071         $tpl->setVariable(
'TXT_ALL_POINTS', $this->
lng->txt(
'crs_objective_all_points'));
  1072         $tpl->setVariable(
'TXT_POINTS', $this->
lng->txt(
'crs_objective_points'));
  1073         $tpl->setVariable(
'POINTS', $max_points);
  1076         $this->
form->addItem($over);
  1080         $req->setValue($limit);
  1082         $req->setMinValue(1);
  1083         $req->setMaxValue(100);
  1084         $req->setRequired(
true);
  1086             case 'selfAssessment':
  1087                 $req->setInfo($this->
lng->txt(
'crs_obj_initial_req_info'));
  1091                 $req->setInfo($this->
lng->txt(
'crs_obj_final_req_info'));
  1101         $this->
form->setFormAction($this->
ctrl->getFormAction($this));
  1106                 $this->
form->setTitle($this->
lng->txt(
'crs_objective_wiz_title'));
  1107                 $this->
form->addCommandButton(
'save', $this->
lng->txt(
'crs_wiz_next'));
  1109                 #$this->form->addCommandButton('listObjectives',$this->lng->txt('cancel'));  1118         $title->setValue($this->objective->getTitle());
  1119         $title->setRequired(
true);
  1120         $title->setSize(40);
  1121         $title->setMaxLength(70);
  1122         $this->
form->addItem($title);
  1125         $desc->
setValue($this->objective->getDescription());
  1128         $this->
form->addItem($desc);
  1135         $step_positions = [];
  1138         $title = $this->
lng->txt(
'crs_objective_wiz_title');
  1139         $link = $this->
ctrl->getLinkTarget($this, 
'edit');
  1141         $steps[] = $this->workflow->step($title, 
"", $link);
  1142         $step_positions[self::STEP_SETTINGS] = count($steps) - 1;
  1145         $title = $this->
lng->txt(
'crs_objective_wiz_materials');
  1146         $link = $this->
ctrl->getLinkTarget($this, 
'materialAssignment');
  1147         $steps[] = $this->workflow->step($title, 
"", $link);
  1148         $step_positions[self::STEP_MATERIAL_ASSIGNMENT] = count($steps) - 1;
  1152             $title = $this->
lng->txt(
'crs_objective_wiz_self');
  1153             $link = $this->
getSettings()->worksWithInitialTest()
  1154                 ? $this->
ctrl->getLinkTarget($this, 
'selfAssessmentAssignment')
  1157             $steps[] = $this->workflow->step($title, 
"", $link)
  1158                                       ->withAvailability($link == null ? Step::NOT_AVAILABLE : Step::AVAILABLE);
  1159             $step_positions[self::STEP_INITIAL_TEST_ASSIGNMENT] = count($steps) - 1;
  1163                 $title = $this->
lng->txt(
'crs_objective_wiz_self_limit');
  1164                 $link = count($this->objectives_qst_obj->getSelfAssessmentQuestions())
  1166                     ? $this->
ctrl->getLinkTarget($this, 
'selfAssessmentLimits')
  1168                 $steps[] = $this->workflow->step($title, 
"", $link)
  1169                                           ->withAvailability($link == null ? Step::NOT_AVAILABLE : Step::AVAILABLE);
  1170                 $step_positions[self::STEP_INITIAL_TEST_LIMIT] = count($steps) - 1;
  1174         if (!$this->
getSettings()->hasSeparateQualifiedTests()) {
  1176             $title = $this->
lng->txt(
'crs_objective_wiz_final');
  1177             $link = $this->
ctrl->getLinkTarget($this, 
'finalTestAssignment');
  1178             $steps[] = $this->workflow->step($title, 
"", $link);
  1179             $step_positions[self::STEP_FINAL_TEST_ASSIGNMENT] = count($steps) - 1;
  1183                 $title = $this->
lng->txt(
'crs_objective_wiz_final_limit');
  1184                 $link = count($this->objectives_qst_obj->getFinalTestQuestions())
  1185                     ? $this->
ctrl->getLinkTarget($this, 
'finalTestLimits')
  1187                 $steps[] = $this->workflow->step($title, 
"", $link)
  1188                                           ->withAvailability($link == null ? Step::NOT_AVAILABLE : Step::AVAILABLE);
  1189                 $step_positions[self::STEP_FINAL_TEST_LIMIT] = count($steps) - 1;
  1193         $list = $this->workflow->linear(
  1194             $this->
lng->txt(
'crs_checklist_objective'),
  1197         if (!empty($step_positions[$active_step])) {
  1198             $list = $list->withActive($step_positions[$active_step]);
  1200         $this->tpl->setRightContent($this->renderer->render($list));
 
setSubTabs(string $a_active="")
 
static lookupLimit(int $a_container_id, int $a_objective_id, int $a_test_type)
 
Interface GlobalHttpState. 
 
static get(string $a_var)
 
selfAssessmentAssignment()
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
initWizard(int $active_step)
 
ilCourseObjective $objectives_obj
 
static _getAssignableTests(int $a_container_ref_id)
 
create(?ilPropertyFormGUI $form=null)
 
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item. 
 
const TYPE_SELF_ASSESSMENT
 
updateMaterialAssignment()
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
updateSelfAssessmentLimits()
 
static _lookupRandomTest($a_obj_id)
Returns the fact wether the test with passed obj id is a random questions test or not...
 
static updateResultLimit(int $a_objective_id, int $a_test_type, int $a_limit)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
const STEP_MATERIAL_ASSIGNMENT
 
const STEP_INITIAL_TEST_ASSIGNMENT
 
getIntArrayFromPost(string $key)
 
static _getObjectiveIds(int $course_id, bool $a_activated_only=false)
 
ilGlobalTemplateInterface $tpl
 
TableGUI for material assignments of course objectives. 
 
initObjectiveIdFromQuery()
 
__initQuestionObject($a_objective_id=0)
 
static _lookupObjId(int $ref_id)
 
catch(\Exception $e) $req
 
setValue(string $a_value)
 
showRandomTestAssignment(ilPropertyFormGUI $form=null)
 
initFormTitle(string $a_mode)
 
updateFinalTestAssignment()
 
class ilCourseObjectiveMaterials 
 
updateSelfAssessmentAssignment()
 
static _updateTestLimits(int $a_objective_id, int $a_status, int $a_limit)
 
static http()
Fetches the global http state from ILIAS. 
 
class ilobjcourseobjectivesgui 
 
static _lookupTitle(int $obj_id)
 
initFormLimits(string $a_mode)
 
ilObjectDataCache $objectDataCache
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id 
 
This is the interface for a workflow factory. 
 
const STEP_INITIAL_TEST_LIMIT
 
static _lookupDescription(int $obj_id)
 
ilCourseObjectiveMaterials $objectives_lm_obj
 
__initObjectivesObject(int $a_id=0)
 
static getInstanceByObjId(int $a_obj_id)
 
ilCourseObjectiveQuestion $objectives_qst_obj
 
isRandomTestType(int $a_tst_type=0)
 
const STEP_FINAL_TEST_LIMIT
 
form( $class_path, string $cmd, string $submit_caption="")
 
edit(?ilPropertyFormGUI $form=null)
 
__construct(int $a_course_id)
 
Error Handling & global info handling. 
 
static lookupSequencesByType(int $a_container_id, int $a_objective_id, int $a_test_id, int $a_test_type)
 
const STEP_FINAL_TEST_ASSIGNMENT
 
This class represents a text area property in a property form. 
 
static _lookupType(int $a_obj_id, int $a_lm_id=0)
 
initObjectiveIdsFromPost()
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins 
 
ilCourseObjective $objective
 
const TYPE_TEST_QUALIFIED
 
static _getAssignableMaterials(int $a_container_id)
Get an array of course material ids that can be assigned to learning objectives No tst...
 
__initLMObject($a_objective_id=0)
 
TableGUI for question assignments of course objectives. 
 
const TYPE_TEST_UNDEFINED
 
ilCourseObjectiveQuestion $questions
 
static deleteForObjectiveAndTestType(int $a_course_id, int $a_objective_id, int $a_tst_type)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static set(string $a_var, $a_val)
Set a value. 
 
getStringArrayFromPost(string $key)