24 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
25 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
27 include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
58 public function __construct($a_parent_obj, $a_course_obj, $a_objective_id, $a_mode)
62 $this->objective_id = $a_objective_id;
63 $this->course_obj = $a_course_obj;
70 $this->lng->loadLanguageModule(
'crs');
73 parent::__construct($a_parent_obj,
'materialAssignment');
75 $this->
addColumn($this->lng->txt(
'type'),
'type',
"20px");
76 $this->
addColumn($this->lng->txt(
'title'),
'title',
'');
78 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
79 $this->
setRowTemplate(
"tpl.crs_objective_list_questions_row.html",
"Modules/Course");
85 #$this->setDefaultOrderField('title'); 88 $this->mode = $a_mode;
91 $this->
addCommandButton(
'updateSelfAssessmentAssignment', $this->lng->txt(
'crs_wiz_next'));
92 $this->
addCommandButton(
'materialAssignment', $this->lng->txt(
'crs_wiz_back'));
96 $this->
addCommandButton(
'updateFinalTestAssignment', $this->lng->txt(
'crs_wiz_next'));
97 $this->
addCommandButton(
'selfAssessmentAssignment', $this->lng->txt(
'crs_wiz_back'));
124 foreach ($a_set[
'sub'] as $sub_data) {
125 if ($a_set[
'random']) {
130 if ($sub_data[
'description']) {
131 $this->tpl->setVariable(
'QST_DESCRIPTION', $sub_data[
'description']);
133 if ($sub_data[
'qst_txt']) {
134 $txt = $sub_data[
'qst_txt'];
135 if ($sub_data[
'qst_points']) {
136 $this->lng->loadLanguageModule(
'assessment');
137 $txt .= (
' (' . $sub_data[
'qst_points'] .
' ' . $this->lng->txt(
'points') .
')');
140 $this->tpl->setVariable(
'QST_DESCRIPTION',
$txt);
142 $this->tpl->setCurrentBlock(
'qst');
143 $this->tpl->setVariable(
'QST_TITLE', $sub_data[
'title']);
144 $this->tpl->setVariable(
'QST_ID', $a_set[
'id'] .
'_' . $sub_data[
'id']);
146 switch ($this->mode) {
148 if ($this->objective_qst_obj->isSelfAssessmentQuestion($sub_data[
'id'])) {
149 $this->tpl->setVariable(
'QST_CHECKED',
'checked="checked"');
154 if ($this->objective_qst_obj->isFinalTestQuestion($sub_data[
'id'])) {
155 $this->tpl->setVariable(
'QST_CHECKED',
'checked="checked"');
159 $this->tpl->parseCurrentBlock();
161 if (count($a_set[
'sub']) and !$a_set[
'random']) {
162 $this->tpl->setVariable(
'TXT_QUESTIONS', $this->lng->txt(
'objs_qst'));
164 if ($a_set[
'random']) {
165 $this->tpl->setVariable(
'VAL_WARN', $this->lng->txt(
'crs_objective_random_warn'));
168 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
170 $this->tpl->setVariable(
'ROW_TYPE_IMG',
ilObject::_getIcon($a_set[
'obj_id'],
"tiny", $a_set[
'type']));
171 $this->tpl->setVariable(
'ROW_TYPE_ALT', $this->lng->txt(
'obj_' . $a_set[
'type']));
173 $this->tpl->setVariable(
'VAL_TITLE', $a_set[
'title']);
174 if (strlen($a_set[
'description'])) {
175 $this->tpl->setVariable(
'VAL_DESC', $a_set[
'description']);
186 public function parse($a_assignable)
188 global $objDefinition;
195 foreach ($a_assignable as $node) {
197 $subobjects =
array();
203 include_once
'./Modules/Test/classes/class.ilObjTest.php';
205 $tmp_data[
'random'] =
false;
207 foreach ($qst = $this->
sortQuestions($tmp_tst->getAllQuestions()) as $question_data) {
209 #$sub['qst_txt'] = $tmp_question->_getQuestionText($question_data['question_id']); 210 $sub[
'qst_txt'] =
'';
213 $sub[
'title'] = $tmp_question->getTitle();
214 $sub[
'description'] = $tmp_question->getComment();
215 $sub[
'id'] = $question_data[
'question_id'];
217 $subobjects[] = $sub;
219 $tmp_data[
'title'] = $node[
'title'];
220 $tmp_data[
'description'] = $node[
'description'];
221 $tmp_data[
'type'] = $node[
'type'];
222 $tmp_data[
'id'] = $node[
'child'];
223 $tmp_data[
'obj_id'] = $node[
'obj_id'];
224 $tmp_data[
'sub'] = $subobjects;
226 $tests[] = $tmp_data;
235 $tst_ref_id = $this->
getSettings()->getInitialTest();
241 $tst_ref_id = $this->
getSettings()->getQualifiedTest();
258 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static getInstanceByObjId($a_obj_id)
get singleton instance
const TYPE_SELF_ASSESSMENT
static _lookupRandomTest($a_obj_id)
Returns the fact wether the test with passed obj id is a random questions test or not...
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
sortQuestions($a_qst_ids)
Sort questions.
static _getMaximumPoints($question_id)
Returns the maximum points, a learner can reach answering the question.
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
getSettings()
Get settings.
initQuestionAssignments()
init objective assignments
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
setFormName($a_formname="")
Set Form name.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
TableGUI for question assignments of course objectives.
class ilcourseobjectiveQuestion
parse($a_assignable)
parse
__construct($a_parent_obj, $a_course_obj, $a_objective_id, $a_mode)
Constructor.
setLimit($a_limit=0, $a_default_limit=0)