19declare(strict_types=0);
34 private \ILIAS\TestQuestionPool\Questions\PublicInterface
$questioninfo;
39 public function __construct(
object $a_parent_obj,
ilObject $a_course_obj,
int $a_objective_id,
int $a_mode)
43 $this->objective_id = $a_objective_id;
44 $this->course_obj = $a_course_obj;
46 $this->objDefinition =
$DIC[
'objDefinition'];
47 $this->tree =
$DIC->repositoryTree();
48 $this->questioninfo =
$DIC->testQuestion();
51 $this->
lng->loadLanguageModule(
'crs');
54 $this->
addColumn($this->
lng->txt(
'type'),
'type',
"20px");
58 $this->
setRowTemplate(
"tpl.crs_objective_list_questions_row.html",
"components/ILIAS/Course");
64 #$this->setDefaultOrderField('title');
67 $this->mode = $a_mode;
86 protected function fillRow(array $a_set): void
88 foreach ($a_set[
'sub'] as $sub_data) {
89 if ($sub_data[
'description']) {
90 $this->tpl->setVariable(
'QST_DESCRIPTION', $sub_data[
'description']);
92 if ($sub_data[
'qst_txt']) {
93 $txt = $sub_data[
'qst_txt'];
94 if ($sub_data[
'qst_points']) {
95 $this->
lng->loadLanguageModule(
'assessment');
96 $txt .= (
' (' . $sub_data[
'qst_points'] .
' ' . $this->
lng->txt(
'points') .
')');
99 $this->tpl->setVariable(
'QST_DESCRIPTION', $txt);
101 $this->tpl->setCurrentBlock(
'qst');
102 $this->tpl->setVariable(
'QST_TITLE', $sub_data[
'title']);
103 $this->tpl->setVariable(
'QST_ID', $a_set[
'id'] .
'_' . $sub_data[
'id']);
105 switch ($this->mode) {
107 if ($this->objective_qst_obj->isSelfAssessmentQuestion($sub_data[
'id'])) {
108 $this->tpl->setVariable(
'QST_CHECKED',
'checked="checked"');
113 if ($this->objective_qst_obj->isFinalTestQuestion($sub_data[
'id'])) {
114 $this->tpl->setVariable(
'QST_CHECKED',
'checked="checked"');
118 $this->tpl->parseCurrentBlock();
120 if (count($a_set[
'sub'])) {
121 $this->tpl->setVariable(
'TXT_QUESTIONS', $this->
lng->txt(
'objs_qst'));
123 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
125 $this->tpl->setVariable(
'ROW_TYPE_IMG',
ilObject::_getIcon($a_set[
'obj_id'],
"tiny", $a_set[
'type']));
126 $this->tpl->setVariable(
'ROW_TYPE_ALT', $this->
lng->txt(
'obj_' . $a_set[
'type']));
128 $this->tpl->setVariable(
'VAL_TITLE', $a_set[
'title']);
129 if (strlen($a_set[
'description'])) {
130 $this->tpl->setVariable(
'VAL_DESC', $a_set[
'description']);
134 public function parse(array $a_assignable): void
138 foreach ($a_assignable as $node) {
140 $subobjects = array();
146 foreach ($qst = $this->
sortQuestions($tmp_tst->getAllQuestions()) as $question_data) {
148 #$sub['qst_txt'] = $tmp_question->_getQuestionText($question_data['question_id']);
149 $sub[
'qst_txt'] =
'';
150 $sub[
'qst_points'] = $this->questioninfo->getGeneralQuestionProperties($question_data[
'question_id'])->getAvailablePoints();
152 $sub[
'title'] = $tmp_question->getTitle();
153 $sub[
'description'] = $tmp_question->getComment();
154 $sub[
'id'] = $question_data[
'question_id'];
156 $subobjects[] = $sub;
158 $tmp_data[
'title'] = $node[
'title'];
159 $tmp_data[
'description'] = $node[
'description'];
160 $tmp_data[
'type'] = $node[
'type'];
161 $tmp_data[
'id'] = $node[
'child'];
162 $tmp_data[
'obj_id'] = $node[
'obj_id'];
163 $tmp_data[
'sub'] = $subobjects;
164 $tests[] = $tmp_data;
172 $tst_ref_id = $this->
getSettings()->getInitialTest();
174 return array($this->tree->getNodeData($tst_ref_id));
178 $tst_ref_id = $this->
getSettings()->getQualifiedTest();
180 return array($this->tree->getNodeData($tst_ref_id));
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
TableGUI for question assignments of course objectives.
sortQuestions(array $a_qst_ids)
__construct(object $a_parent_obj, ilObject $a_course_obj, int $a_objective_id, int $a_mode)
initQuestionAssignments()
ilObjectDefinition $objDefinition
fillRow(array $a_set)
Standard Version of Fill Row.
parse(array $a_assignable)
ILIAS TestQuestionPool Questions PublicInterface $questioninfo
ilCourseObjectiveQuestion $objective_qst_obj
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const TYPE_SELF_ASSESSMENT
static getInstanceByObjId(int $a_obj_id)
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
parses the objects.xml it handles the xml-description of all ilias objects
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObject Basic functions for all objects.
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLimit(int $a_limit=0, int $a_default_limit=0)
set max.
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setFormName(string $a_name="")
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
disable(string $a_module_name)
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc