4include_once 
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
 
    5include_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);
 
   72        $ilCtrl = 
$DIC[
'ilCtrl'];
 
   73        $ilTabs = 
$DIC[
'ilTabs'];
 
   77        $next_class = $this->ctrl->getNextClass($this);
 
   78        $cmd = $this->ctrl->getCmd();
 
   80        switch ($next_class) {
 
   81            case 'ilobjquestionpoolgui':
 
   83                $nodeParts = explode(
':', 
$_GET[
'cmdNode']);
 
   86                    'ref_id' => 
$_GET[
'ref_id'],
 
   87                    'calling_test' => 
$_GET[
'ref_id'],
 
   88                    'q_id' => 
$_GET[
'q_id'],
 
   89                    'cmd' => 
$_GET[
'cmd'],
 
   90                    'cmdClass' => 
$_GET[
'cmdClass'],
 
   91                    'baseClass' => 
'ilObjQuestionPoolGUI',
 
   92                    'test_express_mode' => 
'1' 
   97                        '?' . http_build_query($params, 
null, 
'&'),
 
   98                        'cmdNode=' . ($nodeParts[count($nodeParts) - 2] . 
':' . $nodeParts[count($nodeParts) - 1])
 
  104            case "ilpageeditorgui":
 
  108                    $ilCtrl->redirect($this, 
"preview");
 
  112                $page_editor->setLocator($this->locator);
 
  113                $page_editor->setHeader($this->
getHeader());
 
  114                $page_editor->setPageBackTitle($this->page_back_title);
 
  115                $page_editor->setIntLinkReturn($this->int_link_return);
 
  117                $this->ctrl->saveParameterByClass(
'ilpageeditorgui', 
'q_mode');
 
  119                $ret = $this->ctrl->forwardCommand($page_editor);
 
  121                    $this->tpl->setContent(
$ret);
 
  126            case 'iltestexpresspageobjectgui':
 
  128                include_once 
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
 
  130                if ($cmd == 
'view') {
 
  132                    $ilCtrl->setCmd($cmd);
 
  137                if ($q_gui->object) {
 
  139                    $q_gui->object->setObjId(
$obj->getId());
 
  143                    'handleToolbarCommand',
 
  147                    'browseForQuestions',
 
  148                    'filterAvailableQuestions',
 
  149                    'resetfilterAvailableQuestions' 
  152                if (in_array($cmd, $cmds)) {
 
  153                    return $this->$cmd();
 
  154                } elseif ($q_gui->object) {
 
  155                    $total = $this->test_object->evalTotalPersons();
 
  160                        $link = 
$DIC->ui()->factory()->link()->standard(
 
  161                            $DIC->language()->txt(
"test_has_datasets_warning_page_view_link"),
 
  162                            $DIC->ctrl()->getLinkTargetByClass(array(
'ilTestResultsGUI', 
'ilParticipantsTestResultsGUI'))
 
  165                        $message = 
$DIC->language()->txt(
"test_has_datasets_warning_page_view");
 
  167                        $msgBox = 
$DIC->ui()->factory()->messageBox()->info(
$message)->withLinks(array($link));
 
  169                        $DIC->ui()->mainTemplate()->setCurrentBlock(
'mess');
 
  170                        $DIC->ui()->mainTemplate()->setVariable(
 
  172                            $DIC->ui()->renderer()->render($msgBox)
 
  174                        $DIC->ui()->mainTemplate()->parseCurrentBlock();
 
  177                    if ((in_array($cmd, array(
'view', 
'showPage')) || $cmd == 
'edit') && $this->test_object->evalTotalPersons()) {
 
  181                    return parent::executeCommand();
 
  189                if (!
$_GET[
'q_id']) {
 
  191                    $q_gui->setQuestionTabs();
 
  193                    $this->ctrl->forwardCommand($q_gui);
 
  197                $this->ctrl->setReturn($this, 
"questions");
 
  199                require_once 
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
 
  201                if ($q_gui->object) {
 
  203                    $q_gui->object->setObjId(
$obj->getId());
 
  206                $this->ctrl->saveParameterByClass(
'ilpageeditorgui', 
'q_id');
 
  207                $this->ctrl->saveParameterByClass(
'ilpageeditorgui', 
'q_mode');
 
  209                $q_gui->setQuestionTabs();
 
  210                $this->ctrl->forwardCommand($q_gui);
 
  218        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  221            $qtype = $_REQUEST[
'qtype'];
 
  226        $this->ctrl->setReturn($this, 
"questions");
 
  228        include_once 
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
 
  233        $q_gui->object->setObjId(
$obj->getId());
 
  241        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  243        include_once 
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
 
  245        if ($_REQUEST[
'qtype']) {
 
  246            include_once 
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
 
  248        } elseif ($_REQUEST[
'sel_question_types']) {
 
  249            $questionType = $_REQUEST[
'sel_question_types'];
 
  252        include_once 
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
 
  254            $addContEditMode = $_REQUEST[
'add_quest_cont_edit_mode'];
 
  262        $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
 
  264        $q_gui->object->createNewQuestion();
 
  266        $previousQuestionId = $_REQUEST[
'position'];
 
  268        switch ($_REQUEST[
'usage']) {
 
  271                $ilCtrl->setParameterByClass(
'ilobjtestgui', 
'sel_qpl', $_REQUEST[
'sel_qpl']);
 
  272                $ilCtrl->setParameterByClass(
'ilobjtestgui', 
'sel_question_types', $questionType);
 
  273                $ilCtrl->setParameterByClass(
'ilobjtestgui', 
'q_id', $q_gui->object->getId());
 
  274                $ilCtrl->setParameterByClass(
'ilobjtestgui', 
'prev_qid', $previousQuestionId);
 
  276                if ($_REQUEST[
'test_express_mode']) {
 
  277                    $ilCtrl->setParameterByClass(
'ilobjtestgui', 
'test_express_mode', 1);
 
  280                if (isset($_REQUEST[
'add_quest_cont_edit_mode'])) {
 
  281                    $ilCtrl->setParameterByClass(
 
  283                        'add_quest_cont_edit_mode',
 
  284                        $_REQUEST[
'add_quest_cont_edit_mode']
 
  288                $ilCtrl->setParameterByClass(
'ilobjtestgui', 
'usage', 3);
 
  289                $ilCtrl->setParameterByClass(
'ilobjtestgui', 
'calling_test', $this->test_object->getId());
 
  291                $link = $ilCtrl->getLinkTargetByClass(
'ilobjtestgui', 
'executeCreateQuestion', 
false, 
false, 
false);
 
  299                $ilCtrl->setParameterByClass(
'ilobjtestgui', 
'txt_qpl', $_REQUEST[
'txt_qpl']);
 
  300                $ilCtrl->setParameterByClass(
'ilobjtestgui', 
'sel_question_types', $questionType);
 
  301                $ilCtrl->setParameterByClass(
'ilobjtestgui', 
'q_id', $q_gui->object->getId());
 
  302                $ilCtrl->setParameterByClass(
'ilobjtestgui', 
'prev_qid', $previousQuestionId);
 
  304                if ($_REQUEST[
'test_express_mode']) {
 
  305                    $ilCtrl->setParameterByClass(
'ilobjtestgui', 
'test_express_mode', 1);
 
  308                if (isset($_REQUEST[
'add_quest_cont_edit_mode'])) {
 
  309                    $ilCtrl->setParameterByClass(
 
  311                        'add_quest_cont_edit_mode',
 
  312                        $_REQUEST[
'add_quest_cont_edit_mode']
 
  316                $ilCtrl->setParameterByClass(
'ilobjtestgui', 
'usage', 2);
 
  317                $ilCtrl->setParameterByClass(
'ilobjtestgui', 
'calling_test', $this->test_object->getId());
 
  319                $link = $ilCtrl->getLinkTargetByClass(
'ilobjtestgui', 
'executeCreateQuestion', 
false, 
false, 
false);
 
  337        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  340        $ilHelp = 
$DIC[
'ilHelp']; 
 
  342        $subScreenId = array(
'createQuestion');
 
  344        include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
  346        $ilCtrl->setParameter($this, 
'qtype', $_REQUEST[
'qtype']);
 
  350        $ilCtrl->setParameter($this, 
'test_express_mode', 1);
 
  352        $form->setFormAction($ilCtrl->getFormAction($this, 
"handleToolbarCommand"));
 
  353        $form->setTitle(
$lng->txt(
"ass_create_question"));
 
  354        include_once 
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
 
  357        $questionTypes = $pool->getQuestionTypes(
false, 
true, 
false);
 
  361        foreach ($questionTypes as $label => 
$data) {
 
  362            $options[
$data[
'question_type_id']] = $label;
 
  365        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
  367        $si->setOptions($options);
 
  368        $form->addItem(
$si, 
true);
 
  371        $questions = $this->test_object->getQuestionTitlesAndIndexes();
 
  374            $options = array(
'0' => 
$lng->txt(
'first'));
 
  375            foreach ($questions as $key => $title) {
 
  376                $options[$key] = 
$lng->txt(
'behind') . 
' ' . $title . 
' [' . $this->lng->txt(
'question_id_short') . 
': ' . $key . 
']';
 
  378            $si->setOptions($options);
 
  379            $si->setValue($_REQUEST[
'q_id']);
 
  380            $form->addItem(
$si, 
true);
 
  385            $subScreenId[] = 
'editMode';
 
  390                $lng->txt(
'tst_add_quest_cont_edit_mode_IPE'),
 
  393            $option_ipe->setInfo(
$lng->txt(
'tst_add_quest_cont_edit_mode_IPE_info'));
 
  394            $ri->addOption($option_ipe);
 
  397                $lng->txt(
'tst_add_quest_cont_edit_mode_RTE'),
 
  400            $option_rte->setInfo(
$lng->txt(
'tst_add_quest_cont_edit_mode_RTE_info'));
 
  401            $ri->addOption($option_rte);
 
  405            $form->addItem($ri, 
true);
 
  409            $form->addItem($hi, 
true);
 
  412        if ($this->test_object->getPoolUsage()) {
 
  413            $subScreenId[] = 
'poolSelect';
 
  417            $usage->setRequired(
true);
 
  418            $no_pool = 
new ilRadioOption($this->lng->txt(
"assessment_no_pool"), 1);
 
  419            $usage->addOption($no_pool);
 
  420            $existing_pool = 
new ilRadioOption($this->lng->txt(
"assessment_existing_pool"), 3);
 
  421            $usage->addOption($existing_pool);
 
  422            $new_pool = 
new ilRadioOption($this->lng->txt(
"assessment_new_pool"), 2);
 
  423            $usage->addOption($new_pool);
 
  424            $form->addItem($usage);
 
  429            $pools_data = array();
 
  430            foreach ($questionpools as $key => $p) {
 
  431                $pools_data[$key] = $p[
'title'];
 
  433            $pools = 
new ilSelectInputGUI($this->lng->txt(
"select_questionpool"), 
"sel_qpl");
 
  434            $pools->setOptions($pools_data);
 
  435            $existing_pool->addSubItem($pools);
 
  439            $name->setMaxLength(50);
 
  440            $new_pool->addSubItem(
$name);
 
  443        $form->addCommandButton(
"handleToolbarCommand", 
$lng->txt(
"create"));
 
  444        $form->addCommandButton(
"questions", 
$lng->txt(
"cancel"));
 
  446        $ilHelp->setSubScreenId(implode(
'_', $subScreenId));
 
  448        return $form->getHTML();
 
  454        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  456        $ilCtrl->saveParameterByClass(
'ilobjtestgui', 
'q_id');
 
  458        $ilCtrl->redirectByClass(
'ilobjtestgui', 
'showPage');
 
  463        $cmdClass = $questionType . 
'GUI';
 
  465        $this->ctrl->setParameterByClass($cmdClass, 
'ref_id', 
$_GET[
'ref_id']);
 
  466        $this->ctrl->setParameterByClass($cmdClass, 
'sel_question_types', $questionType);
 
  467        $this->ctrl->setParameterByClass($cmdClass, 
'test_ref_id', 
$_GET[
'ref_id']);
 
  468        $this->ctrl->setParameterByClass($cmdClass, 
'calling_test', 
$_GET[
'ref_id']);
 
  469        $this->ctrl->setParameterByClass($cmdClass, 
'q_id', $qid);
 
  470        $this->ctrl->setParameterByClass($cmdClass, 
'prev_qid', $prev_qid);
 
  472        if ($_REQUEST[
'test_express_mode']) {
 
  473            $this->ctrl->setParameterByClass($cmdClass, 
'test_express_mode', 1);
 
  476        $this->ctrl->redirectByClass(
 
  477            array(
'ilRepositoryGUI', 
'ilObjTestGUI', $questionType . 
"GUI"),
 
  484        $this->ctrl->setParameterByClass(
'ilObjTestGUI', 
'ref_id', $_REQUEST[
'ref_id']);
 
  485        $this->ctrl->setParameterByClass(
'ilObjTestGUI', 
'q_id', $qid);
 
  486        $this->ctrl->setParameterByClass(
'ilObjTestGUI', 
'sel_question_types', $questionType);
 
  487        $this->ctrl->setParameterByClass(
'ilObjTestGUI', 
'prev_qid', $prev_qid);
 
  488        $redir = $this->ctrl->getLinkTargetByClass(
'ilObjTestGUI', 
'createQuestion', 
'', 
false, 
false);
 
  495        $selected_array = (is_array(
$_POST[
'q_id'])) ? 
$_POST[
'q_id'] : array();
 
  496        if (!count($selected_array)) {
 
  498            $this->ctrl->redirect($this, 
"browseForQuestions");
 
  500            include_once 
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
 
  504            $tree = 
$DIC[
'tree'];
 
  506            $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
  508            require_once 
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
 
  510            $testQuestionSetConfig = $testQuestionSetConfigFactory->getQuestionSetConfig();
 
  512            foreach ($selected_array as $key => $value) {
 
  513                $last_question_id = $this->test_object->insertQuestion($testQuestionSetConfig, $value);
 
  519            $this->test_object->saveCompleteStatus($testQuestionSetConfig);
 
  523                ilUtil::sendSuccess($this->lng->txt(
"tst_questions_inserted"), 
true);
 
  526            $this->ctrl->setParameter($this, 
'q_id', $last_question_id);
 
  527            $this->ctrl->redirect($this, 
"showPage");
 
An exception for terminatinating execution or to throw for unit testing.
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...
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
constant for additional content editing mode "default"
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
constant for additional content editing mode "pageobject"
static _needsManualScoring($question_id)
showPage()
display content of page
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not
static getQuestionTypeByTypeId($type_id)
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.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static _lookupObjectId($a_ref_id)
lookup object id
setOutputMode($a_mode=self::PRESENTATION)
Set Output Mode.
getPageObject()
Get Page Object.
getEnableEditing()
Get Enable Editing.
This class represents an option in a radio group.
@ilCtrl_Calls ilTestExpressPageObjectGUI: assMultipleChoiceGUI, assClozeTestGUI, assMatchingQuestionG...
addPageOfQuestions($type='')
executeCommand()
execute command
__construct($a_id=0, $a_old_nr=0)
Constructor.
redirectToQuestionPoolSelectionPage($questionType, $qid, $prev_qid)
redirectToQuestionEditPage($questionType, $qid, $prev_qid)
This class represents a text property in a property form.
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc