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);
34 $next = $questions[$pos + 1];
36 $next = $questions[0];
39 $this->ctrl->setParameter($this,
'q_id', $next);
40 $link = $this->ctrl->getLinkTarget($this,
'edit',
'',
'',
false);
48 $questions = array_keys(
$obj->getQuestionTitlesAndIndexes());
50 $pos = array_search($_REQUEST[
'q_id'], $questions);
53 $next = $questions[$pos - 1];
55 $next = $questions[0];
58 $this->ctrl->setParameter($this,
'q_id', $next);
59 $link = $this->ctrl->getLinkTarget($this,
'edit',
'',
'',
false);
66 parent::__construct($a_id, $a_old_nr);
73 $next_class = $this->ctrl->getNextClass($this);
74 $cmd = $this->ctrl->getCmd();
76 switch ($next_class) {
77 case 'ilobjquestionpoolgui':
79 $nodeParts = explode(
':',
$_GET[
'cmdNode']);
82 'ref_id' =>
$_GET[
'ref_id'],
83 'calling_test' =>
$_GET[
'ref_id'],
84 'q_id' =>
$_GET[
'q_id'],
85 'cmd' =>
$_GET[
'cmd'],
86 'cmdClass' =>
$_GET[
'cmdClass'],
87 'baseClass' =>
'ilObjQuestionPoolGUI',
88 'test_express_mode' =>
'1' 93 '?' . http_build_query(
$params, null,
'&'),
94 'cmdNode=' . ($nodeParts[count($nodeParts) - 2] .
':' . $nodeParts[count($nodeParts) - 1])
100 case "ilpageeditorgui":
104 $ilCtrl->redirect($this,
"preview");
108 $page_editor->setLocator($this->locator);
109 $page_editor->setHeader($this->
getHeader());
110 $page_editor->setPageBackTitle($this->page_back_title);
111 $page_editor->setIntLinkReturn($this->int_link_return);
113 $this->ctrl->saveParameterByClass(
'ilpageeditorgui',
'q_mode');
115 $ret = &$this->ctrl->forwardCommand($page_editor);
120 case 'iltestexpresspageobjectgui':
122 include_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
124 if ($cmd ==
'view') {
126 $ilCtrl->setCmd($cmd);
131 if ($q_gui->object) {
133 $q_gui->object->setObjId(
$obj->getId());
137 'handleToolbarCommand',
141 'browseForQuestions',
142 'filterAvailableQuestions',
143 'resetfilterAvailableQuestions' 146 if (in_array($cmd, $cmds)) {
147 return $this->$cmd();
148 } elseif ($q_gui->object) {
149 $total = $this->test_object->evalTotalPersons();
154 $link = $ilCtrl->getLinkTargetByClass(
'ilobjtestgui',
"participants");
155 $link =
"<a href=\"" . $link .
"\">" . $lng->txt(
"test_has_datasets_warning_page_view_link") .
"</a>";
156 ilUtil::sendInfo($lng->txt(
"test_has_datasets_warning_page_view") .
" " . $link);
159 if ((in_array($cmd,
array(
'view',
'showPage')) || $cmd ==
'edit') && $this->test_object->evalTotalPersons()) {
163 return parent::executeCommand();
171 if (!
$_GET[
'q_id']) {
173 $q_gui->setQuestionTabs();
175 $this->ctrl->forwardCommand($q_gui);
179 $this->ctrl->setReturn($this,
"questions");
181 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
183 if ($q_gui->object) {
185 $q_gui->object->setObjId(
$obj->getId());
188 $this->ctrl->saveParameterByClass(
'ilpageeditorgui',
'q_id');
189 $this->ctrl->saveParameterByClass(
'ilpageeditorgui',
'q_mode');
191 $q_gui->setQuestionTabs();
192 $this->ctrl->forwardCommand($q_gui);
202 $qtype = $_REQUEST[
'qtype'];
207 $this->ctrl->setReturn($this,
"questions");
209 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
214 $q_gui->object->setObjId(
$obj->getId());
223 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
225 if ($_REQUEST[
'qtype']) {
226 include_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
228 } elseif ($_REQUEST[
'sel_question_types']) {
229 $questionType = $_REQUEST[
'sel_question_types'];
232 include_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
234 $addContEditMode = $_REQUEST[
'add_quest_cont_edit_mode'];
242 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
244 $q_gui->object->createNewQuestion();
246 $previousQuestionId = $_REQUEST[
'position'];
248 switch ($_REQUEST[
'usage']) {
251 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'sel_qpl', $_REQUEST[
'sel_qpl']);
252 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'sel_question_types', $questionType);
253 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'q_id', $q_gui->object->getId());
254 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'prev_qid', $previousQuestionId);
256 if ($_REQUEST[
'test_express_mode']) {
257 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'test_express_mode', 1);
260 if (isset($_REQUEST[
'add_quest_cont_edit_mode'])) {
261 $ilCtrl->setParameterByClass(
263 'add_quest_cont_edit_mode',
264 $_REQUEST[
'add_quest_cont_edit_mode']
268 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'usage', 3);
269 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'calling_test', $this->test_object->getId());
271 $link = $ilCtrl->getLinkTargetByClass(
'ilobjtestgui',
'executeCreateQuestion',
false,
false,
false);
279 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'txt_qpl', $_REQUEST[
'txt_qpl']);
280 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'sel_question_types', $questionType);
281 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'q_id', $q_gui->object->getId());
282 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'prev_qid', $previousQuestionId);
284 if ($_REQUEST[
'test_express_mode']) {
285 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'test_express_mode', 1);
288 if (isset($_REQUEST[
'add_quest_cont_edit_mode'])) {
289 $ilCtrl->setParameterByClass(
291 'add_quest_cont_edit_mode',
292 $_REQUEST[
'add_quest_cont_edit_mode']
296 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'usage', 2);
297 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'calling_test', $this->test_object->getId());
299 $link = $ilCtrl->getLinkTargetByClass(
'ilobjtestgui',
'executeCreateQuestion',
false,
false,
false);
317 $ilHelp = $DIC[
'ilHelp'];
319 $subScreenId =
array(
'createQuestion');
321 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
323 $ilCtrl->setParameter($this,
'qtype', $_REQUEST[
'qtype']);
327 $ilCtrl->setParameter($this,
'test_express_mode', 1);
329 $form->setFormAction($ilCtrl->getFormAction($this,
"handleToolbarCommand"));
330 $form->setTitle($lng->txt(
"ass_create_question"));
331 include_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
334 $questionTypes = $pool->getQuestionTypes(
false,
true);
338 foreach ($questionTypes as $label =>
$data) {
342 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
348 $questions = $this->test_object->getQuestionTitlesAndIndexes();
353 $options[
$key] = $lng->txt(
'behind') .
' ' .
$title .
' [' . $this->lng->txt(
'question_id_short') .
': ' .
$key .
']';
355 $si->setOptions($options);
356 $si->setValue($_REQUEST[
'q_id']);
362 $subScreenId[] =
'editMode';
364 $ri =
new ilRadioGroupInputGUI($lng->txt(
"tst_add_quest_cont_edit_mode"),
"add_quest_cont_edit_mode");
367 $lng->txt(
'tst_add_quest_cont_edit_mode_default'),
372 $lng->txt(
'tst_add_quest_cont_edit_mode_page_object'),
378 $form->addItem($ri,
true);
382 $form->addItem($hi,
true);
385 if ($this->test_object->getPoolUsage()) {
386 $subScreenId[] =
'poolSelect';
391 $no_pool =
new ilRadioOption($this->lng->txt(
"assessment_no_pool"), 1);
392 $usage->addOption($no_pool);
393 $existing_pool =
new ilRadioOption($this->lng->txt(
"assessment_existing_pool"), 3);
394 $usage->addOption($existing_pool);
395 $new_pool =
new ilRadioOption($this->lng->txt(
"assessment_new_pool"), 2);
396 $usage->addOption($new_pool);
397 $form->addItem($usage);
402 $pools_data =
array();
403 foreach ($questionpools as
$key => $p) {
404 $pools_data[
$key] = $p[
'title'];
406 $pools =
new ilSelectInputGUI($this->lng->txt(
"select_questionpool"),
"sel_qpl");
408 $existing_pool->addSubItem($pools);
412 $name->setMaxLength(50);
413 $new_pool->addSubItem(
$name);
416 $form->addCommandButton(
"handleToolbarCommand", $lng->txt(
"create"));
417 $form->addCommandButton(
"questions", $lng->txt(
"cancel"));
419 $ilHelp->setSubScreenId(implode(
'_', $subScreenId));
421 return $tpl->setContent(
$form->getHTML());
428 $ilCtrl->saveParameterByClass(
'ilobjtestgui',
'q_id');
430 $ilCtrl->redirectByClass(
'ilobjtestgui',
'showPage');
435 $cmdClass = $questionType .
'GUI';
437 $this->ctrl->setParameterByClass($cmdClass,
'ref_id',
$_GET[
'ref_id']);
438 $this->ctrl->setParameterByClass($cmdClass,
'sel_question_types', $questionType);
439 $this->ctrl->setParameterByClass($cmdClass,
'test_ref_id',
$_GET[
'ref_id']);
440 $this->ctrl->setParameterByClass($cmdClass,
'calling_test',
$_GET[
'ref_id']);
441 $this->ctrl->setParameterByClass($cmdClass,
'q_id', $qid);
442 $this->ctrl->setParameterByClass($cmdClass,
'prev_qid', $prev_qid);
444 if ($_REQUEST[
'test_express_mode']) {
445 $this->ctrl->setParameterByClass($cmdClass,
'test_express_mode', 1);
448 $this->ctrl->redirectByClass(
449 array(
'ilRepositoryGUI',
'ilObjTestGUI', $questionType .
"GUI"),
456 $this->ctrl->setParameterByClass(
'ilObjTestGUI',
'ref_id', $_REQUEST[
'ref_id']);
457 $this->ctrl->setParameterByClass(
'ilObjTestGUI',
'q_id', $qid);
458 $this->ctrl->setParameterByClass(
'ilObjTestGUI',
'sel_question_types', $questionType);
459 $this->ctrl->setParameterByClass(
'ilObjTestGUI',
'prev_qid', $prev_qid);
460 $redir = $this->ctrl->getLinkTargetByClass(
'ilObjTestGUI',
'createQuestion',
'',
false,
false);
468 if (!count($selected_array)) {
470 $this->ctrl->redirect($this,
"browseForQuestions");
472 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
475 global $tree,
$ilDB, $ilPluginAdmin;
477 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
479 $testQuestionSetConfig = $testQuestionSetConfigFactory->getQuestionSetConfig();
481 foreach ($selected_array as
$key => $value) {
482 $last_question_id = $this->test_object->insertQuestion($testQuestionSetConfig, $value);
488 $this->test_object->saveCompleteStatus($testQuestionSetConfig);
495 $this->ctrl->setParameter($this,
'q_id', $last_question_id);
496 $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.
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.
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
if(isset($_POST['submit'])) $form
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.
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)
ilTestExpressPageObjectGUI: assMultipleChoiceGUI, assClozeTestGUI, assMatchingQuestionGUI ilTestExpr...
setOutputMode($a_mode=IL_PAGE_PRESENTATION)
Set Output Mode.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options