4 include_once
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
5 include_once
'Modules/Test/classes/class.ilTestExpressPage.php';
29 $questions = array_keys(
$obj->getQuestionTitlesAndIndexes());
31 $pos = array_search($_REQUEST[
'q_id'], $questions);
35 $next = $questions[$pos + 1];
39 $next = $questions[0];
42 $this->ctrl->setParameter($this,
'q_id', $next);
43 $link = $this->ctrl->getLinkTarget($this,
'edit',
'',
'',
false);
51 $questions = array_keys(
$obj->getQuestionTitlesAndIndexes());
53 $pos = array_search($_REQUEST[
'q_id'], $questions);
57 $next = $questions[$pos - 1];
61 $next = $questions[0];
64 $this->ctrl->setParameter($this,
'q_id', $next);
65 $link = $this->ctrl->getLinkTarget($this,
'edit',
'',
'',
false);
71 parent::__construct($a_id, $a_old_nr);
78 $next_class = $this->ctrl->getNextClass($this);
79 $cmd = $this->ctrl->getCmd();
83 case 'ilobjquestionpoolgui':
85 $nodeParts = explode(
':',
$_GET[
'cmdNode']);
88 'ref_id' =>
$_GET[
'ref_id'],
89 'calling_test' =>
$_GET[
'ref_id'],
90 'q_id' =>
$_GET[
'q_id'],
91 'cmd' =>
$_GET[
'cmd'],
92 'cmdClass' =>
$_GET[
'cmdClass'],
93 'baseClass' =>
'ilObjQuestionPoolGUI',
94 'test_express_mode' =>
'1' 99 '?' . http_build_query(
$params, null,
'&'),
100 'cmdNode=' . ($nodeParts[count($nodeParts) - 2] .
':' . $nodeParts[count($nodeParts) - 1])
106 case "ilpageeditorgui":
111 $ilCtrl->redirect($this,
"preview");
115 $page_editor->setLocator($this->locator);
116 $page_editor->setHeader($this->
getHeader());
117 $page_editor->setPageBackTitle($this->page_back_title);
118 $page_editor->setIntLinkReturn($this->int_link_return);
120 $this->ctrl->saveParameterByClass(
'ilpageeditorgui',
'q_mode');
122 $ret = & $this->ctrl->forwardCommand($page_editor);
127 case 'iltestexpresspageobjectgui':
129 include_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
134 $ilCtrl->setCmd(
$cmd);
142 $q_gui->object->setObjId(
$obj->getId());
146 'handleToolbarCommand',
150 'browseForQuestions',
151 'filterAvailableQuestions',
152 'resetfilterAvailableQuestions' 155 if( in_array(
$cmd, $cmds) )
157 return $this->
$cmd();
159 elseif( $q_gui->object )
161 $total = $this->test_object->evalTotalPersons();
167 $link = $ilCtrl->getLinkTargetByClass(
'ilobjtestgui',
"participants");
168 $link =
"<a href=\"".$link.
"\">".$lng->txt(
"test_has_datasets_warning_page_view_link").
"</a>";
169 ilUtil::sendInfo($lng->txt(
"test_has_datasets_warning_page_view").
" ".$link);
172 if( (in_array(
$cmd,
array(
'view',
'showPage')) ||
$cmd ==
'edit') && $this->test_object->evalTotalPersons() )
177 return parent::executeCommand();
188 $q_gui->setQuestionTabs();
190 $this->ctrl->forwardCommand($q_gui);
194 $this->ctrl->setReturn($this,
"questions");
196 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
201 $q_gui->object->setObjId(
$obj->getId());
204 $this->ctrl->saveParameterByClass(
'ilpageeditorgui',
'q_id');
205 $this->ctrl->saveParameterByClass(
'ilpageeditorgui',
'q_mode');
207 $q_gui->setQuestionTabs();
208 $this->ctrl->forwardCommand($q_gui);
219 $qtype = $_REQUEST[
'qtype'];
224 $this->ctrl->setReturn($this,
"questions");
226 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
231 $q_gui->object->setObjId(
$obj->getId());
240 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
242 if( $_REQUEST[
'qtype'] )
244 include_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
247 elseif( $_REQUEST[
'sel_question_types'] )
249 $questionType = $_REQUEST[
'sel_question_types'];
252 include_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
255 $addContEditMode = $_REQUEST[
'add_quest_cont_edit_mode'];
265 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
267 $q_gui->object->createNewQuestion();
269 $previousQuestionId = $_REQUEST[
'position'];
271 switch( $_REQUEST[
'usage'] )
275 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'sel_qpl', $_REQUEST[
'sel_qpl']);
276 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'sel_question_types', $questionType);
277 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'q_id', $q_gui->object->getId());
278 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'prev_qid', $previousQuestionId);
280 if ($_REQUEST[
'test_express_mode'])
282 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'test_express_mode', 1);
285 if( isset($_REQUEST[
'add_quest_cont_edit_mode']) )
287 $ilCtrl->setParameterByClass(
288 'ilobjtestgui',
'add_quest_cont_edit_mode', $_REQUEST[
'add_quest_cont_edit_mode']
292 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'usage', 3);
293 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'calling_test', $this->test_object->getId());
295 $link = $ilCtrl->getLinkTargetByClass(
'ilobjtestgui',
'executeCreateQuestion',
false,
false,
false);
303 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'txt_qpl', $_REQUEST[
'txt_qpl']);
304 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'sel_question_types', $questionType);
305 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'q_id', $q_gui->object->getId());
306 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'prev_qid', $previousQuestionId);
308 if ($_REQUEST[
'test_express_mode'])
310 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'test_express_mode', 1);
313 if( isset($_REQUEST[
'add_quest_cont_edit_mode']) )
315 $ilCtrl->setParameterByClass(
316 'ilobjtestgui',
'add_quest_cont_edit_mode', $_REQUEST[
'add_quest_cont_edit_mode']
320 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'usage', 2);
321 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'calling_test', $this->test_object->getId());
323 $link = $ilCtrl->getLinkTargetByClass(
'ilobjtestgui',
'executeCreateQuestion',
false,
false,
false);
341 $ilHelp = $DIC[
'ilHelp'];
343 $subScreenId =
array(
'createQuestion');
345 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
347 $ilCtrl->setParameter($this,
'qtype', $_REQUEST[
'qtype']);
351 $ilCtrl->setParameter($this,
'test_express_mode', 1);
353 $form->setFormAction($ilCtrl->getFormAction($this,
"handleToolbarCommand"));
354 $form->setTitle($lng->txt(
"ass_create_question"));
355 include_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
358 $questionTypes = $pool->getQuestionTypes(
false,
true);
362 foreach($questionTypes as $label =>
$data)
367 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
370 $form->addItem(
$si,
true);
373 $questions = $this->test_object->getQuestionTitlesAndIndexes();
378 foreach($questions as $key =>
$title)
380 $options[$key] = $lng->txt(
'behind') .
' '.
$title .
' ['.$this->lng->txt(
'question_id_short') .
': '. $key .
']';
382 $si->setOptions($options);
383 $si->setValue($_REQUEST[
'q_id']);
384 $form->addItem(
$si,
true);
390 $subScreenId[] =
'editMode';
392 $ri =
new ilRadioGroupInputGUI($lng->txt(
"tst_add_quest_cont_edit_mode"),
"add_quest_cont_edit_mode");
395 $lng->txt(
'tst_add_quest_cont_edit_mode_default'),
400 $lng->txt(
'tst_add_quest_cont_edit_mode_page_object'),
406 $form->addItem($ri,
true);
412 $form->addItem($hi,
true);
415 if($this->test_object->getPoolUsage())
417 $subScreenId[] =
'poolSelect';
422 $no_pool =
new ilRadioOption($this->lng->txt(
"assessment_no_pool"), 1);
423 $usage->addOption($no_pool);
424 $existing_pool =
new ilRadioOption($this->lng->txt(
"assessment_existing_pool"), 3);
425 $usage->addOption($existing_pool);
426 $new_pool =
new ilRadioOption($this->lng->txt(
"assessment_new_pool"), 2);
427 $usage->addOption($new_pool);
428 $form->addItem($usage);
433 $pools_data =
array();
434 foreach($questionpools as $key => $p)
436 $pools_data[$key] = $p[
'title'];
438 $pools =
new ilSelectInputGUI($this->lng->txt(
"select_questionpool"),
"sel_qpl");
440 $existing_pool->addSubItem($pools);
444 $name->setMaxLength(50);
445 $new_pool->addSubItem($name);
448 $form->addCommandButton(
"handleToolbarCommand", $lng->txt(
"create"));
449 $form->addCommandButton(
"questions", $lng->txt(
"cancel"));
451 $ilHelp->setSubScreenId(implode(
'_', $subScreenId));
453 return $tpl->setContent($form->getHTML());
460 $ilCtrl->saveParameterByClass(
'ilobjtestgui',
'q_id');
462 $ilCtrl->redirectByClass(
'ilobjtestgui',
'showPage');
467 $cmdClass = $questionType.
'GUI';
469 $this->ctrl->setParameterByClass($cmdClass,
'ref_id',
$_GET[
'ref_id']);
470 $this->ctrl->setParameterByClass($cmdClass,
'sel_question_types', $questionType);
471 $this->ctrl->setParameterByClass($cmdClass,
'test_ref_id',
$_GET[
'ref_id']);
472 $this->ctrl->setParameterByClass($cmdClass,
'calling_test',
$_GET[
'ref_id']);
473 $this->ctrl->setParameterByClass($cmdClass,
'q_id', $qid);
474 $this->ctrl->setParameterByClass($cmdClass,
'prev_qid', $prev_qid);
476 if ($_REQUEST[
'test_express_mode'])
478 $this->ctrl->setParameterByClass($cmdClass,
'test_express_mode', 1);
481 $this->ctrl->redirectByClass(
482 array(
'ilRepositoryGUI',
'ilObjTestGUI', $questionType.
"GUI"),
'editQuestion' 488 $this->ctrl->setParameterByClass(
'ilObjTestGUI',
'ref_id', $_REQUEST[
'ref_id']);
489 $this->ctrl->setParameterByClass(
'ilObjTestGUI',
'q_id', $qid);
490 $this->ctrl->setParameterByClass(
'ilObjTestGUI',
'sel_question_types', $questionType);
491 $this->ctrl->setParameterByClass(
'ilObjTestGUI',
'prev_qid', $prev_qid);
492 $redir = $this->ctrl->getLinkTargetByClass(
'ilObjTestGUI',
'createQuestion',
'',
false,
false);
500 if (!count($selected_array))
503 $this->ctrl->redirect($this,
"browseForQuestions");
507 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
510 global $tree,
$ilDB, $ilPluginAdmin;
512 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
514 $testQuestionSetConfig = $testQuestionSetConfigFactory->getQuestionSetConfig();
516 foreach ($selected_array as $key => $value)
518 $last_question_id = $this->test_object->insertQuestion( $testQuestionSetConfig, $value );
525 $this->test_object->saveCompleteStatus( $testQuestionSetConfig );
535 $this->ctrl->setParameter($this,
'q_id', $last_question_id);
536 $this->ctrl->redirect($this,
"showPage");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
This class represents an option in a radio group.
getPageObject()
Get Page Object.
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
static _needsManualScoring($question_id)
static getQuestionTypeByTypeId($type_id)
addPageOfQuestions($type='')
static _lookupObjectId($a_ref_id)
lookup object id
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
setValue($a_value)
Set Value.
if(!is_array($argv)) $options
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
getEnableEditing()
Get Enable Editing.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
__construct($a_id=0, $a_old_nr=0)
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
redirectToQuestionEditPage($questionType, $qid, $prev_qid)
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
redirectToQuestionPoolSelectionPage($questionType, $qid, $prev_qid)
static redirect($a_script)
http redirect to other script
ilTestExpressPageObjectGUI: assMultipleChoiceGUI, assClozeTestGUI, assMatchingQuestionGUI ilTestExpr...
static _getAvailableQuestionpools($use_object_id=FALSE, $equal_points=FALSE, $could_be_offline=FALSE, $showPath=FALSE, $with_questioncount=FALSE, $permission="read", $usr_id="")
Returns the available question pools for the active user.
setOutputMode($a_mode=IL_PAGE_PRESENTATION)
Set Output Mode.