ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjTestGUI Class Reference

Class ilObjTestGUI. More...

+ Inheritance diagram for ilObjTestGUI:
+ Collaboration diagram for ilObjTestGUI:

Public Member Functions

 __construct ($refId=null)
 Constructor public. More...
 
 executeCommand ()
 execute command More...
 
 getTestAccess ()
 
 setTestAccess ($testAccess)
 
 getTabsManager ()
 
 setTabsManager ($tabsManager)
 
 runObject ()
 
 outEvaluationObject ()
 
 addDidacticTemplateOptions (array &$a_options)
 
 afterSave (ilObject $a_new_object)
 save object public More...
 
 backToRepositoryObject ()
 
 uploadTstObject ()
 imports test and question(s) More...
 
 importVerifiedFileObject ()
 imports question(s) into the questionpool (after verification) More...
 
 uploadObject ($redirect=true)
 display status information or report errors messages in case of error More...
 
 downloadFileObject ()
 download file More...
 
 fullscreenObject ()
 show fullscreen view More...
 
 download_paragraphObject ()
 download source code paragraph More...
 
 filterObject ()
 Sets the filter for the question browser. More...
 
 resetFilterObject ()
 Resets the filter for the question browser. More...
 
 backObject ()
 Called when the back button in the question browser was pressed. More...
 
 createQuestionPool ($name="dummy", $description="")
 Creates a new questionpool and returns the reference id. More...
 
 randomselectObject ()
 Creates a form for random selection of questions. More...
 
 cancelRandomSelectObject ()
 Cancels the form for random selection of questions. More...
 
 createRandomSelectionObject ()
 Offers a random selection for insertion in the test. More...
 
 insertRandomSelectionObject ()
 Inserts a random selection into the test. More...
 
 browseForQuestionsObject ()
 
 executeCreateQuestionObject ()
 Called when a new question should be created from a test after confirmation. More...
 
 cancelCreateQuestionObject ()
 Called when the creation of a new question is cancelled. More...
 
 createQuestionObject ()
 Called when a new question should be created from a test. More...
 
 confirmRemoveQuestionsObject ()
 Remove questions from the test after confirmation. More...
 
 cancelRemoveQuestionsObject ()
 Cancels the removal of questions from the test. More...
 
 removeQuestionsForm ($checked_questions)
 Displays a form to confirm the removal of questions from the test. More...
 
 removeQuestionsObject ()
 Called when a selection of questions should be removed from the test. More...
 
 moveQuestionsObject ()
 Marks selected questions for moving. More...
 
 insertQuestionsBeforeObject ()
 Insert checked questions before the actual selection. More...
 
 insertQuestionsAfterObject ()
 Insert checked questions after the actual selection. More...
 
 insertQuestionsObject ()
 Insert questions from the questionbrowser into the test. More...
 
 addQuestionObject ()
 
 questionsObject ()
 
 takenObject ()
 
 historyObject ()
 Creates the change history for a test. More...
 
 initImportForm ($a_new_type)
 
 participantsActionObject ()
 Evaluates the actions on the participants page. More...
 
 printobject ()
 Print tab to create a print of all questions with points and solutions. More...
 
 reviewobject ()
 Review tab to create a print of all questions without points and solutions. More...
 
 deleteDefaultsObject ()
 Deletes selected test defaults. More...
 
 confirmedApplyDefaultsObject ()
 
 applyDefaultsObject ($confirmed=false)
 Applies the selected test defaults. More...
 
 addDefaultsObject ()
 Adds the defaults of this test to the defaults. More...
 
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 redirectToInfoScreenObject ()
 
 addLocatorItems ()
 
 statisticsObject ()
 
 certificateObject ()
 Shows the certificate editor. More...
 
 getTabs ()
 adds tabs to tab gui object More...
 
 buildPageViewToolbar ($qid=0)
 Questions per page. More...
 
 copyQuestionsToPoolObject ()
 
 copyQuestionsToPool ($questionIds, $qplId)
 
 copyQuestionToPool ($sourceQuestionId, $targetParentId)
 
 copyAndLinkQuestionsToPoolObject ()
 ilObjectDataCache $ilObjDataCache More...
 
 copyToQuestionpoolObject ()
 
 copyAndLinkToQuestionpoolObject ()
 
 createQuestionPoolAndCopyObject ()
 
 createQuestionpoolTargetObject ($cmd)
 Called when a new question should be created from a test Important: $cmd may be overwritten if no question pool is available. More...
 
 applyTemplate ($templateData, ilObjTest $object)
 
 saveOrderAndObligationsObject ()
 
 movePageObject ()
 
 showPageObject ()
 
 copyQuestionObject ()
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 

Static Public Member Functions

static accessViolationRedirect ()
 
static _goto ($a_target)
 Redirect script to call a test with the test reference id. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Data Fields

 $object = null
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 trackTestObjectReadEvent ()
 
 exportObject ()
 Gateway for exports initiated from workspace, as there is a generic forward to {objTypeMainGUI}::export() More...
 
 fetchAuthoringQuestionIdParameter ()
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 form for new test object import More...
 
 removeImportFailsObject ()
 
 movePageFormObject ()
 Move current page. More...
 
 determineObjectiveOrientedContainer ()
 
 getObjectiveOrientedContainer ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $tabsManager
 
 $testAccess
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 

Private Member Functions

 questionsTabGatewayObject ()
 
 userResultsGatewayObject ()
 
 forwardToEvaluationGUI ()
 
 redirectTo_ilObjTestSettingsGeneralGUI_showForm_Object ()
 
 prepareSubGuiOutput ()
 prepares ilias to get output rendered by sub gui class More...
 
 populateQuestionBrowserToolbarButtons (ilToolbarGUI $toolbar, $context)
 
 isCommandClassAnyInfoScreenChild ()
 
 getQuestionpoolCreationForm ()
 

Private Attributes

 $testQuestionSetConfigFactory = null
 
 $testPlayerFactory = null
 
 $testSessionFactory = null
 
 $testSequenceFactory = null
 
 $objectiveOrientedContainer
 

Static Private Attributes

static $infoScreenChildClasses
 

Detailed Description

Class ilObjTestGUI.

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Björn Heyser bheys.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

ilObjTestGUI: ilObjCourseGUI, ilObjectMetaDataGUI, ilCertificateGUI, ilPermissionGUI ilObjTestGUI: ilTestPlayerFixedQuestionSetGUI, ilTestPlayerRandomQuestionSetGUI, ilTestPlayerDynamicQuestionSetGUI ilObjTestGUI: ilTestExpresspageObjectGUI, ilAssQuestionPageGUI ilObjTestGUI: ilTestDashboardGUI, ilTestResultsGUI ilObjTestGUI: ilLearningProgressGUI, ilMarkSchemaGUI ilObjTestGUI: ilTestEvaluationGUI ilObjTestGUI: ilAssGenFeedbackPageGUI, ilAssSpecFeedbackPageGUI ilObjTestGUI: ilInfoScreenGUI, ilObjectCopyGUI, ilTestScoringGUI ilObjTestGUI: ilRepositorySearchGUI, ilTestExportGUI ilObjTestGUI: assMultipleChoiceGUI, assClozeTestGUI, assMatchingQuestionGUI ilObjTestGUI: assOrderingQuestionGUI, assImagemapQuestionGUI, assJavaAppletGUI ilObjTestGUI: assNumericGUI, assErrorTextGUI, ilTestScoringByQuestionsGUI ilObjTestGUI: assTextSubsetGUI, assOrderingHorizontalGUI ilObjTestGUI: assSingleChoiceGUI, assFileUploadGUI, assTextQuestionGUI, assFlashQuestionGUI ilObjTestGUI: assKprimChoiceGUI, assLongMenuGUI ilObjTestGUI: ilObjQuestionPoolGUI, ilEditClipboardGUI ilObjTestGUI: ilObjTestSettingsGeneralGUI, ilObjTestSettingsScoringResultsGUI ilObjTestGUI: ilCommonActionDispatcherGUI ilObjTestGUI: ilTestFixedQuestionSetConfigGUI, ilTestRandomQuestionSetConfigGUI, ilObjTestDynamicQuestionSetConfigGUI ilObjTestGUI: ilAssQuestionHintsGUI, ilAssQuestionFeedbackEditingGUI, ilLocalUnitConfigurationGUI, assFormulaQuestionGUI ilObjTestGUI: ilTestPassDetailsOverviewTableGUI ilObjTestGUI: ilTestResultsToolbarGUI ilObjTestGUI: ilTestCorrectionsGUI ilObjTestGUI: ilTestSettingsChangeConfirmationGUI ilObjTestGUI: ilTestSkillAdministrationGUI ilObjTestGUI: ilAssQuestionPreviewGUI ilObjTestGUI: ilTestQuestionBrowserTableGUI, ilTestInfoScreenToolbarGUI, ilLTIProviderObjectSettingGUI

Definition at line 52 of file class.ilObjTestGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjTestGUI::__construct (   $refId = null)

Constructor public.

Parameters
mixed | null$refId

Definition at line 93 of file class.ilObjTestGUI.php.

References $_GET, $DIC, $ilCtrl, $ilDB, ilObjectGUI\$lng, $tabsManager, ilObjectGUI\$tree, setTabsManager(), and setTestAccess().

94  {
95  global $DIC;
96  $lng = $DIC['lng'];
97  $ilCtrl = $DIC['ilCtrl'];
98  $ilDB = $DIC['ilDB'];
99  $ilPluginAdmin = $DIC['ilPluginAdmin'];
100  $tree = $DIC['tree'];
101  $lng->loadLanguageModule("assessment");
102  $this->type = "tst";
103  $this->ctrl = $ilCtrl;
104  $this->ctrl->saveParameter($this, array("ref_id", "test_ref_id", "calling_test", "test_express_mode", "q_id"));
105  if (isset($_GET['ref_id']) && is_numeric($_GET['ref_id'])) {
106  $refId = (int) $_GET['ref_id'];
107  }
108  parent::__construct("", (int) $refId, true, false);
109 
110  if ($this->object instanceof ilObjTest) {
111  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
112  $this->testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $this->object);
113 
114  require_once 'Modules/Test/classes/class.ilTestPlayerFactory.php';
115  $this->testPlayerFactory = new ilTestPlayerFactory($this->object);
116 
117  require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
118  $this->testSessionFactory = new ilTestSessionFactory($this->object);
119 
120  require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
121  $this->testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this->object);
122 
123  require_once 'Modules/Test/classes/class.ilTestAccess.php';
124  $this->setTestAccess(new ilTestAccess($this->ref_id, $this->object->getTestId()));
125  }
126 
127  require_once 'Modules/Test/classes/class.ilTestObjectiveOrientedContainer.php';
128  $this->objectiveOrientedContainer = new ilTestObjectiveOrientedContainer();
129 
130  if ($this->object instanceof ilObjTest) {
131  require_once 'Modules/Test/classes/class.ilTestTabsManager.php';
132  $tabsManager = new ilTestTabsManager($this->testAccess, $this->objectiveOrientedContainer);
133  $tabsManager->setTestOBJ($this->object);
134  $tabsManager->setTestSession($this->testSessionFactory->getSession());
135  $tabsManager->setTestQuestionSetConfig($this->testQuestionSetConfigFactory->getQuestionSetConfig());
136  $tabsManager->initSettingsTemplate();
138  }
139  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
setTestAccess($testAccess)
global $ilCtrl
Definition: ilias.php:18
setTabsManager($tabsManager)
global $ilDB
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjTestGUI::_goto (   $a_target)
static

Redirect script to call a test with the test reference id.

Redirect script to call a test with the test reference id

Parameters
integer$a_targetThe reference id of the test public

Definition at line 2981 of file class.ilObjTestGUI.php.

References $_GET, $DIC, ilObjectGUI\$ilErr, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, and ilUtil\sendInfo().

2982  {
2983  global $DIC;
2984  $ilAccess = $DIC['ilAccess'];
2985  $ilErr = $DIC['ilErr'];
2986  $lng = $DIC['lng'];
2987 
2988  if ($ilAccess->checkAccess("read", "", $a_target)) {
2989  //include_once "./Services/Utilities/classes/class.ilUtil.php";
2990  $_GET["baseClass"] = "ilObjTestGUI";
2991  $_GET["cmd"] = "infoScreen";
2992  $_GET["ref_id"] = $a_target;
2993  include_once("ilias.php");
2994  exit;
2995  //ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=infoScreen&ref_id=$a_target");
2996  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
2997  ilUtil::sendInfo(sprintf(
2998  $lng->txt("msg_no_perm_read_item"),
3000  ), true);
3002  }
3003 
3004  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
3005  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _lookupObjId($a_id)
exit
Definition: backend.php:16
+ Here is the call graph for this function:

◆ accessViolationRedirect()

static ilObjTestGUI::accessViolationRedirect ( )
static

◆ addDefaultsObject()

ilObjTestGUI::addDefaultsObject ( )

Adds the defaults of this test to the defaults.

Definition at line 2648 of file class.ilObjTestGUI.php.

References $_POST, and ilUtil\sendInfo().

2649  {
2650  if (strlen($_POST["name"]) > 0) {
2651  $this->object->addDefaults($_POST['name']);
2652  } else {
2653  ilUtil::sendInfo($this->lng->txt("tst_defaults_enter_name"));
2654  }
2655  $this->defaultsObject();
2656  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ addDidacticTemplateOptions()

ilObjTestGUI::addDidacticTemplateOptions ( array &  $a_options)

Definition at line 950 of file class.ilObjTestGUI.php.

References $row, and ilSettingsTemplate\getAllSettingsTemplates().

951  {
952  include_once("./Modules/Test/classes/class.ilObjTest.php");
953  $tst = new ilObjTest();
954  $defaults = $tst->getAvailableDefaults();
955  if (count($defaults)) {
956  foreach ($defaults as $row) {
957  $a_options["tstdef_" . $row["test_defaults_id"]] = array($row["name"],
958  $this->lng->txt("tst_default_settings"));
959  }
960  }
961 
962  // using template?
963  include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
965  if ($templates) {
966  foreach ($templates as $item) {
967  $a_options["tsttpl_" . $item["id"]] = array($item["title"],
968  nl2br(trim($item["description"])));
969  }
970  }
971  }
static getAllSettingsTemplates($a_type, $a_include_auto_generated=false)
Get all settings templates of type.
$row
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjTestGUI::addLocatorItems ( )

Definition at line 2873 of file class.ilObjTestGUI.php.

References $_GET, and $DIC.

2874  {
2875  global $DIC;
2876  $ilLocator = $DIC['ilLocator'];
2877  switch ($this->ctrl->getCmd()) {
2878  case "run":
2879  case "infoScreen":
2880  case "redirectToInfoScreen":
2881  case "start":
2882  case "resume":
2883  case "previous":
2884  case "next":
2885  case "summary":
2886  case "finishTest":
2887  case "outCorrectSolution":
2888  case "passDetails":
2889  case "showAnswersOfUser":
2890  case "outUserResultsOverview":
2891  case "backFromSummary":
2892  case "show_answers":
2893  case "setsolved":
2894  case "resetsolved":
2895  case "outTestSummary":
2896  case "outQuestionSummary":
2897  case "gotoQuestion":
2898  case "selectImagemapRegion":
2899  case "confirmSubmitAnswers":
2900  case "finalSubmission":
2901  case "postpone":
2902  case "outUserPassDetails":
2903  case "checkPassword":
2904  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "infoScreen"), "", $_GET["ref_id"]);
2905  break;
2906  case "eval_stat":
2907  case "evalAllUsers":
2908  case "evalUserDetail":
2909  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "eval_stat"), "", $_GET["ref_id"]);
2910  break;
2911  case "create":
2912  case "save":
2913  case "cancel":
2914  case "importFile":
2915  case "cloneAll":
2916  case "importVerifiedFile":
2917  case "cancelImport":
2918  break;
2919  default:
2920  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
2921  break;
2922  }
2923  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]

◆ addQuestionObject()

ilObjTestGUI::addQuestionObject ( )

Definition at line 1930 of file class.ilObjTestGUI.php.

References ilObjectGUI\$data, $DIC, $form, $ilCtrl, $key, ilObjectGUI\$lng, $name, PHPMailer\PHPMailer\$options, $si, $title, ilObjectGUI\$tpl, ilObjQuestionPool\_getAvailableQuestionpools(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT, ilRadioGroupInputGUI\addOption(), getTabsManager(), ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), and ilTestTabsManager\SUBTAB_ID_QST_LIST_VIEW.

1931  {
1932  global $DIC;
1933  $lng = $DIC['lng'];
1934  $ilCtrl = $DIC['ilCtrl'];
1935  $tpl = $DIC['tpl'];
1936  global $DIC; /* @var \ILIAS\DI\Container $DIC */
1937  $ilHelp = $DIC['ilHelp']; /* @var ilHelpGUI $ilHelp */
1938 
1939  $this->getTabsManager()->getQuestionsSubTabs();
1941 
1942  $subScreenId = array('createQuestion');
1943 
1944  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
1945 
1946  $ilCtrl->setParameter($this, 'qtype', $_REQUEST['qtype']);
1947 
1948  $form = new ilPropertyFormGUI();
1949 
1950  $form->setFormAction($ilCtrl->getFormAction($this, "executeCreateQuestion"));
1951  $form->setTitle($lng->txt("ass_create_question"));
1952  include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
1953 
1954  $pool = new ilObjQuestionPool();
1955  $questionTypes = $pool->getQuestionTypes(false, true, false);
1956  $options = array();
1957 
1958  // question type
1959  foreach ($questionTypes as $label => $data) {
1960  $options[$data['question_type_id']] = $label;
1961  }
1962 
1963  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
1964  $si = new ilSelectInputGUI($lng->txt("question_type"), "qtype");
1965  $si->setOptions($options);
1966  $form->addItem($si, true);
1967 
1968  // position
1969  $questions = $this->object->getQuestionTitlesAndIndexes();
1970  if ($questions) {
1971  $si = new ilSelectInputGUI($lng->txt("position"), "position");
1972  $options = array('0' => $lng->txt('first'));
1973  foreach ($questions as $key => $title) {
1974  $options[$key] = $lng->txt('behind') . ' ' . $title . ' [' . $this->lng->txt('question_id_short') . ': ' . $key . ']';
1975  }
1976  $si->setOptions($options);
1977  $si->setValue($_REQUEST['q_id']);
1978  $form->addItem($si, true);
1979  }
1980 
1981  // content editing mode
1983  $subScreenId[] = 'editMode';
1984 
1985  $ri = new ilRadioGroupInputGUI($lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
1986 
1987  $ri->addOption(new ilRadioOption(
1988  $lng->txt('tst_add_quest_cont_edit_mode_default'),
1990  ));
1991 
1992  $ri->addOption(new ilRadioOption(
1993  $lng->txt('tst_add_quest_cont_edit_mode_page_object'),
1995  ));
1996 
1998 
1999  $form->addItem($ri, true);
2000  } else {
2001  $hi = new ilHiddenInputGUI("question_content_editing_type");
2003  $form->addItem($hi, true);
2004  }
2005 
2006  if ($this->object->getPoolUsage()) {
2007  $subScreenId[] = 'poolSelect';
2008 
2009  // use pool
2010  $usage = new ilRadioGroupInputGUI($this->lng->txt("assessment_pool_selection"), "usage");
2011  $usage->setRequired(true);
2012  $no_pool = new ilRadioOption($this->lng->txt("assessment_no_pool"), 1);
2013  $usage->addOption($no_pool);
2014  $existing_pool = new ilRadioOption($this->lng->txt("assessment_existing_pool"), 3);
2015  $usage->addOption($existing_pool);
2016  $new_pool = new ilRadioOption($this->lng->txt("assessment_new_pool"), 2);
2017  $usage->addOption($new_pool);
2018  $form->addItem($usage);
2019 
2020  $usage->setValue(1);
2021 
2022  $questionpools = ilObjQuestionPool::_getAvailableQuestionpools(false, false, true, false, false, "write");
2023  $pools_data = array();
2024  foreach ($questionpools as $key => $p) {
2025  $pools_data[$key] = $p['title'];
2026  }
2027  $pools = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "sel_qpl");
2028  $pools->setOptions($pools_data);
2029  $existing_pool->addSubItem($pools);
2030 
2031  $name = new ilTextInputGUI($this->lng->txt("name"), "txt_qpl");
2032  $name->setSize(50);
2033  $name->setMaxLength(50);
2034  $new_pool->addSubItem($name);
2035  }
2036 
2037  $form->addCommandButton("executeCreateQuestion", $lng->txt("create"));
2038  $form->addCommandButton("questions", $lng->txt("cancel"));
2039 
2040  $DIC->tabs()->activateTab('assQuestions');
2041  $ilHelp->setScreenId('assQuestions');
2042  $ilHelp->setSubScreenId(implode('_', $subScreenId));
2043 
2044  return $tpl->setContent($form->getHTML());
2045  }
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.
This class represents a selection list property in a property form.
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
global $ilCtrl
Definition: ilias.php:18
This class represents a hidden form property in a property form.
This class represents a property in a property form.
addOption($a_option)
Add Option.
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
setOptions($a_options)
Set Options.
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
$key
Definition: croninfo.php:18
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

◆ afterSave()

ilObjTestGUI::afterSave ( ilObject  $a_new_object)

save object public

Definition at line 977 of file class.ilObjTestGUI.php.

References $template, $template_id, ilObjTest\_getTestDefaults(), applyTemplate(), ilObjectGUI\getDidacticTemplateVar(), ilObject\getRefId(), and ilObjAssessmentFolderGUI\getSettingsTemplateConfig().

978  {
979  $tstdef = $this->getDidacticTemplateVar("tstdef");
980  if ($tstdef) {
981  $testDefaultsId = $tstdef;
982  $testDefaults = ilObjTest::_getTestDefaults($testDefaultsId);
983  $a_new_object->applyDefaults($testDefaults);
984  }
985 
986  $template_id = $this->getDidacticTemplateVar("tsttpl");
987  if ($template_id) {
988  include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
990 
991  $template_settings = $template->getSettings();
992  if ($template_settings) {
993  $this->applyTemplate($template_settings, $a_new_object);
994  }
995 
996  $a_new_object->setTemplate($template_id);
997  }
998 
999  $a_new_object->saveToDb();
1000 
1001  // always send a message
1002  ilUtil::sendSuccess($this->lng->txt("object_added"), true);
1003  $this->ctrl->setParameter($this, 'ref_id', $a_new_object->getRefId());
1004  $this->ctrl->redirectByClass('ilObjTestSettingsGeneralGUI');
1005  }
$template
applyTemplate($templateData, ilObjTest $object)
getRefId()
get reference id public
getDidacticTemplateVar($a_type)
Get didactic template setting from creation screen.
$template_id
Settings template application class.
static _getTestDefaults($test_defaults_id)
+ Here is the call graph for this function:

◆ applyDefaultsObject()

ilObjTestGUI::applyDefaultsObject (   $confirmed = false)

Applies the selected test defaults.

Definition at line 2560 of file class.ilObjTestGUI.php.

References $_POST, $info, ilObjTest\QUESTION_SET_TYPE_FIXED, ilObjTest\QUESTION_SET_TYPE_RANDOM, and ilUtil\sendInfo().

Referenced by confirmedApplyDefaultsObject().

2561  {
2562  if (!is_array($_POST["chb_defaults"]) || 1 !== count($_POST["chb_defaults"])) {
2564  $this->lng->txt("tst_defaults_apply_select_one")
2565  );
2566 
2567  return $this->defaultsObject();
2568  }
2569 
2570  // do not apply if user datasets exist
2571  if ($this->object->evalTotalPersons() > 0) {
2573  $this->lng->txt("tst_defaults_apply_not_possible")
2574  );
2575 
2576  return $this->defaultsObject();
2577  }
2578 
2579  $defaults = &$this->object->getTestDefaults($_POST["chb_defaults"][0]);
2580  $defaultSettings = unserialize($defaults["defaults"]);
2581 
2582  if (isset($defaultSettings['isRandomTest'])) {
2583  if ($defaultSettings['isRandomTest']) {
2584  $newQuestionSetType = ilObjTest::QUESTION_SET_TYPE_RANDOM;
2585  $this->object->setQuestionSetType(ilObjTest::QUESTION_SET_TYPE_RANDOM);
2586  } else {
2587  $newQuestionSetType = ilObjTest::QUESTION_SET_TYPE_FIXED;
2588  $this->object->setQuestionSetType(ilObjTest::QUESTION_SET_TYPE_FIXED);
2589  }
2590  } elseif (isset($defaultSettings['questionSetType'])) {
2591  $newQuestionSetType = $defaultSettings['questionSetType'];
2592  }
2593  $oldQuestionSetType = $this->object->getQuestionSetType();
2594  $questionSetTypeSettingSwitched = ($oldQuestionSetType != $newQuestionSetType);
2595 
2596  $oldQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfigByType($oldQuestionSetType);
2597 
2598  switch (true) {
2599  case !$questionSetTypeSettingSwitched:
2600  case !$oldQuestionSetConfig->doesQuestionSetRelatedDataExist():
2601  case $confirmed:
2602 
2603  break;
2604 
2605  default:
2606 
2607  require_once 'Modules/Test/classes/confirmations/class.ilTestSettingsChangeConfirmationGUI.php';
2608  $confirmation = new ilTestSettingsChangeConfirmationGUI($this->lng, $this->object);
2609 
2610  $confirmation->setFormAction($this->ctrl->getFormAction($this));
2611  $confirmation->setCancel($this->lng->txt('cancel'), 'defaults');
2612  $confirmation->setConfirm($this->lng->txt('confirm'), 'confirmedApplyDefaults');
2613 
2614  $confirmation->setOldQuestionSetType($this->object->getQuestionSetType());
2615  $confirmation->setNewQuestionSetType($newQuestionSetType);
2616  $confirmation->setQuestionLossInfoEnabled(false);
2617  $confirmation->build();
2618 
2619  $confirmation->populateParametersFromPost();
2620 
2621  $this->tpl->setContent($this->ctrl->getHTML($confirmation));
2622 
2623  return;
2624  }
2625 
2626  if ($questionSetTypeSettingSwitched && !$this->object->getOfflineStatus()) {
2627  $this->object->setOfflineStatus(true);
2628 
2629  $info = $this->lng->txt("tst_set_offline_due_to_switched_question_set_type_setting");
2630 
2631  ilUtil::sendInfo($info, true);
2632  }
2633 
2634  $this->object->applyDefaults($defaults);
2635 
2636  ilUtil::sendSuccess($this->lng->txt("tst_defaults_applied"), true);
2637 
2638  if ($questionSetTypeSettingSwitched && $oldQuestionSetConfig->doesQuestionSetRelatedDataExist()) {
2639  $oldQuestionSetConfig->removeQuestionSetRelatedData();
2640  }
2641 
2642  $this->ctrl->redirect($this, 'defaults');
2643  }
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
$info
Definition: index.php:5
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyTemplate()

ilObjTestGUI::applyTemplate (   $templateData,
ilObjTest  $object 
)

Definition at line 3431 of file class.ilObjTestGUI.php.

References ilObjTestSettingsGeneralGUI\ANSWER_FIXATION_NONE, ilObjTestSettingsGeneralGUI\ANSWER_FIXATION_ON_FOLLOWUP_QUESTION, ilObjTestSettingsGeneralGUI\ANSWER_FIXATION_ON_IFB_OR_FUQST, ilObjTestSettingsGeneralGUI\ANSWER_FIXATION_ON_INSTANT_FEEDBACK, REDIRECT_ALWAYS, REDIRECT_NONE, ilObjTest\setAutosave(), ilObjTest\setAutosaveIval(), ilObjTest\setFollowupQuestionAnswerFixationEnabled(), ilObjTest\setInstantFeedbackAnswerFixationEnabled(), ilObjTest\setRedirectionMode(), and ilObjTest\setRedirectionUrl().

Referenced by afterSave().

3433  {
3434  // map formFieldName => setterName
3435  $simpleSetters = array(
3436 
3437  // general properties
3438  'use_pool' => 'setPoolUsage',
3439  'question_set_type' => 'setQuestionSetType',
3440 
3441  // test intro properties
3442  'intro_enabled' => 'setIntroductionEnabled',
3443  'showinfo' => 'setShowInfo',
3444 
3445  // test access properties
3446  'chb_starting_time' => 'setStartingTimeEnabled',
3447  'chb_ending_time' => 'setEndingTimeEnabled',
3448  'password_enabled' => 'setPasswordEnabled',
3449  'fixedparticipants' => 'setFixedParticipants',
3450  'limitUsers' => 'setLimitUsersEnabled',
3451 
3452  // test run properties
3453  'nr_of_tries' => 'setNrOfTries',
3454  'chb_processing_time' => 'setEnableProcessingTime',
3455  'kiosk' => 'setKiosk',
3456  'examid_in_test_pass' => 'setShowExamIdInTestPassEnabled',
3457 
3458  // question behavior properties
3459  'title_output' => 'setTitleOutput',
3460  'autosave' => null, // handled specially in loop below
3461  'chb_shuffle_questions' => 'setShuffleQuestions',
3462  'offer_hints' => 'setOfferingQuestionHintsEnabled',
3463  'instant_feedback_contents' => 'setInstantFeedbackOptionsByArray',
3464  'instant_feedback_trigger' => 'setForceInstantFeedbackEnabled',
3465  'answer_fixation_handling' => null, // handled specially in loop below
3466  'obligations_enabled' => 'setObligationsEnabled',
3467 
3468  // test sequence properties
3469  'chb_use_previous_answers' => 'setUsePreviousAnswers',
3470  'chb_show_cancel' => 'setShowCancel',
3471  'chb_postpone' => 'setPostponingEnabled',
3472  'list_of_questions' => 'setListOfQuestionsSettings',
3473  'chb_show_marker' => 'setShowMarker',
3474 
3475  // test finish properties
3476  'enable_examview' => 'setEnableExamview',
3477  'showfinalstatement' => 'setShowFinalStatement',
3478  'redirection_enabled' => null, // handled specially in loop below
3479  'sign_submission' => 'setSignSubmission',
3480  'mailnotification' => 'setMailNotification',
3481 
3482  // scoring options properties
3483  'count_system' => 'setCountSystem',
3484  'mc_scoring' => 'setMCScoring',
3485  'score_cutting' => 'setScoreCutting',
3486  'pass_scoring' => 'setPassScoring',
3487  'pass_deletion_allowed' => 'setPassDeletionAllowed',
3488 
3489  // result summary properties
3490  'results_access_enabled' => 'setScoreReporting',
3491  'grading_status' => 'setShowGradingStatusEnabled',
3492  'grading_mark' => 'setShowGradingMarkEnabled',
3493 
3494  // result details properties
3495  'solution_details' => 'setShowSolutionDetails',
3496  'solution_feedback' => 'setShowSolutionFeedback',
3497  'solution_suggested' => 'setShowSolutionSuggested',
3498  'solution_printview' => 'setShowSolutionPrintview',
3499  'highscore_enabled' => 'setHighscoreEnabled',
3500  'solution_signature' => 'setShowSolutionSignature',
3501  'examid_in_test_res' => 'setShowExamIdInTestResultsEnabled',
3502  'exp_sc_short' => 'setExportSettingsSingleChoiceShort',
3503 
3504  // misc scoring & result properties
3505  'anonymity' => 'setAnonymity',
3506  'enable_archiving' => 'setEnableArchiving'
3507  );
3508 
3509  if (!$templateData['results_presentation']['value']) {
3510  $templateData['results_presentation']['value'] = array();
3511  }
3512 
3513  foreach ($simpleSetters as $field => $setter) {
3514  if ($templateData[$field] && strlen($setter)) {
3515  $object->$setter($templateData[$field]['value']);
3516  continue;
3517  }
3518 
3519  switch ($field) {
3520  case 'autosave':
3521  if ($templateData[$field]['value'] > 0) {
3522  $object->setAutosave(true);
3523  $object->setAutosaveIval($templateData[$field]['value'] * 1000);
3524  } else {
3525  $object->setAutosave(false);
3526  }
3527  break;
3528 
3529  case 'redirection_enabled':
3530  /* if( $templateData[$field]['value'] > REDIRECT_NONE )
3531  {
3532  $object->setRedirectionMode($templateData[$field]['value']);
3533  }
3534  else
3535  {
3536  $object->setRedirectionMode(REDIRECT_NONE);
3537  } */
3538  if (strlen($templateData[$field]['value'])) {
3540  $object->setRedirectionUrl($templateData[$field]['value']);
3541  } else {
3543  $object->setRedirectionUrl('');
3544  }
3545  break;
3546 
3547  case 'answer_fixation_handling':
3548  switch ($templateData[$field]['value']) {
3552  break;
3553 
3557  break;
3558 
3562  break;
3563 
3567  break;
3568  }
3569  break;
3570  }
3571  }
3572  }
setAutosave($autosave)
setRedirectionMode($redirection_mode=0)
const REDIRECT_NONE
Redirect after finishing test constants.
setRedirectionUrl($redirection_url=null)
const REDIRECT_ALWAYS
setAutosaveIval($autosave_ival)
setFollowupQuestionAnswerFixationEnabled($followupQuestionAnswerFixationEnabled)
setInstantFeedbackAnswerFixationEnabled($instantFeedbackAnswerFixationEnabled)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ backObject()

ilObjTestGUI::backObject ( )

Called when the back button in the question browser was pressed.

Called when the back button in the question browser was pressed

public

Definition at line 1345 of file class.ilObjTestGUI.php.

1346  {
1347  $this->ctrl->redirect($this, "questions");
1348  }

◆ backToRepositoryObject()

ilObjTestGUI::backToRepositoryObject ( )

Definition at line 1007 of file class.ilObjTestGUI.php.

References $path, ilObjectGUI\getReturnLocation(), and ilUtil\redirect().

1008  {
1009  include_once "./Services/Utilities/classes/class.ilUtil.php";
1010  $path = $this->tree->getPathFull($this->object->getRefID());
1011  ilUtil::redirect($this->getReturnLocation("cancel", "./ilias.php?baseClass=ilRepositoryGUI&cmd=frameset&ref_id=" . $path[count($path) - 2]["child"]));
1012  }
$path
Definition: aliased.php:25
static redirect($a_script)
getReturnLocation($a_cmd, $a_location="")
get return location for command (command is method name without "Object", e.g.
+ Here is the call graph for this function:

◆ browseForQuestionsObject()

ilObjTestGUI::browseForQuestionsObject ( )

Definition at line 1508 of file class.ilObjTestGUI.php.

1509  {
1510  $this->questionBrowser();
1511  }

◆ buildPageViewToolbar()

ilObjTestGUI::buildPageViewToolbar (   $qid = 0)

Questions per page.

Parameters

Definition at line 3013 of file class.ilObjTestGUI.php.

References $DIC, $id, $ilCtrl, $ilUser, ilObjectGUI\$lng, PHPMailer\PHPMailer\$options, $si, $total, ilObjTestAccess\_lookupOnlineTestAccess(), ilTestQuestionBrowserTableGUI\CONTEXT_PAGE_VIEW, ilLinkButton\getInstance(), and populateQuestionBrowserToolbarButtons().

Referenced by executeCommand().

3014  {
3015  if ($this->create_question_mode) {
3016  return;
3017  }
3018 
3019  global $DIC;
3020  $ilToolbar = $DIC['ilToolbar'];
3021  $ilCtrl = $DIC['ilCtrl'];
3022  $lng = $DIC['lng'];
3023 
3024  require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
3025 
3026  $ilCtrl->saveParameter($this, 'q_mode');
3027 
3028  $ilCtrl->setParameterByClass('iltestexpresspageobjectgui', 'test_express_mode', 1);
3029  $ilCtrl->setParameter($this, 'test_express_mode', 1);
3030  $ilCtrl->setParameterByClass('iltestexpresspageobjectgui', 'q_id', $_REQUEST['q_id']);
3031  $ilCtrl->setParameter($this, 'q_id', $_REQUEST['q_id']);
3032  $ilToolbar->setFormAction($ilCtrl->getFormActionByClass('iltestexpresspageobjectgui', 'edit'));
3033 
3034  if ($this->object->evalTotalPersons() == 0) {
3035  /*
3036  include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
3037  $pool = new ilObjQuestionPool();
3038  $questionTypes = $pool->getQuestionTypes();$options = array();
3039  foreach($questionTypes as $label => $data) {
3040  $options[$data['question_type_id']] = $label;
3041  }
3042 
3043  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
3044  $si = new ilSelectInputGUI($lng->txt("test_add_new_question"), "qtype");
3045  $si->setOptions($options);
3046  $ilToolbar->addInputItem($si, true);
3047  /*
3048  // use pool
3049  if ($this->object->isExpressModeQuestionPoolAllowed()) {
3050  include_once("./Services/Form/classes/class.ilCheckboxInputGUI.php");
3051  $cb = new ilCheckboxInputGUI($lng->txt("test_use_pool"), "use_pool");
3052  $ilToolbar->addInputItem($cb, true);
3053  }
3054  */
3055  $ilToolbar->addFormButton($lng->txt("ass_create_question"), "addQuestion");
3056 
3057  $ilToolbar->addSeparator();
3058 
3059  if ($this->object->getPoolUsage()) {
3060  require_once 'Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php';
3061 
3063 
3064  $show_separator = true;
3065  }
3066  }
3067 
3068  $questions = $this->object->getQuestionTitlesAndIndexes();
3069 
3070  // desc
3071  $options = array();
3072  foreach ($questions as $id => $label) {
3073  $options[$id] = $label . ' [' . $this->lng->txt('question_id_short') . ': ' . $id . ']';
3074  }
3075 
3076  $optionKeys = array_keys($options);
3077 
3078  if (!$options) {
3079  $options[] = $lng->txt('none');
3080  }
3081  //else if (count($options) > 1) {
3082 // $addSeparator = false;
3083 // if ($optionKeys[0] != $qid) {
3084 // //$ilToolbar->addFormButton($lng->txt("test_prev_question"), "prevQuestion");
3085 // $ilToolbar->addLink($lng->txt("test_prev_question"), $ilCtrl->getLinkTargetByClass('iltestexpresspageobjectgui', 'prevQuestion'));
3086 // $addSeparator = true;
3087 // }
3088  // else {
3089  // $ilToolbar->addSpacer(45);
3090  // }
3091 //
3092 // if ($optionKeys[count($optionKeys)-1] != $qid) {
3093 // //$ilToolbar->addFormButton($lng->txt("test_next_question"), "nextQuestion");
3094 // $ilToolbar->addLink($lng->txt("test_next_question"), $ilCtrl->getLinkTargetByClass('iltestexpresspageobjectgui', 'nextQuestion'));
3095  // $addSeparator = true;
3096 // }
3097  // else {
3098  // $ilToolbar->addSpacer(45);
3099  // }
3100 //
3101 // //if ($addSeparator) {
3102 // $ilToolbar->addSeparator();
3103 // //}
3104 
3105  if (count($questions)) {
3106  if (isset($show_separator) && $show_separator) {
3107  $ilToolbar->addSeparator();
3108  }
3109 
3110  $btn = ilLinkButton::getInstance();
3111  $btn->setCaption("test_prev_question");
3112  $btn->setUrl($ilCtrl->getLinkTargetByClass('iltestexpresspageobjectgui', 'prevQuestion'));
3113  $ilToolbar->addButtonInstance($btn);
3114 
3115  if (count($options) <= 1 || $optionKeys[0] == $qid) {
3116  $btn->setDisabled(true);
3117  }
3118 
3119  $btn = ilLinkButton::getInstance();
3120  $btn->setCaption("test_next_question");
3121  $btn->setUrl($ilCtrl->getLinkTargetByClass('iltestexpresspageobjectgui', 'nextQuestion'));
3122  $ilToolbar->addButtonInstance($btn);
3123 
3124  if (count($options) <= 1 || $optionKeys[count($optionKeys) - 1] == $qid) {
3125  $btn->setDisabled(true);
3126  }
3127  }
3128 
3129  if (count($questions) > 1) {
3130  $ilToolbar->addSeparator();
3131 
3132  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
3133  $si = new ilSelectInputGUI($lng->txt("test_jump_to"), "q_id");
3134  $si->addCustomAttribute("onChange=\"forms['ilToolbar'].submit();\"");
3135  $si->setOptions($options);
3136 
3137  if ($qid) {
3138  $si->setValue($qid);
3139  }
3140 
3141  $ilToolbar->addInputItem($si, true);
3142  }
3143 
3144  $total = $this->object->evalTotalPersons();
3145 
3146  /*if (count($options)) {
3147  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
3148  $si = new ilSelectInputGUI($lng->txt("test_jump_to"), "q_id");
3149  $si->addCustomAttribute("onChange=\"forms['ilToolbar'].submit();\"");
3150  $si->setOptions($options);
3151 
3152  if ($qid) {
3153  $si->setValue($qid);
3154  }
3155 
3156  $ilToolbar->addInputItem($si, true);
3157  }*/
3158 
3159  if (count($questions) && !$total) {
3160  $ilCtrl->setParameter($this, 'q_id', $_REQUEST['q_id']);
3161  $ilToolbar->addSeparator();
3162  $ilToolbar->addButton($lng->txt("test_delete_page"), $ilCtrl->getLinkTarget($this, "removeQuestions"));
3163  }
3164 
3165  if (count($questions) > 1 && !$total) {
3166  $ilToolbar->addSeparator();
3167  $ilToolbar->addButton($lng->txt("test_move_page"), $ilCtrl->getLinkTarget($this, "movePageForm"));
3168  }
3169 
3170  global $DIC;
3171  $ilAccess = $DIC['ilAccess'];
3172  $ilUser = $DIC['ilUser'];
3173 
3174  $online_access = false;
3175  if ($this->object->getFixedParticipants()) {
3176  include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
3177  $online_access_result = ilObjTestAccess::_lookupOnlineTestAccess($this->object->getId(), $ilUser->getId());
3178  if ($online_access_result === true) {
3179  $online_access = true;
3180  }
3181  }
3182 
3183  if (!$this->object->getOfflineStatus() && $this->object->isComplete($this->testQuestionSetConfigFactory->getQuestionSetConfig())) {
3184  if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id)) {
3185  $testSession = $this->testSessionFactory->getSession();
3186 
3187  $executable = $this->object->isExecutable($testSession, $ilUser->getId(), $allowPassIncrease = true);
3188 
3189  if ($executable["executable"]) {
3190  $player_factory = new ilTestPlayerFactory($this->object);
3191  $player_instance = $player_factory->getPlayerGUI();
3192 
3193  if ($testSession->getActiveId() > 0) {
3194  $ilToolbar->addSeparator();
3195  $ilToolbar->addButton($lng->txt('tst_resume_test'), $ilCtrl->getLinkTarget($player_instance, 'resumePlayer'));
3196  } else {
3197  $ilToolbar->addSeparator();
3198  $ilToolbar->addButton($lng->txt('tst_start_test'), $ilCtrl->getLinkTarget($player_instance, 'startTest'));
3199  }
3200  }
3201  }
3202  }
3203  }
This class represents a selection list property in a property form.
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
$total
Definition: Utf8Test.php:87
global $ilCtrl
Definition: ilias.php:18
static _lookupOnlineTestAccess($a_test_id, $a_user_id)
Checks if a user is allowd to run an online exam.
$ilUser
Definition: imgupload.php:18
populateQuestionBrowserToolbarButtons(ilToolbarGUI $toolbar, $context)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancelCreateQuestionObject()

ilObjTestGUI::cancelCreateQuestionObject ( )

Called when the creation of a new question is cancelled.

Called when the creation of a new question is cancelled

public

Definition at line 1584 of file class.ilObjTestGUI.php.

1585  {
1586  $this->ctrl->redirect($this, "questions");
1587  }

◆ cancelRandomSelectObject()

ilObjTestGUI::cancelRandomSelectObject ( )

Cancels the form for random selection of questions.

Cancels the form for random selection of questions

public

Definition at line 1418 of file class.ilObjTestGUI.php.

1419  {
1420  $this->ctrl->redirect($this, "questions");
1421  }

◆ cancelRemoveQuestionsObject()

ilObjTestGUI::cancelRemoveQuestionsObject ( )

Cancels the removal of questions from the test.

Cancels the removal of questions from the test

public

Definition at line 1751 of file class.ilObjTestGUI.php.

1752  {
1753  if ($_REQUEST['test_express_mode']) {
1754  $this->ctrl->setParameter($this, 'q_id', $_REQUEST['q_id']);
1755  $this->ctrl->redirect($this, "showPage");
1756  } else {
1757  $this->ctrl->redirect($this, "questions");
1758  }
1759  }

◆ certificateObject()

ilObjTestGUI::certificateObject ( )

Shows the certificate editor.

Definition at line 2932 of file class.ilObjTestGUI.php.

References $DIC, and ilTestTabsManager\TAB_ID_SETTINGS.

2933  {
2934  global $DIC; /* @var ILIAS\DI\Container $DIC */
2935 
2936  $DIC->tabs()->activateTab(ilTestTabsManager::TAB_ID_SETTINGS);
2937 
2938  $guiFactory = new ilCertificateGUIFactory();
2939  $output_gui = $guiFactory->create($this->object);
2940 
2941  $output_gui->certificateEditor();
2942  }
global $DIC
Definition: saml.php:7

◆ confirmedApplyDefaultsObject()

ilObjTestGUI::confirmedApplyDefaultsObject ( )

Definition at line 2551 of file class.ilObjTestGUI.php.

References applyDefaultsObject().

2552  {
2553  $this->applyDefaultsObject(true);
2554  return;
2555  }
applyDefaultsObject($confirmed=false)
Applies the selected test defaults.
+ Here is the call graph for this function:

◆ confirmRemoveQuestionsObject()

ilObjTestGUI::confirmRemoveQuestionsObject ( )

Remove questions from the test after confirmation.

Definition at line 1693 of file class.ilObjTestGUI.php.

References $_POST, and $key.

1694  {
1695  $removeQuestionIds = (array) $_POST["q_id"];
1696 
1697  $questions = $this->object->getQuestionTitlesAndIndexes();
1698 
1699  $this->object->removeQuestions($removeQuestionIds);
1700 
1701  $this->object->saveCompleteStatus($this->testQuestionSetConfigFactory->getQuestionSetConfig());
1702 
1703  ilUtil::sendSuccess($this->lng->txt("tst_questions_removed"));
1704 
1705  if ($_REQUEST['test_express_mode']) {
1706  $prev = null;
1707  $return_to = null;
1708  $deleted_tmp = $removeQuestionIds;
1709  $first = array_shift($deleted_tmp);
1710  foreach ((array) $questions as $key => $value) {
1711  if (!in_array($key, $removeQuestionIds)) {
1712  $prev = $key;
1713  if (!$first) {
1714  $return_to = $prev;
1715  break;
1716  } else {
1717  continue;
1718  }
1719  } elseif ($key == $first) {
1720  if ($prev) {
1721  $return_to = $prev;
1722  break;
1723  }
1724  $first = array_shift($deleted_tmp);
1725  }
1726  }
1727 
1728  if (
1729  count($questions) == count($removeQuestionIds) ||
1730  !$return_to
1731  ) {
1732  $this->ctrl->setParameter($this, 'q_id', '');
1733  $this->ctrl->redirect($this, 'showPage');
1734  }
1735 
1736  $this->ctrl->setParameter($this, 'q_id', $return_to);
1737  $this->ctrl->redirect($this, "showPage");
1738  } else {
1739  $this->ctrl->setParameter($this, 'q_id', '');
1740  $this->ctrl->redirect($this, 'questions');
1741  }
1742  }
$key
Definition: croninfo.php:18
$_POST["username"]

◆ copyAndLinkQuestionsToPoolObject()

ilObjTestGUI::copyAndLinkQuestionsToPoolObject ( )

ilObjectDataCache $ilObjDataCache

Definition at line 3246 of file class.ilObjTestGUI.php.

References $DIC, $result, assQuestion\_instanciateQuestion(), copyQuestionsToPool(), and assQuestion\originalQuestionExists().

Referenced by createQuestionPoolAndCopyObject().

3247  {
3248  global $DIC;
3249  $ilObjDataCache = $DIC['ilObjDataCache'];
3250 
3251  $qplId = $ilObjDataCache->lookupObjId($_REQUEST['sel_qpl']);
3252  $result = $this->copyQuestionsToPool($_REQUEST['q_id'], $qplId);
3253 
3254  foreach ($result->ids as $oldId => $newId) {
3255  $questionInstance = assQuestion::_instanciateQuestion($oldId);
3256 
3257  if (assQuestion::originalQuestionExists($questionInstance->getOriginalId())) {
3258  $oldOriginal = assQuestion::_instanciateQuestion($questionInstance->getOriginalId());
3259  $oldOriginal->delete($oldOriginal->getId());
3260  }
3261 
3262  $questionInstance->setNewOriginalId($newId);
3263  }
3264 
3265  ilUtil::sendSuccess($this->lng->txt('tst_qst_added_to_pool_' . (count($result->ids) > 1 ? 'p' : 's')), true);
3266  $this->ctrl->redirect($this, 'questions');
3267  }
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
$result
static originalQuestionExists($questionId)
global $DIC
Definition: saml.php:7
copyQuestionsToPool($questionIds, $qplId)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyAndLinkToQuestionpoolObject()

ilObjTestGUI::copyAndLinkToQuestionpoolObject ( )

Definition at line 3301 of file class.ilObjTestGUI.php.

References $DIC, ilObjectGUI\$lng, $type, assQuestion\_getOriginalId(), ilObject\_lookupType(), createQuestionpoolTargetObject(), assQuestion\lookupParentObjId(), assQuestion\originalQuestionExists(), and ilUtil\sendFailure().

Referenced by createQuestionPoolAndCopyObject().

3302  {
3303  global $DIC;
3304  $lng = $DIC['lng'];
3305 
3306  require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
3307 
3308  // #13761; All methods use for this request should be revised, thx japo ;-)
3309  if (
3310  'copyAndLinkToQuestionpool' == $this->ctrl->getCmd() &&
3311  (!isset($_REQUEST['q_id']) || !is_array($_REQUEST['q_id']))
3312  ) {
3313  ilUtil::sendFailure($this->lng->txt('tst_no_question_selected_for_moving_to_qpl'), true);
3314  $this->ctrl->redirect($this, 'questions');
3315  }
3316 
3317  if (isset($_REQUEST['q_id']) && is_array($_REQUEST['q_id'])) {
3318  foreach ($_REQUEST['q_id'] as $q_id) {
3320  continue;
3321  }
3322 
3324 
3325  if ($type !== 'tst') {
3326  ilUtil::sendFailure($lng->txt('tst_link_only_unassigned'), true);
3327  $this->ctrl->redirect($this, 'questions');
3328  return;
3329  }
3330  }
3331  }
3332 
3333  $this->createQuestionpoolTargetObject('copyAndLinkQuestionsToPool');
3334  }
static _getOriginalId($question_id)
Returns the original id of a question.
static originalQuestionExists($questionId)
$type
global $DIC
Definition: saml.php:7
createQuestionpoolTargetObject($cmd)
Called when a new question should be created from a test Important: $cmd may be overwritten if no que...
static lookupParentObjId($questionId)
ilDBInterface $ilDB
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyQuestionObject()

ilObjTestGUI::copyQuestionObject ( )

Definition at line 3687 of file class.ilObjTestGUI.php.

References $DIC, $i, $id, $title, assQuestion\_instanciateQuestionGUI(), ilUtil\sendFailure(), and ilUtil\sendInfo().

3688  {
3689  global $DIC;
3690  $ilAccess = $DIC['ilAccess'];
3691  if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
3692  // allow only write access
3693  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
3694  $this->ctrl->redirect($this, "infoScreen");
3695  }
3696 
3697  if ($_REQUEST['q_id'] && !is_array($_REQUEST['q_id'])) {
3698  $ids = array($_REQUEST['q_id']);
3699  } elseif ($_REQUEST['q_id']) {
3700  $ids = $_REQUEST['q_id'];
3701  } else {
3702  ilUtil::sendFailure($this->lng->txt('copy_no_questions_selected'), true);
3703  $this->ctrl->redirect($this, 'questions');
3704  }
3705 
3706  $copy_count = 0;
3707 
3708  $questionTitles = $this->object->getQuestionTitles();
3709 
3710  foreach ($ids as $id) {
3711  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
3712  $question = assQuestion::_instanciateQuestionGUI($id);
3713  if ($question) {
3714  $title = $question->object->getTitle();
3715  $i = 2;
3716  while (in_array($title . ' (' . $i . ')', $questionTitles)) {
3717  $i++;
3718  }
3719 
3720  $title .= ' (' . $i . ')';
3721 
3722  $questionTitles[] = $title;
3723 
3724  $new_id = $question->object->duplicate(false, $title);
3725 
3726  $clone = assQuestion::_instanciateQuestionGUI($new_id);
3727  $clone->object->setObjId($this->object->getId());
3728  $clone->object->saveToDb();
3729 
3730  $this->object->insertQuestion($this->testQuestionSetConfigFactory->getQuestionSetConfig(), $new_id, true);
3731 
3732  $copy_count++;
3733  }
3734  }
3735 
3736  ilUtil::sendSuccess($this->lng->txt('copy_questions_success'), true);
3737 
3738  $this->ctrl->redirect($this, 'questions');
3739  }
global $DIC
Definition: saml.php:7
static & _instanciateQuestionGUI($question_id)
Creates an instance of a question gui with a given question id.
if(!array_key_exists('StateId', $_REQUEST)) $id
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:

◆ copyQuestionsToPool()

ilObjTestGUI::copyQuestionsToPool (   $questionIds,
  $qplId 
)

Definition at line 3211 of file class.ilObjTestGUI.php.

References $result, and copyQuestionToPool().

Referenced by copyAndLinkQuestionsToPoolObject(), and copyQuestionsToPoolObject().

3212  {
3213  $newIds = array();
3214  foreach ($questionIds as $q_id) {
3215  $newId = $this->copyQuestionToPool($q_id, $qplId);
3216  $newIds[$q_id] = $newId;
3217  }
3218 
3219  $result = new stdClass();
3220  $result->ids = $newIds;
3221  $result->qpoolid = $qplId;
3222 
3223  return $result;
3224  }
$result
copyQuestionToPool($sourceQuestionId, $targetParentId)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyQuestionsToPoolObject()

ilObjTestGUI::copyQuestionsToPoolObject ( )

Definition at line 3205 of file class.ilObjTestGUI.php.

References copyQuestionsToPool().

3206  {
3207  $this->copyQuestionsToPool($_REQUEST['q_id'], $_REQUEST['sel_qpl']);
3208  $this->ctrl->redirect($this, 'questions');
3209  }
copyQuestionsToPool($questionIds, $qplId)
+ Here is the call graph for this function:

◆ copyQuestionToPool()

ilObjTestGUI::copyQuestionToPool (   $sourceQuestionId,
  $targetParentId 
)

Definition at line 3226 of file class.ilObjTestGUI.php.

References assQuestion\instantiateQuestionGUI().

Referenced by copyQuestionsToPool().

3227  {
3228  require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
3229  $question_gui = assQuestion::instantiateQuestionGUI($sourceQuestionId);
3230 
3231  $newtitle = $question_gui->object->getTitle();
3232  if ($question_gui->object->questionTitleExists($targetParentId, $question_gui->object->getTitle())) {
3233  $counter = 2;
3234  while ($question_gui->object->questionTitleExists($targetParentId, $question_gui->object->getTitle() . " ($counter)")) {
3235  $counter++;
3236  }
3237  $newtitle = $question_gui->object->getTitle() . " ($counter)";
3238  }
3239 
3240  return $question_gui->object->createNewOriginalFromThisDuplicate($targetParentId, $newtitle);
3241  }
static instantiateQuestionGUI($a_question_id)
Creates an instance of a question gui with a given question id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyToQuestionpoolObject()

ilObjTestGUI::copyToQuestionpoolObject ( )

Definition at line 3296 of file class.ilObjTestGUI.php.

References createQuestionpoolTargetObject().

3297  {
3298  $this->createQuestionpoolTargetObject('copyQuestionsToPool');
3299  }
createQuestionpoolTargetObject($cmd)
Called when a new question should be created from a test Important: $cmd may be overwritten if no que...
+ Here is the call graph for this function:

◆ createQuestionObject()

ilObjTestGUI::createQuestionObject ( )

Called when a new question should be created from a test.

Called when a new question should be created from a test

public

Definition at line 1596 of file class.ilObjTestGUI.php.

References $DIC, $form, $ilCtrl, $ilUser, $key, ilObjectGUI\$lng, $name, ilObjectGUI\$tpl, ilObjQuestionPool\_getAvailableQuestionpools(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT, ilRadioGroupInputGUI\addOption(), getTabsManager(), ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled(), ilUtil\redirect(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), and ilTestTabsManager\SUBTAB_ID_QST_LIST_VIEW.

Referenced by executeCreateQuestionObject().

1597  {
1598  global $DIC;
1599  $ilUser = $DIC['ilUser'];
1600  $this->getTabsManager()->getQuestionsSubTabs();
1602  //$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_qpl_select.html", "Modules/Test");
1603  $questionpools = &$this->object->getAvailableQuestionpools(false, false, false, true, false, "write");
1604 
1605  if ($this->object->getPoolUsage()) {
1606  global $DIC;
1607  $lng = $DIC['lng'];
1608  $ilCtrl = $DIC['ilCtrl'];
1609  $tpl = $DIC['tpl'];
1610 
1611  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
1612 
1613  $form = new ilPropertyFormGUI();
1614  $form->setFormAction($ilCtrl->getFormAction($this, "executeCreateQuestion"));
1615  $form->setTitle($lng->txt("ass_create_question"));
1616  include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
1617 
1618 
1619  $hidden = new ilHiddenInputGUI('sel_question_types');
1620  $hidden->setValue($_REQUEST["sel_question_types"]);
1621  $form->addItem($hidden);
1622 
1623  // content editing mode
1625  $ri = new ilRadioGroupInputGUI($lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
1626 
1627  $ri->addOption(new ilRadioOption(
1628  $lng->txt('tst_add_quest_cont_edit_mode_default'),
1630  ));
1631 
1632  $ri->addOption(new ilRadioOption(
1633  $lng->txt('tst_add_quest_cont_edit_mode_page_object'),
1635  ));
1636 
1638 
1639  $form->addItem($ri, true);
1640  } else {
1641  $hi = new ilHiddenInputGUI("question_content_editing_type");
1643  $form->addItem($hi, true);
1644  }
1645 
1646  // use pool
1647  $usage = new ilRadioGroupInputGUI($this->lng->txt("assessment_pool_selection"), "usage");
1648  $usage->setRequired(true);
1649  $no_pool = new ilRadioOption($this->lng->txt("assessment_no_pool"), 1);
1650  $usage->addOption($no_pool);
1651  $existing_pool = new ilRadioOption($this->lng->txt("assessment_existing_pool"), 3);
1652  $usage->addOption($existing_pool);
1653  $new_pool = new ilRadioOption($this->lng->txt("assessment_new_pool"), 2);
1654  $usage->addOption($new_pool);
1655  $form->addItem($usage);
1656 
1657  $usage->setValue(1);
1658 
1659  $questionpools = ilObjQuestionPool::_getAvailableQuestionpools(false, false, true, false, false, "write");
1660  $pools_data = array();
1661  foreach ($questionpools as $key => $p) {
1662  $pools_data[$key] = $p['title'];
1663  }
1664  $pools = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "sel_qpl");
1665  $pools->setOptions($pools_data);
1666  $existing_pool->addSubItem($pools);
1667 
1668 
1669  $this->lng->loadLanguageModule('rbac');
1670  $name = new ilTextInputGUI($this->lng->txt("rbac_create_qpl"), "txt_qpl");
1671  $name->setSize(50);
1672  $name->setMaxLength(50);
1673  $new_pool->addSubItem($name);
1674 
1675  $form->addCommandButton("executeCreateQuestion", $lng->txt("submit"));
1676  $form->addCommandButton("cancelCreateQuestion", $lng->txt("cancel"));
1677 
1678  return $this->tpl->setVariable('ADM_CONTENT', $form->getHTML());
1679  } else {
1680  global $DIC;
1681  $ilCtrl = $DIC['ilCtrl'];
1682 
1683  $ilCtrl->setParameterByClass('iltestexpresspageobjectgui', 'sel_question_types', $_REQUEST["sel_question_types"]);
1684  $ilCtrl->setParameterByClass('iltestexpresspageobjectgui', 'add_quest_cont_edit_mode', $_REQUEST["add_quest_cont_edit_mode"]);
1685  $link = $ilCtrl->getLinkTargetByClass('iltestexpresspageobjectgui', 'handleToolbarCommand', '', false, false);
1686  ilUtil::redirect($link);
1687  }
1688  }
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.
This class represents a selection list property in a property form.
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
global $ilCtrl
Definition: ilias.php:18
This class represents a hidden form property in a property form.
This class represents a property in a property form.
addOption($a_option)
Add Option.
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
$ilUser
Definition: imgupload.php:18
setOptions($a_options)
Set Options.
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
static redirect($a_script)
$key
Definition: croninfo.php:18
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createQuestionPool()

ilObjTestGUI::createQuestionPool (   $name = "dummy",
  $description = "" 
)

Creates a new questionpool and returns the reference id.

Creates a new questionpool and returns the reference id

Returns
integer Reference id of the newly created questionpool public

Definition at line 1358 of file class.ilObjTestGUI.php.

References $description, $DIC, $name, and ilObjectGUI\$tree.

Referenced by createQuestionPoolAndCopyObject(), and executeCreateQuestionObject().

1359  {
1360  global $DIC;
1361  $tree = $DIC['tree'];
1362  $parent_ref = $tree->getParentId($this->object->getRefId());
1363  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
1364  $qpl = new ilObjQuestionPool();
1365  $qpl->setType("qpl");
1366  $qpl->setTitle($name);
1367  $qpl->setDescription($description);
1368  $qpl->create();
1369  $qpl->createReference();
1370  $qpl->putInTree($parent_ref);
1371  $qpl->setPermissions($parent_ref);
1372  $qpl->setOnline(1); // must be online to be available
1373  $qpl->saveToDb();
1374  return $qpl->getRefId();
1375  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ createQuestionPoolAndCopyObject()

ilObjTestGUI::createQuestionPoolAndCopyObject ( )

Definition at line 3336 of file class.ilObjTestGUI.php.

References $form, ilObjectGUI\$ref_id, $title, copyAndLinkQuestionsToPoolObject(), copyAndLinkToQuestionpoolObject(), createQuestionPool(), getQuestionpoolCreationForm(), and ilUtil\sendInfo().

3337  {
3339 
3340  if ($_REQUEST['title']) {
3341  $title = $_REQUEST['title'];
3342  } else {
3343  $title = $_REQUEST['txt_qpl'];
3344  }
3345 
3346  if (!$title) {
3347  ilUtil::sendInfo($this->lng->txt("questionpool_not_entered"));
3348  return $this->copyAndLinkToQuestionpoolObject();
3349  }
3350 
3351  $ref_id = $this->createQuestionPool($title, $_REQUEST['description']);
3352  $_REQUEST['sel_qpl'] = $ref_id;
3353 
3354  //if ($_REQUEST['link'])
3355  //{
3357  //}
3358  //else
3359  //{
3360  // $this->copyQuestionsToPoolObject();
3361  //}
3362  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
copyAndLinkQuestionsToPoolObject()
ilObjectDataCache $ilObjDataCache
if(isset($_POST['submit'])) $form
createQuestionPool($name="dummy", $description="")
Creates a new questionpool and returns the reference id.
+ Here is the call graph for this function:

◆ createQuestionpoolTargetObject()

ilObjTestGUI::createQuestionpoolTargetObject (   $cmd)

Called when a new question should be created from a test Important: $cmd may be overwritten if no question pool is available.

public

Definition at line 3370 of file class.ilObjTestGUI.php.

References $DIC, $id, $ilUser, $key, getQuestionpoolCreationForm(), getTabsManager(), and ilTestTabsManager\SUBTAB_ID_QST_LIST_VIEW.

Referenced by copyAndLinkToQuestionpoolObject(), and copyToQuestionpoolObject().

3371  {
3372  global $DIC;
3373  $ilUser = $DIC['ilUser'];
3374  $ilTabs = $DIC['ilTabs'];
3375  $this->getTabsManager()->getQuestionsSubTabs();
3377 
3378  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_qpl_select_copy.html", "Modules/Test");
3379  $questionpools = &$this->object->getAvailableQuestionpools(false, false, false, true, false, "write");
3380  if (count($questionpools) == 0) {
3381  $this->tpl->setCurrentBlock("option");
3382  $this->tpl->setVariable("VALUE_QPL", "");
3383  $this->tpl->parseCurrentBlock();
3384  } else {
3385  foreach ($questionpools as $key => $value) {
3386  $this->tpl->setCurrentBlock("option");
3387  $this->tpl->setVariable("VALUE_OPTION", $key);
3388  $this->tpl->setVariable("TEXT_OPTION", $value["title"]);
3389  $this->tpl->parseCurrentBlock();
3390  }
3391  }
3392 
3393  if (isset($_REQUEST['q_id']) && is_array($_REQUEST['q_id'])) {
3394  foreach ($_REQUEST['q_id'] as $id) {
3395  $this->tpl->setCurrentBlock("hidden");
3396  $this->tpl->setVariable("HIDDEN_NAME", "q_id[]");
3397  $this->tpl->setVariable("HIDDEN_VALUE", $id);
3398  $this->tpl->parseCurrentBlock();
3399  $this->tpl->setCurrentBlock("adm_content");
3400  }
3401  }
3402  $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
3403 
3404  if (count($questionpools) == 0) {
3405  $this->tpl->setVariable("TXT_QPL_SELECT", $this->lng->txt("tst_enter_questionpool"));
3406  $cmd = 'createQuestionPoolAndCopy';
3407  } else {
3408  $this->tpl->setVariable("TXT_QPL_SELECT", $this->lng->txt("tst_select_questionpool"));
3409  }
3410 
3411  $this->tpl->setVariable("CMD_SUBMIT", $cmd);
3412  $this->tpl->setVariable("BTN_SUBMIT", $this->lng->txt("submit"));
3413  $this->tpl->setVariable("BTN_CANCEL", $this->lng->txt("cancel"));
3414 
3415  $createForm = $this->getQuestionpoolCreationForm();
3416  switch ($cmd) {
3417  case 'copyAndLinkQuestionsToPool':
3418  $hidden = new ilHiddenInputGUI('link');
3419  $hidden->setValue(1);
3420  $createForm->addItem($hidden);
3421  break;
3422  case 'copyQuestionsToPool':
3423  break;
3424  }
3425  $createForm->setFormAction($this->ctrl->getFormAction($this));
3426 
3427  $this->tpl->parseCurrentBlock();
3428  }
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
This class represents a hidden form property in a property form.
$ilUser
Definition: imgupload.php:18
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createRandomSelectionObject()

ilObjTestGUI::createRandomSelectionObject ( )

Offers a random selection for insertion in the test.

Offers a random selection for insertion in the test

public

Definition at line 1430 of file class.ilObjTestGUI.php.

References $_POST, assQuestion\_getQuestionTypeName(), getTabsManager(), and ilTestTabsManager\SUBTAB_ID_QST_LIST_VIEW.

1431  {
1432  $this->getTabsManager()->getQuestionsSubTabs();
1434  $question_array = $this->object->randomSelectQuestions($_POST["nr_of_questions"], $_POST["sel_qpl"]);
1435  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_random_question_offer.html", "Modules/Test");
1436  $color_class = array("tblrow1", "tblrow2");
1437  $counter = 0;
1438  $questionpools = &$this->object->getAvailableQuestionpools(true);
1439  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
1440  foreach ($question_array as $question_id) {
1441  $dataset = $this->object->getQuestionDataset($question_id);
1442  $this->tpl->setCurrentBlock("QTab");
1443  $this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
1444  $this->tpl->setVariable("QUESTION_TITLE", $dataset->title);
1445  $this->tpl->setVariable("QUESTION_COMMENT", $dataset->description);
1446  $this->tpl->setVariable("QUESTION_TYPE", assQuestion::_getQuestionTypeName($dataset->type_tag));
1447  $this->tpl->setVariable("QUESTION_AUTHOR", $dataset->author);
1448  $this->tpl->setVariable("QUESTION_POOL", $questionpools[$dataset->obj_fi]["title"]);
1449  $this->tpl->parseCurrentBlock();
1450  $counter++;
1451  }
1452  if (count($question_array) == 0) {
1453  $this->tpl->setCurrentBlock("Emptytable");
1454  $this->tpl->setVariable("TEXT_NO_QUESTIONS_AVAILABLE", $this->lng->txt("no_questions_available"));
1455  $this->tpl->parseCurrentBlock();
1456  } else {
1457  $this->tpl->setCurrentBlock("Selectionbuttons");
1458  $this->tpl->setVariable("BTN_YES", $this->lng->txt("random_accept_sample"));
1459  $this->tpl->setVariable("BTN_NO", $this->lng->txt("random_another_sample"));
1460  $this->tpl->parseCurrentBlock();
1461  }
1462  $chosen_questions = join($question_array, ",");
1463  $this->tpl->setCurrentBlock("adm_content");
1464  $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
1465  $this->tpl->setVariable("QUESTION_TITLE", $this->lng->txt("tst_question_title"));
1466  $this->tpl->setVariable("QUESTION_COMMENT", $this->lng->txt("description"));
1467  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("tst_question_type"));
1468  $this->tpl->setVariable("QUESTION_AUTHOR", $this->lng->txt("author"));
1469  $this->tpl->setVariable("QUESTION_POOL", $this->lng->txt("qpl"));
1470  $this->tpl->setVariable("VALUE_CHOSEN_QUESTIONS", $chosen_questions);
1471  $this->tpl->setVariable("VALUE_QUESTIONPOOL_SELECTION", $_POST["sel_qpl"]);
1472  $this->tpl->setVariable("VALUE_NR_OF_QUESTIONS", $_POST["nr_of_questions"]);
1473  $this->tpl->setVariable("TEXT_QUESTION_OFFER", $this->lng->txt("tst_question_offer"));
1474  $this->tpl->setVariable("BTN_CANCEL", $this->lng->txt("cancel"));
1475  $this->tpl->parseCurrentBlock();
1476  }
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteDefaultsObject()

ilObjTestGUI::deleteDefaultsObject ( )

Deletes selected test defaults.

Definition at line 2536 of file class.ilObjTestGUI.php.

References $_POST, and ilUtil\sendInfo().

2537  {
2538  if (isset($_POST['chb_defaults']) && is_array($_POST['chb_defaults']) && count($_POST['chb_defaults'])) {
2539  foreach ($_POST['chb_defaults'] as $test_default_id) {
2540  $this->object->deleteDefaults($test_default_id);
2541  }
2542  } else {
2543  ilUtil::sendInfo($this->lng->txt('select_one'));
2544  }
2545  $this->defaultsObject();
2546  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ determineObjectiveOrientedContainer()

ilObjTestGUI::determineObjectiveOrientedContainer ( )
protected

Definition at line 3741 of file class.ilObjTestGUI.php.

References ilObject\_getAllReferences(), and ilLOSettings\isObjectiveTest().

Referenced by executeCommand().

3742  {
3743  require_once 'Modules/Course/classes/Objectives/class.ilLOSettings.php';
3744  $containerObjId = (int) ilLOSettings::isObjectiveTest($this->ref_id);
3745 
3746  $containerRefId = current(ilObject::_getAllReferences($containerObjId));
3747 
3748  $this->objectiveOrientedContainer->setObjId($containerObjId);
3749  $this->objectiveOrientedContainer->setRefId($containerRefId);
3750  }
static isObjectiveTest($a_trst_ref_id)
Check if test ref_id is used in an objective course.
static _getAllReferences($a_id)
get all reference ids of object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ download_paragraphObject()

ilObjTestGUI::download_paragraphObject ( )

download source code paragraph

Definition at line 1306 of file class.ilObjTestGUI.php.

References $_GET, and exit.

1307  {
1308  include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php");
1309  $pg_obj = new ilAssQuestionPage($_GET["pg_id"]);
1310  $pg_obj->send_paragraph($_GET["par_id"], $_GET["downloadtitle"]);
1311  exit;
1312  }
$_GET["client_id"]
Question page object.
exit
Definition: backend.php:16

◆ downloadFileObject()

ilObjTestGUI::downloadFileObject ( )

download file

Definition at line 1284 of file class.ilObjTestGUI.php.

References $_GET, and exit.

1285  {
1286  $file = explode("_", $_GET["file_id"]);
1287  include_once("./Modules/File/classes/class.ilObjFile.php");
1288  $fileObj = new ilObjFile($file[count($file) - 1], false);
1289  $fileObj->sendFile();
1290  exit;
1291  }
$_GET["client_id"]
exit
Definition: backend.php:16

◆ executeCommand()

ilObjTestGUI::executeCommand ( )

execute command

Definition at line 144 of file class.ilObjTestGUI.php.

References $_GET, $DIC, $GLOBALS, $ilCtrl, $ilDB, ilObjectGUI\$ilErr, $ilUser, ilObjectGUI\$lng, $object, $ret, ilObjectGUI\$tpl, ilObjectGUI\$tree, assQuestionGUI\_getQuestionGUI(), ilObjectGUI\addHeaderAction(), buildPageViewToolbar(), determineObjectiveOrientedContainer(), assQuestionGUI\EDIT_CONTEXT_AUTHORING, fetchAuthoringQuestionIdParameter(), forwardToEvaluationGUI(), ilObjStyleSheet\getContentStylePath(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getObjectiveOrientedContainer(), assQuestion\getQuestionTypeFromDb(), ilObjStyleSheet\getSyntaxStylePath(), getTabsManager(), getTestAccess(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ilObjectGUI\prepareOutput(), prepareSubGuiOutput(), questionsObject(), assQuestionGUI\RENDER_PURPOSE_PREVIEW, ilUtil\sendInfo(), ilLTIProviderObjectSettingGUI\setCustomRolesForSelection(), ilTestDashboardGUI\setTestAccess(), ilTestResultsGUI\setTestAccess(), ilTestTabsManager\SUBTAB_ID_QST_PAGE_VIEW, ilTestTabsManager\TAB_ID_EXPORT, ilTestTabsManager\TAB_ID_LEARNING_PROGRESS, ilTestTabsManager\TAB_ID_META_DATA, ilTestTabsManager\TAB_ID_PERMISSIONS, ilTestTabsManager\TAB_ID_SETTINGS, and trackTestObjectReadEvent().

145  {
146  global $DIC; /* @var ILIAS\DI\Container $DIC */
147  $ilAccess = $DIC['ilAccess'];
148  $ilNavigationHistory = $DIC['ilNavigationHistory'];
149  $ilCtrl = $DIC['ilCtrl'];
150  $ilErr = $DIC['ilErr'];
151  $tpl = $DIC['tpl'];
152  $lng = $DIC['lng'];
153  $ilTabs = $DIC['ilTabs'];
154  $ilPluginAdmin = $DIC['ilPluginAdmin'];
155  $ilDB = $DIC['ilDB'];
156  $tree = $DIC['tree'];
157  $ilias = $DIC['ilias'];
158  $ilUser = $DIC['ilUser'];
159 
160  if ((!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))) {
161  $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
162  }
163 
164  $cmd = $this->ctrl->getCmd("infoScreen");
165 
166  $cmdsDisabledDueToOfflineStatus = array(
167  'resumePlayer', 'resumePlayer', 'outUserResultsOverview', 'outUserListOfAnswerPasses'
168  );
169 
170  if (!$this->getCreationMode() && $this->object->getOfflineStatus() && in_array($cmd, $cmdsDisabledDueToOfflineStatus)) {
171  $cmd = 'infoScreen';
172  }
173 
174  $next_class = $this->ctrl->getNextClass($this);
175  $this->ctrl->setReturn($this, "infoScreen");
176 
177  if (method_exists($this->object, "getTestStyleLocation")) {
178  $this->tpl->addCss($this->object->getTestStyleLocation("output"), "screen");
179  }
180 
181  // add entry to navigation history
182  if (!$this->getCreationMode() &&
183  $ilAccess->checkAccess("read", "", $_GET["ref_id"])
184  ) {
185  $ilNavigationHistory->addItem(
186  $_GET["ref_id"],
187  "ilias.php?baseClass=ilObjTestGUI&cmd=infoScreen&ref_id=" . $_GET["ref_id"],
188  "tst"
189  );
190  }
191 
192  // elba hack for storing question id for inserting new question after
193  if ($_REQUEST['prev_qid']) {
194  global $___prev_question_id;
195  $___prev_question_id = $_REQUEST['prev_qid'];
196  $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']);
197  }
198 
199  if (!$this->getCreationMode() && $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken()) {
200  if (!$this->testQuestionSetConfigFactory->getQuestionSetConfig()->isValidRequestOnBrokenQuestionSetDepencies($next_class, $cmd)) {
201  $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
202  }
203  }
204 
206 
207  switch ($next_class) {
208  case 'illtiproviderobjectsettinggui':
209  $this->prepareOutput();
210  $this->addHeaderAction();
211  $this->tabsManager->getSettingsSubTabs();
212  $GLOBALS['DIC']->tabs()->activateTab('settings');
213  $GLOBALS['DIC']->tabs()->activateSubTab('lti_provider');
214  $lti_gui = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
215  $lti_gui->setCustomRolesForSelection($GLOBALS['DIC']->rbac()->review()->getLocalRoles($this->object->getRefId()));
216  $lti_gui->offerLTIRolesForSelection(false);
217  $this->ctrl->forwardCommand($lti_gui);
218  break;
219 
220 
221  case 'iltestexportgui':
222  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
223  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
224  }
225 
226  $this->prepareOutput();
227  $this->addHeaderAction();
228  $DIC->tabs()->activateTab(ilTestTabsManager::TAB_ID_EXPORT);
229  require_once 'Modules/Test/classes/class.ilTestExportGUI.php';
230  $ilCtrl->forwardCommand(new ilTestExportGUI($this));
231  break;
232 
233  case "ilinfoscreengui":
234  $this->prepareOutput();
235  $this->addHeaderAction();
236  $this->infoScreen(); // forwards command
237  break;
238  case 'ilobjectmetadatagui':
239  if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
240  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
241  }
242 
243  $this->prepareOutput();
244  $this->addHeaderAction();
245  $DIC->tabs()->activateTab(ilTestTabsManager::TAB_ID_META_DATA);
246  include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
247  $md_gui = new ilObjectMetaDataGUI($this->object);
248  $this->ctrl->forwardCommand($md_gui);
249  break;
250 
251  case 'iltestdashboardgui':
252 
253  $this->prepareOutput();
254  $this->addHeaderAction();
255 
256  require_once 'Modules/Test/classes/class.ilTestDashboardGUI.php';
257 
258  $gui = new ilTestDashboardGUI(
259  $this->object,
260  $this->testQuestionSetConfigFactory->getQuestionSetConfig()
261  );
262 
263  $gui->setTestAccess($this->getTestAccess());
264  $gui->setTestTabs($this->getTabsManager());
265  $gui->setObjectiveParent($this->getObjectiveOrientedContainer());
266 
267  $this->ctrl->forwardCommand($gui);
268  break;
269 
270  case 'iltestresultsgui':
271 
272  $this->prepareOutput();
273  $this->addHeaderAction();
274 
275  require_once 'Modules/Test/classes/class.ilTestResultsGUI.php';
276 
277  $gui = new ilTestResultsGUI(
278  $this->object,
279  $this->testQuestionSetConfigFactory->getQuestionSetConfig()
280  );
281 
282  $gui->setTestAccess($this->getTestAccess());
283  $gui->setTestSession($this->testSessionFactory->getSession());
284  $gui->setTestTabs($this->getTabsManager());
285  $gui->setObjectiveParent($this->getObjectiveOrientedContainer());
286 
287  $this->ctrl->forwardCommand($gui);
288  break;
289 
290  case "iltestplayerfixedquestionsetgui":
291  $this->trackTestObjectReadEvent();
292  require_once "./Modules/Test/classes/class.ilTestPlayerFixedQuestionSetGUI.php";
293  if (!$this->object->getKioskMode()) {
294  $this->prepareOutput();
295  }
296  $gui = new ilTestPlayerFixedQuestionSetGUI($this->object);
297  $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
298  $this->ctrl->forwardCommand($gui);
299  break;
300 
301  case "iltestplayerrandomquestionsetgui":
302  $this->trackTestObjectReadEvent();
303  require_once "./Modules/Test/classes/class.ilTestPlayerRandomQuestionSetGUI.php";
304  if (!$this->object->getKioskMode()) {
305  $this->prepareOutput();
306  }
307  $gui = new ilTestPlayerRandomQuestionSetGUI($this->object);
308  $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
309  $this->ctrl->forwardCommand($gui);
310  break;
311 
312  case "iltestplayerdynamicquestionsetgui":
313  $this->trackTestObjectReadEvent();
314  require_once "./Modules/Test/classes/class.ilTestPlayerDynamicQuestionSetGUI.php";
315  if (!$this->object->getKioskMode()) {
316  $this->prepareOutput();
317  }
318  $gui = new ilTestPlayerDynamicQuestionSetGUI($this->object);
319  $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
320  $this->ctrl->forwardCommand($gui);
321  break;
322 
323  case "iltestevaluationgui":
324  $this->forwardToEvaluationGUI();
325  break;
326 
327  case "iltestevalobjectiveorientedgui":
328  $this->forwardToEvalObjectiveOrientedGUI();
329  break;
330 
331  case "iltestservicegui":
332  $this->prepareOutput();
333  $this->addHeaderAction();
334  require_once "./Modules/Test/classes/class.ilTestServiceGUI.php";
335  $serviceGUI = new ilTestServiceGUI($this->object);
336  $this->ctrl->forwardCommand($serviceGUI);
337  break;
338 
339  case 'ilpermissiongui':
340  $this->prepareOutput();
341  $this->addHeaderAction();
342  $DIC->tabs()->activateTab(ilTestTabsManager::TAB_ID_PERMISSIONS);
343  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
344  $perm_gui = new ilPermissionGUI($this);
345  $ret = $this->ctrl->forwardCommand($perm_gui);
346  break;
347 
348  case "illearningprogressgui":
349  $this->prepareOutput();
350  $this->addHeaderAction();
351  $DIC->tabs()->activateTab(ilTestTabsManager::TAB_ID_LEARNING_PROGRESS);
352  require_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
353  $new_gui = new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $this->object->getRefId());
354  $this->ctrl->forwardCommand($new_gui);
355 
356  break;
357 
358  case "ilcertificategui":
359  $this->prepareOutput();
360  $this->addHeaderAction();
361 
362  $DIC->tabs()->activateTab(ilTestTabsManager::TAB_ID_SETTINGS);
363 
364  $guiFactory = new ilCertificateGUIFactory();
365  $output_gui = $guiFactory->create($this->object);
366 
367  $this->ctrl->forwardCommand($output_gui);
368  break;
369 
370  case "iltestscoringgui":
371  $this->prepareOutput();
372  $this->addHeaderAction();
373  require_once "./Modules/Test/classes/class.ilTestScoringGUI.php";
374  $output_gui = new ilTestScoringGUI($this->object);
375  $output_gui->setTestAccess($this->getTestAccess());
376  $this->ctrl->forwardCommand($output_gui);
377  break;
378 
379  case 'ilmarkschemagui':
380  if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
381  ilUtil::sendInfo($this->lng->txt('cannot_edit_test'), true);
382  $this->ctrl->redirect($this, 'infoScreen');
383  }
384  $this->prepareOutput();
385  $this->addHeaderAction();
386  require_once 'Modules/Test/classes/class.ilMarkSchemaGUI.php';
387  $mark_schema_gui = new ilMarkSchemaGUI($this->object);
388  $this->ctrl->forwardCommand($mark_schema_gui);
389  break;
390 
391  case 'iltestscoringbyquestionsgui':
392  $this->prepareOutput();
393  $this->addHeaderAction();
394  include_once 'Modules/Test/classes/class.ilTestScoringByQuestionsGUI.php';
395  $output_gui = new ilTestScoringByQuestionsGUI($this->object);
396  $output_gui->setTestAccess($this->getTestAccess());
397  $this->ctrl->forwardCommand($output_gui);
398  break;
399 
400  case 'ilobjtestsettingsgeneralgui':
401  $this->prepareOutput();
402  $this->addHeaderAction();
403  require_once 'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
404  $gui = new ilObjTestSettingsGeneralGUI(
405  $this->ctrl,
406  $ilAccess,
407  $this->lng,
408  $this->tpl,
409  $this->tree,
410  $ilDB,
411  $ilPluginAdmin,
412  $ilUser,
413  $this
414  );
415  $this->ctrl->forwardCommand($gui);
416  break;
417 
418  case 'ilobjtestsettingsscoringresultsgui':
419  $this->prepareOutput();
420  $this->addHeaderAction();
421  require_once 'Modules/Test/classes/class.ilObjTestSettingsScoringResultsGUI.php';
423  $this->ctrl,
424  $ilAccess,
425  $this->lng,
426  $this->tpl,
427  $this->tree,
428  $ilDB,
429  $ilPluginAdmin,
430  $this
431  );
432  $this->ctrl->forwardCommand($gui);
433  break;
434 
435  case 'ilobjtestfixedquestionsetconfiggui':
436  $this->prepareOutput();
437  $this->addHeaderAction();
438  require_once 'Modules/Test/classes/class.ilTestFixedQuestionSetConfigGUI.php';
439  $gui = new ilObjTestDynamicQuestionSetConfigGUI($this->ctrl, $ilAccess, $ilTabs, $this->lng, $this->tpl, $ilDB, $tree, $ilPluginAdmin, $this->object);
440  $this->ctrl->forwardCommand($gui);
441  break;
442 
443  case 'iltestrandomquestionsetconfiggui':
444  $this->prepareOutput();
445  $this->addHeaderAction();
446  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetConfigGUI.php';
447  $gui = new ilTestRandomQuestionSetConfigGUI($this->ctrl, $ilAccess, $ilTabs, $this->lng, $this->tpl, $ilDB, $tree, $ilPluginAdmin, $this->object);
448  $this->ctrl->forwardCommand($gui);
449  break;
450 
451  case 'ilobjtestdynamicquestionsetconfiggui':
452  $this->prepareOutput();
453  $this->addHeaderAction();
454  require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfigGUI.php';
455  $gui = new ilObjTestDynamicQuestionSetConfigGUI($this->ctrl, $ilAccess, $ilTabs, $this->lng, $this->tpl, $ilDB, $tree, $ilPluginAdmin, $this->object);
456  $this->ctrl->forwardCommand($gui);
457  break;
458 
459  case 'iltestquestionbrowsertablegui':
460  $this->prepareOutput();
461  $this->addHeaderAction();
462  require_once 'Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php';
463  $gui = new ilTestQuestionBrowserTableGUI($this->ctrl, $this->tpl, $ilTabs, $this->lng, $tree, $ilDB, $ilPluginAdmin, $this->object, $ilAccess);
464  $gui->setWriteAccess($ilAccess->checkAccess("write", "", $this->ref_id));
465  $gui->init();
466  $this->ctrl->forwardCommand($gui);
467  break;
468 
469  case 'iltestskilladministrationgui':
470  $this->prepareOutput();
471  $this->addHeaderAction();
472  require_once 'Modules/Test/classes/class.ilTestSkillAdministrationGUI.php';
473  $gui = new ilTestSkillAdministrationGUI($ilias, $this->ctrl, $ilAccess, $ilTabs, $this->tpl, $this->lng, $ilDB, $tree, $ilPluginAdmin, $this->object, $this->ref_id);
474  $this->ctrl->forwardCommand($gui);
475  break;
476 
477  case 'ilobjectcopygui':
478  $this->prepareOutput();
479  $this->addHeaderAction();
480  require_once './Services/Object/classes/class.ilObjectCopyGUI.php';
481  $cp = new ilObjectCopyGUI($this);
482  $cp->setType('tst');
483  $this->ctrl->forwardCommand($cp);
484  break;
485 
486  case 'ilpageeditorgui':
487  case 'iltestexpresspageobjectgui':
488 
489  $this->getTabsManager()->getQuestionsSubTabs();
491 
492  require_once 'Modules/TestQuestionPool/classes/class.ilAssIncompleteQuestionPurger.php';
493  $incompleteQuestionPurger = new ilAssIncompleteQuestionPurger($ilDB);
494  $incompleteQuestionPurger->setOwnerId($ilUser->getId());
495  $incompleteQuestionPurger->purge();
496 
497  try {
498  $qid = $this->fetchAuthoringQuestionIdParameter();
499  } catch (ilTestException $e) {
500  $qid = 0;
501  }
502 
503  $this->prepareOutput();
504  if (!in_array($cmd, array('addQuestion', 'browseForQuestions'))) {
505  $this->buildPageViewToolbar($qid);
506  }
507 
508  if (!$qid || in_array($cmd, array('insertQuestions', 'browseForQuestions'))) {
509  require_once "./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php";
510  $pageObject = new ilTestExpressPageObjectGUI(0);
511  $pageObject->test_object = $this->object;
512  $ret = &$this->ctrl->forwardCommand($pageObject);
513  break;
514  }
515  require_once "./Services/Style/Content/classes/class.ilObjStyleSheet.php";
516  $this->tpl->setCurrentBlock("ContentStyle");
517  $this->tpl->setVariable(
518  "LOCATION_CONTENT_STYLESHEET",
520  );
521  $this->tpl->parseCurrentBlock();
522 
523  // syntax style
524  $this->tpl->setCurrentBlock("SyntaxStyle");
525  $this->tpl->setVariable(
526  "LOCATION_SYNTAX_STYLESHEET",
528  );
529  $this->tpl->parseCurrentBlock();
530  require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
531 
532  $q_gui = assQuestionGUI::_getQuestionGUI("", $qid);
533  if (!($q_gui instanceof assQuestionGUI)) {
534  $this->ctrl->setParameterByClass('iltestexpresspageobjectgui', 'q_id', '');
535  $this->ctrl->redirectByClass('iltestexpresspageobjectgui', $this->ctrl->getCmd());
536  }
537 
538  $q_gui->setRenderPurpose(assQuestionGUI::RENDER_PURPOSE_PREVIEW);
539 
540  $q_gui->outAdditionalOutput();
541  $q_gui->object->setObjId($this->object->getId());
542 
543  $q_gui->setTargetGuiClass(null);
544  $q_gui->setQuestionActionCmd(null);
545 
546  $question = $q_gui->object;
547  $this->ctrl->saveParameter($this, "q_id");
548 
549  #$this->lng->loadLanguageModule("content");
550  $this->ctrl->setReturnByClass("ilTestExpressPageObjectGUI", "view");
551  $this->ctrl->setReturn($this, "questions");
552 
553  require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php";
554  require_once "./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php";
555 
556  $page_gui = new ilTestExpressPageObjectGUI($qid);
557  $page_gui->test_object = $this->object;
558  $page_gui->setEditPreview(true);
559  $page_gui->setEnabledTabs(false);
560  if (strlen($this->ctrl->getCmd()) == 0) {
561  $this->ctrl->setCmdClass(get_class($page_gui));
562  $this->ctrl->setCmd("preview");
563  }
564 
565  $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(true)));
566  $page_gui->setTemplateTargetVar("ADM_CONTENT");
567 
568  $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? "edit" : 'preview');
569 
570  $page_gui->setHeader($question->getTitle());
571  $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile"));
572  $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "fullscreen"));
573  $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
574  $page_gui->setPresentationTitle($question->getTitle() . ' [' . $this->lng->txt('question_id_short') . ': ' . $question->getId() . ']');
575  $ret = &$this->ctrl->forwardCommand($page_gui);
576 
577  global $DIC;
578  $ilTabs = $DIC['ilTabs'];
579  $ilTabs->activateTab('assQuestions');
580 
581  $this->tpl->setContent($ret);
582  break;
583 
584  case 'ilassquestionpreviewgui':
585 
586  $this->prepareOutput();
587 
588  $this->ctrl->saveParameter($this, "q_id");
589 
590  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
591  $gui = new ilAssQuestionPreviewGUI($this->ctrl, $this->tabs_gui, $this->tpl, $this->lng, $ilDB, $ilUser);
592 
593  $gui->initQuestion($this->fetchAuthoringQuestionIdParameter(), $this->object->getId());
594  $gui->initPreviewSettings($this->object->getRefId());
595  $gui->initPreviewSession($ilUser->getId(), (int) $_GET['q_id']);
596  $gui->initHintTracking();
597  $gui->initStyleSheets();
598 
599  $this->ctrl->forwardCommand($gui);
600 
601  break;
602 
603  case 'ilassquestionpagegui':
604  $_GET['q_id'] = $this->fetchAuthoringQuestionIdParameter();
605  $this->prepareOutput();
606  require_once 'Modules/Test/classes/class.ilAssQuestionPageCommandForwarder.php';
607  $forwarder = new ilAssQuestionPageCommandForwarder();
608  $forwarder->setTestObj($this->object);
609  $forwarder->forward();
610  break;
611 
612  case 'ilassspecfeedbackpagegui':
613  require_once "./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPageGUI.php";
614  $pg_gui = new ilAssSpecFeedbackPageGUI((int) $_GET["feedback_id"]);
615  $this->ctrl->forwardCommand($pg_gui);
616  break;
617 
618  case 'ilassgenfeedbackpagegui':
619  require_once "./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPageGUI.php";
620  $pg_gui = new ilAssGenFeedbackPageGUI((int) $_GET["feedback_id"]);
621  $this->ctrl->forwardCommand($pg_gui);
622  break;
623 
624  case 'illocalunitconfigurationgui':
625  $this->prepareSubGuiOutput();
626 
627  // set return target
628  $this->ctrl->setReturn($this, "questions");
629 
630  // set context tabs
631  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
633  $questionGUI->object->setObjId($this->object->getId());
634  $questionGUI->setQuestionTabs();
635 
636  require_once 'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php';
637  require_once 'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
638  $gui = new ilLocalUnitConfigurationGUI(
639  new ilUnitConfigurationRepository((int) $_GET['q_id'])
640  );
641  $this->ctrl->forwardCommand($gui);
642  break;
643 
644  case "ilcommonactiondispatchergui":
645  require_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
647  $this->ctrl->forwardCommand($gui);
648  break;
649 
650  case 'ilassquestionhintsgui':
651 
652  $this->prepareSubGuiOutput();
653 
654  // set return target
655  $this->ctrl->setReturn($this, "questions");
656 
657  // set context tabs
658  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
659  $questionGUI = &assQuestionGUI::_getQuestionGUI($q_type, $this->fetchAuthoringQuestionIdParameter());
660  $questionGUI->object->setObjId($this->object->getId());
661  $questionGUI->setQuestionTabs();
662 
663  // forward to ilAssQuestionHintsGUI
664  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
665  $gui = new ilAssQuestionHintsGUI($questionGUI);
666 
667  $gui->setEditingEnabled(
668  $DIC->access()->checkAccess('write', '', $this->object->getRefId())
669  );
670 
671  $ilCtrl->forwardCommand($gui);
672 
673  break;
674 
675  case 'ilassquestionfeedbackeditinggui':
676 
677  $this->prepareSubGuiOutput();
678 
679  // set return target
680  $this->ctrl->setReturn($this, "questions");
681 
682  // set context tabs
683  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
685  $questionGUI->object->setObjId($this->object->getId());
686  $questionGUI->setQuestionTabs();
687 
688  // forward to ilAssQuestionFeedbackGUI
689  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
690  $gui = new ilAssQuestionFeedbackEditingGUI($questionGUI, $ilCtrl, $ilAccess, $tpl, $ilTabs, $lng);
691  $ilCtrl->forwardCommand($gui);
692 
693  break;
694 
695  case 'iltestcorrectionsgui':
696  $this->prepareOutput();
697  require_once './Modules/Test/classes/class.ilTestCorrectionsGUI.php';
698  $gui = new ilTestCorrectionsGUI($DIC, $this->object);
699  $this->ctrl->forwardCommand($gui);
700  break;
701 
702  case '':
703  case 'ilobjtestgui':
704  $this->prepareOutput();
705  $this->addHeaderAction();
706  if ((strcmp($cmd, "properties") == 0) && ($_GET["browse"])) {
707  $this->questionBrowser();
708  return;
709  }
710  if ((strcmp($cmd, "properties") == 0) && ($_GET["up"] || $_GET["down"])) {
711  $this->questionsObject();
712  return;
713  }
714  $cmd .= "Object";
715  $ret = &$this->$cmd();
716  break;
717  default:
718  // elba hack for storing question id for inserting new question after
719  if ($_REQUEST['prev_qid']) {
720  global $___prev_question_id;
721  $___prev_question_id = $_REQUEST['prev_qid'];
722  $this->ctrl->setParameterByClass('ilassquestionpagegui', 'prev_qid', $_REQUEST['prev_qid']);
723  $this->ctrl->setParameterByClass($_GET['sel_question_types'] . 'gui', 'prev_qid', $_REQUEST['prev_qid']);
724  }
725  $this->create_question_mode = true;
726  $this->prepareOutput();
727 
728  $this->ctrl->setReturn($this, "questions");
729  require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
730  $q_gui = &assQuestionGUI::_getQuestionGUI($_GET['sel_question_types'], $this->fetchAuthoringQuestionIdParameter());
731  $q_gui->setEditContext(assQuestionGUI::EDIT_CONTEXT_AUTHORING);
732  $q_gui->object->setObjId($this->object->getId());
733  if (!$_GET['sel_question_types']) {
734  $qType = assQuestion::getQuestionTypeFromDb($_GET['q_id']);
735  } else {
736  $qType = $_GET['sel_question_types'];
737  }
738  $this->ctrl->setParameterByClass($qType . "GUI", 'prev_qid', $_REQUEST['prev_qid']);
739  $this->ctrl->setParameterByClass($qType . "GUI", 'test_ref_id', $_REQUEST['ref_id']);
740  $this->ctrl->setParameterByClass($qType . "GUI", 'q_id', $_REQUEST['q_id']);
741  if ($_REQUEST['test_express_mode']) {
742  $this->ctrl->setParameterByClass($qType . "GUI", 'test_express_mode', 1);
743  }
744 
745  #global $___test_express_mode;
746  #$___test_express_mode = true;
747  if (!$q_gui->isSaveCommand()) {
748  $_GET['calling_test'] = $this->object->getRefId();
749  }
750 
751  $q_gui->setQuestionTabs();
752  #unset($___test_express_mode);
753  $ret = &$this->ctrl->forwardCommand($q_gui);
754  break;
755  }
756  if (!in_array(strtolower($_GET["baseClass"]), array('iladministrationgui', 'ilrepositorygui')) &&
757  $this->getCreationMode() != true) {
758  $this->tpl->show();
759  }
760  }
Class ilObjectMetaDataGUI.
static getQuestionTypeFromDb($question_id)
get question type for question id
Export User Interface Class.
GUI class for the workflow of copying objects.
global $DIC
Definition: saml.php:7
Generic feedback page GUI class.
$_GET["client_id"]
buildPageViewToolbar($qid=0)
Questions per page.
Class ilUnitConfigurationRepository.
Scoring class for tests.
Base Exception for all Exceptions relating to Modules/Test.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
prepareSubGuiOutput()
prepares ilias to get output rendered by sub gui class
setCustomRolesForSelection($a_roles)
Set custom roles for mapping to LTI roles.
prepareOutput($a_show_subobjects=true)
prepare output
GUI class for LTI provider object settings.
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...
$ilUser
Definition: imgupload.php:18
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
Basic GUI class for assessment questions.
Specific feedback page GUI class.
global $ilDB
$ret
Definition: parser.php:6
getCreationMode()
get creation mode
Class ilLocalUnitConfigurationGUI.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Service GUI class for tests.
addHeaderAction()
Add header action menu.
ilTestExpressPageObjectGUI: assMultipleChoiceGUI, assClozeTestGUI, assMatchingQuestionGUI ilTestExpr...
Class ilObjUserTrackingGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ executeCreateQuestionObject()

ilObjTestGUI::executeCreateQuestionObject ( )

Called when a new question should be created from a test after confirmation.

Called when a new question should be created from a test after confirmation

public

Definition at line 1520 of file class.ilObjTestGUI.php.

References $_GET, $_SESSION, ilUtil\appendUrlParameterString(), createQuestionObject(), createQuestionPool(), exit, ilObjQuestionPool\getQuestionTypeByTypeId(), ilUtil\redirect(), and ilUtil\sendInfo().

1521  {
1522  $qpl_ref_id = $_REQUEST["sel_qpl"];
1523 
1524  $qpl_mode = $_REQUEST['usage'];
1525 
1526  if (isset($_REQUEST['qtype'])) {
1527  include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
1528  $sel_question_types = ilObjQuestionPool::getQuestionTypeByTypeId($_REQUEST["qtype"]);
1529  } elseif (isset($_REQUEST['sel_question_types'])) {
1530  $sel_question_types = $_REQUEST["sel_question_types"];
1531  }
1532 
1533  if (!$qpl_mode || ($qpl_mode == 2 && strcmp($_REQUEST["txt_qpl"], "") == 0) || ($qpl_mode == 3 && strcmp($qpl_ref_id, "") == 0)) {
1534  //if ((strcmp($_REQUEST["txt_qpl"], "") == 0) && (strcmp($qpl_ref_id, "") == 0))
1535  // Mantis #14890
1536  $_REQUEST['sel_question_types'] = $sel_question_types;
1537  ilUtil::sendInfo($this->lng->txt("questionpool_not_entered"));
1538  $this->createQuestionObject();
1539  return;
1540  } else {
1541  $_SESSION["test_id"] = $this->object->getRefId();
1542  if ($qpl_mode == 2 && strcmp($_REQUEST["txt_qpl"], "") != 0) {
1543  // create a new question pool and return the reference id
1544  $qpl_ref_id = $this->createQuestionPool($_REQUEST["txt_qpl"]);
1545  } elseif ($qpl_mode == 1) {
1546  $qpl_ref_id = $_GET["ref_id"];
1547  }
1548 
1549  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php";
1550  $baselink = "ilias.php?baseClass=ilObjQuestionPoolGUI&ref_id=" . $qpl_ref_id . "&cmd=createQuestionForTest&test_ref_id=" . $_GET["ref_id"] . "&calling_test=" . $_GET["ref_id"] . "&sel_question_types=" . $sel_question_types;
1551 
1552  if (isset($_REQUEST['prev_qid'])) {
1553  $baselink .= '&prev_qid=' . $_REQUEST['prev_qid'];
1554  } elseif (isset($_REQUEST['position'])) {
1555  $baselink .= '&prev_qid=' . $_REQUEST['position'];
1556  }
1557 
1558  if ($_REQUEST['test_express_mode']) {
1559  $baselink .= '&test_express_mode=1';
1560  }
1561 
1562  if (isset($_REQUEST['add_quest_cont_edit_mode'])) {
1564  $baselink,
1565  "add_quest_cont_edit_mode={$_REQUEST['add_quest_cont_edit_mode']}",
1566  false
1567  );
1568  }
1569 
1570  #var_dump($_REQUEST['prev_qid']);
1571  ilUtil::redirect($baselink);
1572 
1573  exit();
1574  }
1575  }
createQuestionObject()
Called when a new question should be created from a test.
$_SESSION["AccountId"]
$_GET["client_id"]
static getQuestionTypeByTypeId($type_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
createQuestionPool($name="dummy", $description="")
Creates a new questionpool and returns the reference id.
exit
Definition: backend.php:16
static redirect($a_script)
+ Here is the call graph for this function:

◆ exportObject()

ilObjTestGUI::exportObject ( )
protected

Gateway for exports initiated from workspace, as there is a generic forward to {objTypeMainGUI}::export()

Definition at line 780 of file class.ilObjTestGUI.php.

References $DIC.

781  {
782  global $DIC; /* @var ILIAS\DI\Container $DIC */
783  $DIC->ctrl()->redirectByClass('ilTestExportGUI');
784  }
global $DIC
Definition: saml.php:7

◆ fetchAuthoringQuestionIdParameter()

ilObjTestGUI::fetchAuthoringQuestionIdParameter ( )
protected
Returns
mixed

Definition at line 789 of file class.ilObjTestGUI.php.

References $_GET, $_POST, and $keys.

Referenced by executeCommand().

790  {
791  $qid = $_REQUEST['q_id'];
792 
793  if (!$qid || $qid == 'Array') {
794  $questions = $this->object->getQuestionTitlesAndIndexes();
795  if (!is_array($questions)) {
796  $questions = array();
797  }
798 
799  $keys = array_keys($questions);
800  $qid = $keys[0];
801 
802  $_REQUEST['q_id'] = $qid;
803  $_GET['q_id'] = $qid;
804  $_POST['q_id'] = $qid;
805  }
806 
807  if ($this->object->checkQuestionParent($qid)) {
808  return $qid;
809  }
810 
811  throw new ilTestException('question id does not relate to parent object!');
812  }
$_GET["client_id"]
$keys
Base Exception for all Exceptions relating to Modules/Test.
$_POST["username"]
+ Here is the caller graph for this function:

◆ filterObject()

ilObjTestGUI::filterObject ( )

Sets the filter for the question browser.

Sets the filter for the question browser

public

Definition at line 1321 of file class.ilObjTestGUI.php.

1322  {
1323  $this->questionBrowser();
1324  }

◆ forwardToEvaluationGUI()

ilObjTestGUI::forwardToEvaluationGUI ( )
private

Definition at line 871 of file class.ilObjTestGUI.php.

References ilObjectGUI\addHeaderAction(), getObjectiveOrientedContainer(), getTestAccess(), and ilObjectGUI\prepareOutput().

Referenced by executeCommand(), and userResultsGatewayObject().

872  {
873  $this->prepareOutput();
874  $this->addHeaderAction();
875 
876  require_once 'Modules/Test/classes/class.ilTestEvaluationGUI.php';
877  $gui = new ilTestEvaluationGUI($this->object);
878  $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
879  $gui->setTestAccess($this->getTestAccess());
880 
881  $this->ctrl->forwardCommand($gui);
882  }
prepareOutput($a_show_subobjects=true)
prepare output
Output class for assessment test evaluation.
addHeaderAction()
Add header action menu.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fullscreenObject()

ilObjTestGUI::fullscreenObject ( )

show fullscreen view

Definition at line 1296 of file class.ilObjTestGUI.php.

References $_GET.

1297  {
1298  include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
1299  $page_gui = new ilAssQuestionPageGUI($_GET["pg_id"]);
1300  $page_gui->showMediaFullscreen();
1301  }
$_GET["client_id"]
Question page GUI class.

◆ getObjectiveOrientedContainer()

ilObjTestGUI::getObjectiveOrientedContainer ( )
protected

Definition at line 3752 of file class.ilObjTestGUI.php.

References $objectiveOrientedContainer.

Referenced by executeCommand(), forwardToEvaluationGUI(), getTabs(), and redirectToInfoScreenObject().

3753  {
3755  }
+ Here is the caller graph for this function:

◆ getQuestionpoolCreationForm()

ilObjTestGUI::getQuestionpoolCreationForm ( )
private

Definition at line 3269 of file class.ilObjTestGUI.php.

References $description, $DIC, $form, $id, ilObjectGUI\$lng, and $title.

Referenced by createQuestionPoolAndCopyObject(), and createQuestionpoolTargetObject().

3270  {
3271  global $DIC;
3272  $lng = $DIC['lng'];
3273  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
3274  $form = new ilPropertyFormGUI();
3275 
3276  $title = new ilTextInputGUI($lng->txt('title'), 'title');
3277  $title->setRequired(true);
3278  $form->addItem($title);
3279 
3280  $description = new ilTextAreaInputGUI($lng->txt('description'), 'description');
3281  $form->addItem($description);
3282 
3283  $form->addCommandButton('createQuestionPoolAndCopy', $lng->txt('create'));
3284 
3285  if (isset($_REQUEST['q_id']) && is_array($_REQUEST['q_id'])) {
3286  foreach ($_REQUEST['q_id'] as $id) {
3287  $hidden = new ilHiddenInputGUI('q_id[]');
3288  $hidden->setValue($id);
3289  $form->addItem($hidden);
3290  }
3291  }
3292 
3293  return $form;
3294  }
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
This class represents a hidden form property in a property form.
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
This class represents a text area property in a property form.
+ Here is the caller graph for this function:

◆ getTabs()

ilObjTestGUI::getTabs ( )

adds tabs to tab gui object

Parameters
ilTabsGUI$tabs_gui

Definition at line 2949 of file class.ilObjTestGUI.php.

References $DIC, ilLink\_getLink(), getObjectiveOrientedContainer(), and getTabsManager().

2950  {
2951  global $DIC;
2952  $help = $DIC['ilHelp'];
2953  $help->setScreenIdComponent("tst");
2954 
2955  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
2956  require_once 'Services/Link/classes/class.ilLink.php';
2957  $courseLink = ilLink::_getLink($this->getObjectiveOrientedContainer()->getRefId());
2958  $this->getTabsManager()->setParentBackLabel($this->lng->txt('back_to_objective_container'));
2959  $this->getTabsManager()->setParentBackHref($courseLink);
2960  }
2961 
2962  $this->getTabsManager()->perform();
2963  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:

◆ getTabsManager()

ilObjTestGUI::getTabsManager ( )

◆ getTestAccess()

ilObjTestGUI::getTestAccess ( )
Returns
ilTestAccess

Definition at line 842 of file class.ilObjTestGUI.php.

References $testAccess.

Referenced by executeCommand(), and forwardToEvaluationGUI().

843  {
844  return $this->testAccess;
845  }
+ Here is the caller graph for this function:

◆ historyObject()

ilObjTestGUI::historyObject ( )

Creates the change history for a test.

Creates the change history for a test

public

Definition at line 2243 of file class.ilObjTestGUI.php.

References $DIC, $log, ilObjAssessmentFolder\_getLog(), and ilTestTabsManager\TAB_ID_HISTORY.

2244  {
2245  global $DIC; /* @var ILIAS\DI\Container $DIC */
2246 
2247  $DIC->tabs()->activateTab(ilTestTabsManager::TAB_ID_HISTORY);
2248 
2249  include_once "./Modules/Test/classes/tables/class.ilTestHistoryTableGUI.php";
2250  $table_gui = new ilTestHistoryTableGUI($this, 'history');
2251  $table_gui->setTestObject($this->object);
2252  include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
2253  $log = &ilObjAssessmentFolder::_getLog(0, time(), $this->object->getId(), true);
2254  $table_gui->setData($log);
2255  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
2256  }
global $DIC
Definition: saml.php:7
$log
Definition: sabredav.php:21
static _getLog($ts_from, $ts_to, $test_id, $test_only=false)
Retrieve assessment log datasets from the database.
+ Here is the call graph for this function:

◆ importFileObject()

ilObjTestGUI::importFileObject (   $parent_id = null,
  $a_catch_errors = true 
)
protected

form for new test object import

Definition at line 937 of file class.ilObjTestGUI.php.

References $form, initImportForm(), and uploadTstObject().

938  {
939  $form = $this->initImportForm($_REQUEST["new_type"]);
940  if ($form->checkInput()) {
941  $this->ctrl->setParameter($this, "new_type", $this->type);
942  $this->uploadTstObject();
943  }
944 
945  // display form to correct errors
946  $form->setValuesByPost();
947  $this->tpl->setContent($form->getHTML());
948  }
if(isset($_POST['submit'])) $form
initImportForm($a_new_type)
uploadTstObject()
imports test and question(s)
+ Here is the call graph for this function:

◆ importVerifiedFileObject()

ilObjTestGUI::importVerifiedFileObject ( )

imports question(s) into the questionpool (after verification)

Definition at line 1188 of file class.ilObjTestGUI.php.

References $_GET, $_POST, $_SESSION, $map, $result, $results, ilObjTest\_getImportDirectory(), ilUtil\delDir(), IL_MO_PARSE_QTI, and ilUtil\redirect().

Referenced by uploadTstObject().

1189  {
1190  include_once "./Modules/Test/classes/class.ilObjTest.php";
1191  // create new questionpool object
1192  $newObj = new ilObjTest(0, true);
1193  // set type of questionpool object
1194  $newObj->setType($_GET["new_type"]);
1195  // set title of questionpool object to "dummy"
1196  $newObj->setTitle("dummy");
1197  // set description of questionpool object
1198  $newObj->setDescription("test import");
1199  // create the questionpool class in the ILIAS database (object_data table)
1200  $newObj->create(true);
1201  // create a reference for the questionpool object in the ILIAS database (object_reference table)
1202  $newObj->createReference();
1203  // put the questionpool object in the administration tree
1204  $newObj->putInTree($_GET["ref_id"]);
1205  // get default permissions and set the permissions for the questionpool object
1206  $newObj->setPermissions($_GET["ref_id"]);
1207  // empty mark schema
1208  $newObj->mark_schema->flush();
1209 
1210  // start parsing of QTI files
1211  include_once "./Services/QTI/classes/class.ilQTIParser.php";
1212 
1213  // Handle selection of "no questionpool" as qpl_id = -1 -> use test object id instead.
1214  // possible hint: chek if empty strings in $_POST["qpl_id"] relates to a bug or not
1215  if (!isset($_POST["qpl"]) || "-1" === (string) $_POST["qpl"]) {
1216  $questionParentObjId = $newObj->getId();
1217  } else {
1218  $questionParentObjId = $_POST["qpl"];
1219  }
1220 
1221  if (is_file($_SESSION["tst_import_dir"] . '/' . $_SESSION["tst_import_subdir"] . "/manifest.xml")) {
1222  $newObj->saveToDb();
1223 
1224  $_SESSION['tst_import_idents'] = $_POST['ident'];
1225  $_SESSION['tst_import_qst_parent'] = $questionParentObjId;
1226 
1227  $fileName = $_SESSION['tst_import_subdir'] . '.zip';
1228  $fullPath = $_SESSION['tst_import_dir'] . '/' . $fileName;
1229 
1230  include_once("./Services/Export/classes/class.ilImport.php");
1231  $imp = new ilImport((int) $_GET["ref_id"]);
1232  $map = $imp->getMapping();
1233  $map->addMapping('Modules/Test', 'tst', 'new_id', $newObj->getId());
1234  $imp->importObject($newObj, $fullPath, $fileName, 'tst', 'Modules/Test', true);
1235  } else {
1236  $qtiParser = new ilQTIParser($_SESSION["tst_import_qti_file"], IL_MO_PARSE_QTI, $questionParentObjId, $_POST["ident"]);
1237  if (!isset($_POST["ident"]) || !is_array($_POST["ident"]) || !count($_POST["ident"])) {
1238  $qtiParser->setIgnoreItemsEnabled(true);
1239  }
1240  $qtiParser->setTestObject($newObj);
1241  $result = $qtiParser->startParsing();
1242  $newObj->saveToDb();
1243 
1244  // import page data
1245  include_once("./Modules/LearningModule/classes/class.ilContObjParser.php");
1246  $contParser = new ilContObjParser($newObj, $_SESSION["tst_import_xml_file"], $_SESSION["tst_import_subdir"]);
1247  $contParser->setQuestionMapping($qtiParser->getImportMapping());
1248  $contParser->startParsing();
1249 
1250  if (isset($_POST["ident"]) && is_array($_POST["ident"]) && count($_POST["ident"]) == $qtiParser->getNumImportedItems()) {
1251  // import test results
1252  if (@file_exists($_SESSION["tst_import_results_file"])) {
1253  include_once("./Modules/Test/classes/class.ilTestResultsImportParser.php");
1254  $results = new ilTestResultsImportParser($_SESSION["tst_import_results_file"], $newObj);
1255  $results->setQuestionIdMapping($qtiParser->getQuestionIdMapping());
1256  $results->startParsing();
1257  }
1258  }
1259  $newObj->update();
1260  }
1261 
1262 
1263  // delete import directory
1265 
1266  ilUtil::sendSuccess($this->lng->txt("object_imported"), true);
1267  ilUtil::redirect("ilias.php?ref_id=" . $newObj->getRefId() . "&baseClass=ilObjTestGUI");
1268  }
Content Object Parser.
$_SESSION["AccountId"]
$result
$_GET["client_id"]
Import class.
const IL_MO_PARSE_QTI
$results
Definition: svg-scanner.php:47
static redirect($a_script)
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
$_POST["username"]
static _getImportDirectory()
Get the import directory location of the test.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreenObject()

ilObjTestGUI::infoScreenObject ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

Definition at line 2672 of file class.ilObjTestGUI.php.

2673  {
2674  #if( !include 'competenzenRocker.php' ) exit;
2675 
2676  $this->ctrl->setCmd("showSummary");
2677  $this->ctrl->setCmdClass("ilinfoscreengui");
2678  $this->infoScreen();
2679  }

◆ initImportForm()

ilObjTestGUI::initImportForm (   $a_new_type)

Definition at line 2258 of file class.ilObjTestGUI.php.

References $_GET, $_POST, $form, $key, PHPMailer\PHPMailer\$options, ilFormPropertyGUI\setInfo(), and ilFileInputGUI\setSuffixes().

Referenced by importFileObject().

2259  {
2260  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2261  $form = new ilPropertyFormGUI();
2262  $form->setTarget("_top");
2263  $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
2264  $this->ctrl->setParameter($this, "new_type", $new_type);
2265  $form->setFormAction($this->ctrl->getFormAction($this));
2266  $form->setTitle($this->lng->txt("import_tst"));
2267 
2268  // file
2269  include_once("./Services/Form/classes/class.ilFileInputGUI.php");
2270  $fi = new ilFileInputGUI($this->lng->txt("import_file"), "xmldoc");
2271  $fi->setSuffixes(array("zip"));
2272  $fi->setRequired(true);
2273  $form->addItem($fi);
2274 
2275  // question pool
2276  include_once("./Modules/Test/classes/class.ilObjTest.php");
2277  $tst = new ilObjTest();
2278  $questionpools = $tst->getAvailableQuestionpools(true, false, true, true);
2279  if (count($questionpools)) {
2280  $options = array("-1" => $this->lng->txt("dont_use_questionpool"));
2281  foreach ($questionpools as $key => $value) {
2282  $options[$key] = $value["title"];
2283  }
2284 
2285  $pool = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "qpl");
2286  $pool->setInfo($this->lng->txt('select_question_pool_info'));
2287  $pool->setOptions($options);
2288  $form->addItem($pool);
2289  }
2290 
2291  $form->addCommandButton("importFile", $this->lng->txt("import"));
2292  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
2293 
2294  return $form;
2295  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
$_GET["client_id"]
This class represents a file property in a property form.
setInfo($a_info)
Set Information Text.
if(isset($_POST['submit'])) $form
$key
Definition: croninfo.php:18
setSuffixes($a_suffixes)
Set Accepted Suffixes.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertQuestionsAfterObject()

ilObjTestGUI::insertQuestionsAfterObject ( )

Insert checked questions after the actual selection.

Definition at line 1880 of file class.ilObjTestGUI.php.

References $_POST, $_SESSION, and ilUtil\sendFailure().

1881  {
1882  // get all questions to move
1883  $move_questions = $_SESSION['tst_qst_move_' . $this->object->getTestId()];
1884  if (!is_array($_POST['q_id']) || 0 === count($_POST['q_id'])) {
1885  ilUtil::sendFailure($this->lng->txt("no_target_selected_for_move"), true);
1886  $this->ctrl->redirect($this, 'questions');
1887  }
1888  if (count($_POST['q_id']) > 1) {
1889  ilUtil::sendFailure($this->lng->txt("too_many_targets_selected_for_move"), true);
1890  $this->ctrl->redirect($this, 'questions');
1891  }
1892  $insert_mode = 1;
1893  $this->object->moveQuestions($_SESSION['tst_qst_move_' . $this->object->getTestId()], $_POST['q_id'][0], $insert_mode);
1894  ilUtil::sendSuccess($this->lng->txt("msg_questions_moved"), true);
1895  unset($_SESSION['tst_qst_move_' . $this->object->getTestId()]);
1896  $this->ctrl->redirect($this, "questions");
1897  }
$_SESSION["AccountId"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ insertQuestionsBeforeObject()

ilObjTestGUI::insertQuestionsBeforeObject ( )

Insert checked questions before the actual selection.

Definition at line 1857 of file class.ilObjTestGUI.php.

References $_POST, $_SESSION, and ilUtil\sendFailure().

1858  {
1859  // get all questions to move
1860  $move_questions = $_SESSION['tst_qst_move_' . $this->object->getTestId()];
1861 
1862  if (!is_array($_POST['q_id']) || 0 === count($_POST['q_id'])) {
1863  ilUtil::sendFailure($this->lng->txt("no_target_selected_for_move"), true);
1864  $this->ctrl->redirect($this, 'questions');
1865  }
1866  if (count($_POST['q_id']) > 1) {
1867  ilUtil::sendFailure($this->lng->txt("too_many_targets_selected_for_move"), true);
1868  $this->ctrl->redirect($this, 'questions');
1869  }
1870  $insert_mode = 0;
1871  $this->object->moveQuestions($_SESSION['tst_qst_move_' . $this->object->getTestId()], $_POST['q_id'][0], $insert_mode);
1872  ilUtil::sendSuccess($this->lng->txt("msg_questions_moved"), true);
1873  unset($_SESSION['tst_qst_move_' . $this->object->getTestId()]);
1874  $this->ctrl->redirect($this, "questions");
1875  }
$_SESSION["AccountId"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ insertQuestionsObject()

ilObjTestGUI::insertQuestionsObject ( )

Insert questions from the questionbrowser into the test.

public

Definition at line 1904 of file class.ilObjTestGUI.php.

References $_POST, $key, assQuestion\_needsManualScoring(), and ilUtil\sendInfo().

1905  {
1906  $selected_array = (is_array($_POST['q_id'])) ? $_POST['q_id'] : array();
1907  if (!count($selected_array)) {
1908  ilUtil::sendInfo($this->lng->txt("tst_insert_missing_question"), true);
1909  $this->ctrl->redirect($this, "browseForQuestions");
1910  } else {
1911  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
1912  $manscoring = false;
1913  foreach ($selected_array as $key => $value) {
1914  $this->object->insertQuestion($this->testQuestionSetConfigFactory->getQuestionSetConfig(), $value);
1915  if (!$manscoring) {
1916  $manscoring = $manscoring | assQuestion::_needsManualScoring($value);
1917  }
1918  }
1919  $this->object->saveCompleteStatus($this->testQuestionSetConfigFactory->getQuestionSetConfig());
1920  if ($manscoring) {
1921  ilUtil::sendInfo($this->lng->txt("manscoring_hint"), true);
1922  } else {
1923  ilUtil::sendSuccess($this->lng->txt("tst_questions_inserted"), true);
1924  }
1925  $this->ctrl->redirect($this, "questions");
1926  return;
1927  }
1928  }
static _needsManualScoring($question_id)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$key
Definition: croninfo.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ insertRandomSelectionObject()

ilObjTestGUI::insertRandomSelectionObject ( )

Inserts a random selection into the test.

Inserts a random selection into the test

public

Definition at line 1485 of file class.ilObjTestGUI.php.

References $_POST, $key, $total, and ilUtil\sendInfo().

1486  {
1487  $selected_array = explode(",", $_POST["chosen_questions"]);
1488  if (!count($selected_array)) {
1489  ilUtil::sendInfo($this->lng->txt("tst_insert_missing_question"));
1490  } else {
1491  $total = $this->object->evalTotalPersons();
1492  if ($total) {
1493  // the test was executed previously
1494  ilUtil::sendInfo(sprintf($this->lng->txt("tst_insert_questions_and_results"), $total));
1495  } else {
1496  ilUtil::sendInfo($this->lng->txt("tst_insert_questions"));
1497  }
1498  foreach ($selected_array as $key => $value) {
1499  $this->object->insertQuestion($this->testQuestionSetConfigFactory->getQuestionSetConfig(), $value);
1500  }
1501  $this->object->saveCompleteStatus($this->testQuestionSetConfigFactory->getQuestionSetConfig());
1502  ilUtil::sendSuccess($this->lng->txt("tst_questions_inserted"), true);
1503  $this->ctrl->redirect($this, "questions");
1504  return;
1505  }
1506  }
$total
Definition: Utf8Test.php:87
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$key
Definition: croninfo.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ isCommandClassAnyInfoScreenChild()

ilObjTestGUI::isCommandClassAnyInfoScreenChild ( )
private

Definition at line 2658 of file class.ilObjTestGUI.php.

Referenced by redirectToInfoScreenObject().

2659  {
2660  if (in_array($this->ctrl->getCmdClass(), self::$infoScreenChildClasses)) {
2661  return true;
2662  }
2663 
2664  return false;
2665  }
+ Here is the caller graph for this function:

◆ movePageFormObject()

ilObjTestGUI::movePageFormObject ( )
protected

Move current page.

Definition at line 3617 of file class.ilObjTestGUI.php.

References $DIC, $form, $ilCtrl, ilObjectGUI\$lng, PHPMailer\PHPMailer\$options, ilObjectGUI\$tpl, and ilSelectInputGUI\setOptions().

3618  {
3619  global $DIC;
3620  $lng = $DIC['lng'];
3621  $ilCtrl = $DIC['ilCtrl'];
3622  $tpl = $DIC['tpl'];
3623 
3624  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
3625  $form = new ilPropertyFormGUI();
3626  $form->setFormAction($ilCtrl->getFormAction($this, "movePage"));
3627  $form->setTitle($lng->txt("test_move_page"));
3628 
3629  $old_pos = new ilHiddenInputGUI("q_id");
3630  $old_pos->setValue($_REQUEST['q_id']);
3631  $form->addItem($old_pos);
3632 
3633  $questions = $this->object->getQuestionTitlesAndIndexes();
3634  if (!is_array($questions)) {
3635  $questions = array();
3636  }
3637 
3638  foreach ($questions as $k => $q) {
3639  if ($k == $_REQUEST['q_id']) {
3640  unset($questions[$k]);
3641  continue;
3642  }
3643  $questions[$k] = $lng->txt('behind') . ' ' . $q;
3644  }
3645  #$questions['0'] = $lng->txt('first');
3646 
3647  $options = array(
3648  0 => $lng->txt('first')
3649  );
3650  foreach ($questions as $k => $q) {
3651  $options[$k] = $q . ' [' . $this->lng->txt('question_id_short') . ': ' . $k . ']';
3652  }
3653 
3654  $pos = new ilSelectInputGUI($lng->txt("position"), "position_after");
3655  $pos->setOptions($options);
3656  $form->addItem($pos);
3657 
3658  $form->addCommandButton("movePage", $lng->txt("submit"));
3659  $form->addCommandButton("showPage", $lng->txt("cancel"));
3660 
3661  return $tpl->setContent($form->getHTML());
3662  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
This class represents a hidden form property in a property form.
if(isset($_POST['submit'])) $form
setOptions($a_options)
Set Options.
+ Here is the call graph for this function:

◆ movePageObject()

ilObjTestGUI::movePageObject ( )

Definition at line 3664 of file class.ilObjTestGUI.php.

References $DIC, ilUtil\sendInfo(), and showPageObject().

3665  {
3666  global $DIC;
3667  $ilAccess = $DIC['ilAccess'];
3668  if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
3669  // allow only write access
3670  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
3671  $this->ctrl->redirect($this, "infoScreen");
3672  }
3673 
3674  $this->object->moveQuestionAfter($_REQUEST['q_id'], $_REQUEST['position_after']);
3675  $this->showPageObject();
3676  }
global $DIC
Definition: saml.php:7
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ moveQuestionsObject()

ilObjTestGUI::moveQuestionsObject ( )

Marks selected questions for moving.

Definition at line 1841 of file class.ilObjTestGUI.php.

References $_POST, $_SESSION, and ilUtil\sendFailure().

1842  {
1843  $selected_questions = null;
1844  $selected_questions = $_POST['q_id'];
1845  if (is_array($selected_questions)) {
1846  $_SESSION['tst_qst_move_' . $this->object->getTestId()] = $_POST['q_id'];
1847  ilUtil::sendSuccess($this->lng->txt("msg_selected_for_move"), true);
1848  } else {
1849  ilUtil::sendFailure($this->lng->txt('no_selection_for_move'), true);
1850  }
1851  $this->ctrl->redirect($this, 'questions');
1852  }
$_SESSION["AccountId"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ outEvaluationObject()

ilObjTestGUI::outEvaluationObject ( )

Definition at line 929 of file class.ilObjTestGUI.php.

930  {
931  $this->ctrl->redirectByClass("iltestevaluationgui", "outEvaluation");
932  }

◆ participantsActionObject()

ilObjTestGUI::participantsActionObject ( )

Evaluates the actions on the participants page.

public

Definition at line 2302 of file class.ilObjTestGUI.php.

References $_POST.

2303  {
2304  $command = $_POST["command"];
2305  if (strlen($command)) {
2306  $method = $command . "Object";
2307  if (method_exists($this, $method)) {
2308  $this->$method();
2309  return;
2310  }
2311  }
2312  $this->ctrl->redirect($this, "participants");
2313  }
$_POST["username"]

◆ populateQuestionBrowserToolbarButtons()

ilObjTestGUI::populateQuestionBrowserToolbarButtons ( ilToolbarGUI  $toolbar,
  $context 
)
private
Parameters
$ilToolbar
$context

Definition at line 2217 of file class.ilObjTestGUI.php.

References $context, ilToolbarGUI\addButton(), ilTestQuestionBrowserTableGUI\CMD_BROWSE_QUESTIONS, ilTestQuestionBrowserTableGUI\CONTEXT_PARAMETER, ilTestQuestionBrowserTableGUI\MODE_BROWSE_POOLS, ilTestQuestionBrowserTableGUI\MODE_BROWSE_TESTS, and ilTestQuestionBrowserTableGUI\MODE_PARAMETER.

Referenced by buildPageViewToolbar(), and questionsObject().

2218  {
2219  require_once 'Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php';
2220 
2221  $this->ctrl->setParameterByClass('ilTestQuestionBrowserTableGUI', ilTestQuestionBrowserTableGUI::CONTEXT_PARAMETER, $context);
2222 
2223  $this->ctrl->setParameterByClass('ilTestQuestionBrowserTableGUI', ilTestQuestionBrowserTableGUI::MODE_PARAMETER, ilTestQuestionBrowserTableGUI::MODE_BROWSE_POOLS);
2224 
2225  $toolbar->addButton($this->lng->txt("tst_browse_for_qpl_questions"), $this->ctrl->getLinkTargetByClass('ilTestQuestionBrowserTableGUI', ilTestQuestionBrowserTableGUI::CMD_BROWSE_QUESTIONS));
2226 
2227  $this->ctrl->setParameterByClass('ilTestQuestionBrowserTableGUI', ilTestQuestionBrowserTableGUI::MODE_PARAMETER, ilTestQuestionBrowserTableGUI::MODE_BROWSE_TESTS);
2228 
2229  $toolbar->addButton($this->lng->txt("tst_browse_for_tst_questions"), $this->ctrl->getLinkTargetByClass('ilTestQuestionBrowserTableGUI', ilTestQuestionBrowserTableGUI::CMD_BROWSE_QUESTIONS));
2230  }
$context
Definition: webdav.php:25
addButton( $a_txt, $a_cmd, $a_target="", $a_acc_key="", $a_additional_attrs='', $a_id="", $a_class='submit')
Add button to toolbar.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareSubGuiOutput()

ilObjTestGUI::prepareSubGuiOutput ( )
private

prepares ilias to get output rendered by sub gui class

ilLocator $ilLocator ilTemplate $tpl ilObjUser $ilUser

Returns
boolean

Definition at line 898 of file class.ilObjTestGUI.php.

References $DIC, $ilUser, ilDAVActivationChecker\_isActive(), ilUtil\infoPanel(), ilObjectGUI\setLocator(), ilObjectGUI\setTitleAndDescription(), and ilObjectGUI\showMountWebfolderIcon().

Referenced by executeCommand().

899  {
900  global $DIC;
901  $ilUser = $DIC['ilUser'];
902 
903  $this->tpl->getStandardTemplate();
904 
905  // set locator
906  $this->setLocator();
907 
908  // catch feedback message
910 
911  // set title and description and title icon
912  $this->setTitleAndDescription();
913 
914  // BEGIN WebDAV: Display Mount Webfolder icon.
915  if ($ilUser->getId() != ANONYMOUS_USER_ID) {
916  require_once('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
918  $this->showMountWebfolderIcon();
919  }
920  }
921  // END WebDAV: Display Mount Webfolder icon.
922  }
global $DIC
Definition: saml.php:7
static _isActive()
Static getter.
static infoPanel($a_keep=true)
$ilUser
Definition: imgupload.php:18
setTitleAndDescription()
called by prepare output
setLocator()
set Locator
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printobject()

ilObjTestGUI::printobject ( )

Print tab to create a print of all questions with points and solutions.

Print tab to create a print of all questions with points and solutions

public

Definition at line 2322 of file class.ilObjTestGUI.php.

References $_GET, $DIC, $ilUser, $template, ilTestPDFGenerator\generatePDF(), ilUtil\getStyleSheetLocation(), getTabsManager(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, PDF_PRINT_VIEW_QUESTIONS, ilUtil\prepareFormOutput(), ilPDFGeneratorUtils\prepareGenerationRequest(), assQuestionGUI\RENDER_PURPOSE_PRINT_PDF, ilUtil\sendInfo(), and ilWACSignedPath\setTokenMaxLifetimeInSeconds().

2323  {
2324  global $DIC;
2325  $ilAccess = $DIC['ilAccess'];
2326  $ilias = $DIC['ilias'];
2327  if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
2328  // allow only write access
2329  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
2330  $this->ctrl->redirect($this, "infoScreen");
2331  }
2332 
2333  $isPdfDeliveryRequest = isset($_GET['pdf']) && $_GET['pdf'];
2334 
2335  $this->getTabsManager()->getQuestionsSubTabs();
2336  $template = new ilTemplate("tpl.il_as_tst_print_test_confirm.html", true, true, "Modules/Test");
2337 
2338  if (!$isPdfDeliveryRequest) { // #15243
2339  $this->ctrl->setParameter($this, "pdf", "1");
2340  $template->setCurrentBlock("pdf_export");
2341  $template->setVariable("PDF_URL", $this->ctrl->getLinkTarget($this, "print"));
2342  $this->ctrl->setParameter($this, "pdf", "");
2343  $template->setVariable("PDF_TEXT", $this->lng->txt("pdf_export"));
2344  $template->parseCurrentBlock();
2345 
2346  $template->setCurrentBlock("navigation_buttons");
2347  $template->setVariable("BUTTON_PRINT", $this->lng->txt("print"));
2348  $template->parseCurrentBlock();
2349  }
2350  // prepare generation before contents are processed (for mathjax)
2351  else {
2353  }
2354 
2355  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
2356 
2357  global $DIC;
2358  $ilUser = $DIC['ilUser'];
2359  $print_date = mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y"));
2360  $max_points = 0;
2361  $counter = 1;
2362 
2363  require_once 'Modules/Test/classes/class.ilTestQuestionHeaderBlockBuilder.php';
2364  $questionHeaderBlockBuilder = new ilTestQuestionHeaderBlockBuilder($this->lng);
2365  $questionHeaderBlockBuilder->setHeaderMode($this->object->getTitleOutput());
2366 
2367  if ($isPdfDeliveryRequest) {
2368  require_once 'Services/WebAccessChecker/classes/class.ilWACSignedPath.php';
2370  }
2371 
2372  foreach ($this->object->questions as $question) {
2373  $template->setCurrentBlock("question");
2374  $question_gui = $this->object->createQuestionGUI("", $question);
2375 
2376  if ($isPdfDeliveryRequest) {
2377  $question_gui->setRenderPurpose(assQuestionGUI::RENDER_PURPOSE_PRINT_PDF);
2378  }
2379 
2380  $questionHeaderBlockBuilder->setQuestionTitle($question_gui->object->getTitle());
2381  $questionHeaderBlockBuilder->setQuestionPoints($question_gui->object->getMaximumPoints());
2382  $questionHeaderBlockBuilder->setQuestionPosition($counter);
2383  $template->setVariable("QUESTION_HEADER", $questionHeaderBlockBuilder->getHTML());
2384 
2385  $template->setVariable("TXT_QUESTION_ID", $this->lng->txt('question_id_short'));
2386  $template->setVariable("QUESTION_ID", $question_gui->object->getId());
2387  $result_output = $question_gui->getSolutionOutput("", null, false, true, false, $this->object->getShowSolutionFeedback());
2388  $template->setVariable("SOLUTION_OUTPUT", $result_output);
2389  $template->parseCurrentBlock("question");
2390  $counter++;
2391  $max_points += $question_gui->object->getMaximumPoints();
2392  }
2393 
2394  $template->setVariable("TITLE", ilUtil::prepareFormOutput($this->object->getTitle()));
2395  $template->setVariable("PRINT_TEST", ilUtil::prepareFormOutput($this->lng->txt("tst_print")));
2396  $template->setVariable("TXT_PRINT_DATE", ilUtil::prepareFormOutput($this->lng->txt("date")));
2397  $template->setVariable("VALUE_PRINT_DATE", ilUtil::prepareFormOutput(strftime("%c", $print_date)));
2398  $template->setVariable("TXT_MAXIMUM_POINTS", ilUtil::prepareFormOutput($this->lng->txt("tst_maximum_points")));
2399  $template->setVariable("VALUE_MAXIMUM_POINTS", ilUtil::prepareFormOutput($max_points));
2400 
2401  if ($isPdfDeliveryRequest) {
2402  require_once 'Modules/Test/classes/class.ilTestPDFGenerator.php';
2404  } else {
2405  $this->tpl->setVariable("PRINT_CONTENT", $template->get());
2406  }
2407  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
const PDF_PRINT_VIEW_QUESTIONS
$template
global $DIC
Definition: saml.php:7
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
special template class to simplify handling of ITX/PEAR
$ilUser
Definition: imgupload.php:18
static setTokenMaxLifetimeInSeconds($token_max_lifetime_in_seconds)
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
static prepareGenerationRequest($service, $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
+ Here is the call graph for this function:

◆ questionsObject()

ilObjTestGUI::questionsObject ( )

Definition at line 2047 of file class.ilObjTestGUI.php.

References $_GET, $_SESSION, $DIC, $ilCtrl, $ilUser, ilObjectGUI\$lng, $message, $total, ilObjTestAccess\_lookupOnlineTestAccess(), ilTestQuestionBrowserTableGUI\CONTEXT_LIST_VIEW, getTabsManager(), populateQuestionBrowserToolbarButtons(), ilUtil\redirect(), ilUtil\sendInfo(), ilTestQuestionsTableGUI\setPositionInsertCommandsEnabled(), and ilTestTabsManager\SUBTAB_ID_QST_LIST_VIEW.

Referenced by executeCommand().

2048  {
2049  global $DIC; /* @var ILIAS\DI\Container $DIC */
2050  $ilAccess = $DIC['ilAccess'];
2051  $ilTabs = $DIC['ilTabs'];
2052 
2053  // #12590
2054  $this->ctrl->setParameter($this, 'test_express_mode', '');
2055 
2056  if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
2057  // allow only write access
2058  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
2059  $this->ctrl->redirect($this, "infoScreen");
2060  }
2061 
2062  if ($_GET['browse']) {
2063  return $this->questionbrowser();
2064  }
2065 
2066  $this->getTabsManager()->getQuestionsSubTabs();
2068 
2069  // #11631, #12994
2070  $this->ctrl->setParameter($this, 'q_id', '');
2071 
2072  if ($_GET["eqid"] && $_GET["eqpl"]) {
2073  ilUtil::redirect("ilias.php?baseClass=ilObjQuestionPoolGUI&ref_id=" . $_GET["eqpl"] . "&cmd=editQuestionForTest&calling_test=" . $_GET["ref_id"] . "&q_id=" . $_GET["eqid"]);
2074  }
2075 
2076  if ($_GET["up"] > 0) {
2077  $this->object->questionMoveUp($_GET["up"]);
2078  }
2079  if ($_GET["down"] > 0) {
2080  $this->object->questionMoveDown($_GET["down"]);
2081  }
2082 
2083  if ($_GET["add"]) {
2084  $selected_array = array();
2085  array_push($selected_array, $_GET["add"]);
2086  $total = $this->object->evalTotalPersons();
2087  if ($total) {
2088  // the test was executed previously
2089  ilUtil::sendInfo(sprintf($this->lng->txt("tst_insert_questions_and_results"), $total));
2090  } else {
2091  ilUtil::sendInfo($this->lng->txt("tst_insert_questions"));
2092  }
2093  $this->insertQuestions($selected_array);
2094  return;
2095  }
2096 
2097  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_questions.html", "Modules/Test");
2098 
2099  $total = $this->object->evalTotalPersons();
2100  if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
2101  if ($total != 0) {
2102  $link = $DIC->ui()->factory()->link()->standard(
2103  $DIC->language()->txt("test_has_datasets_warning_page_view_link"),
2104  $DIC->ctrl()->getLinkTargetByClass(array('ilTestResultsGUI', 'ilParticipantsTestResultsGUI'))
2105  );
2106 
2107  $message = $DIC->language()->txt("test_has_datasets_warning_page_view");
2108 
2109  $msgBox = $DIC->ui()->factory()->messageBox()->info($message)->withLinks(array($link));
2110 
2111  $DIC->ui()->mainTemplate()->setCurrentBlock('mess');
2112  $DIC->ui()->mainTemplate()->setVariable(
2113  'MESSAGE',
2114  $DIC->ui()->renderer()->render($msgBox)
2115  );
2116  $DIC->ui()->mainTemplate()->parseCurrentBlock();
2117  } else {
2118  global $DIC;
2119  $ilToolbar = $DIC['ilToolbar'];
2120 
2121  $ilToolbar->addButton($this->lng->txt("ass_create_question"), $this->ctrl->getLinkTarget($this, "addQuestion"));
2122 
2123  if ($this->object->getPoolUsage()) {
2124  $ilToolbar->addSeparator();
2125 
2126  require_once 'Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php';
2127 
2129  }
2130 
2131  $ilToolbar->addSeparator();
2132  $ilToolbar->addButton($this->lng->txt("random_selection"), $this->ctrl->getLinkTarget($this, "randomselect"));
2133 
2134 
2135  global $DIC;
2136  $ilAccess = $DIC['ilAccess'];
2137  $ilUser = $DIC['ilUser'];
2138  $lng = $DIC['lng'];
2139  $ilCtrl = $DIC['ilCtrl'];
2140  $online_access = false;
2141  if ($this->object->getFixedParticipants()) {
2142  include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
2143  $online_access_result = ilObjTestAccess::_lookupOnlineTestAccess($this->object->getId(), $ilUser->getId());
2144  if ($online_access_result === true) {
2145  $online_access = true;
2146  }
2147  }
2148 
2149  if (!$this->object->getOfflineStatus() && $this->object->isComplete($this->testQuestionSetConfigFactory->getQuestionSetConfig())) {
2150  if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id)) {
2151  $testSession = $this->testSessionFactory->getSession();
2152  $testSequence = $this->testSequenceFactory->getSequenceByTestSession($testSession);
2153 
2154  $testPlayerGUI = $this->testPlayerFactory->getPlayerGUI();
2155 
2156  $executable = $this->object->isExecutable($testSession, $ilUser->getId(), $allowPassIncrease = true);
2157 
2158  if ($executable["executable"]) {
2159  if ($testSession->getActiveId() > 0) {
2160  // resume test
2161 
2162  if ($testSequence->hasStarted($testSession)) {
2163  $execTestLabel = $this->lng->txt("tst_resume_test");
2164  $execTestLink = $this->ctrl->getLinkTarget($testPlayerGUI, 'resumePlayer');
2165  } else {
2166  $execTestLabel = $this->object->getStartTestLabel($testSession->getActiveId());
2167  $execTestLink = $this->ctrl->getLinkTarget($testPlayerGUI, 'startPlayer');
2168  }
2169  } else {
2170  // start new test
2171 
2172  $execTestLabel = $this->object->getStartTestLabel($testSession->getActiveId());
2173  $execTestLink = $this->ctrl->getLinkTarget($testPlayerGUI, 'startPlayer');
2174  }
2175 
2176  $ilToolbar->addSeparator();
2177  $ilToolbar->addButton($execTestLabel, $execTestLink);
2178  }
2179  }
2180  }
2181  }
2182  }
2183 
2184  $table_gui = new ilTestQuestionsTableGUI(
2185  $this,
2186  'questions',
2187  $this->object->getRefId()
2188  );
2189 
2191  is_array($_SESSION['tst_qst_move_' . $this->object->getTestId()])
2192  && count($_SESSION['tst_qst_move_' . $this->object->getTestId()])
2193  );
2194 
2195  $table_gui->setQuestionTitleLinksEnabled(!$total);
2196  $table_gui->setQuestionPositioningEnabled(!$total);
2197  $table_gui->setQuestionManagingEnabled(!$total);
2198  $table_gui->setObligatoryQuestionsHandlingEnabled($this->object->areObligationsEnabled());
2199 
2200  $table_gui->setTotalPoints($this->object->getFixedQuestionSetTotalPoints());
2201  $table_gui->setTotalWorkingTime($this->object->getFixedQuestionSetTotalWorkingTime());
2202 
2203  $table_gui->init();
2204 
2205  $table_gui->setData($this->object->getTestQuestions());
2206 
2207  $this->tpl->setCurrentBlock("adm_content");
2208  $this->tpl->setVariable("ACTION_QUESTION_FORM", $this->ctrl->getFormAction($this));
2209  $this->tpl->setVariable('QUESTIONBROWSER', $table_gui->getHTML());
2210  $this->tpl->parseCurrentBlock();
2211  }
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
$_GET["client_id"]
$total
Definition: Utf8Test.php:87
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _lookupOnlineTestAccess($a_test_id, $a_user_id)
Checks if a user is allowd to run an online exam.
catch(Exception $e) $message
setPositionInsertCommandsEnabled(bool $positionInsertCommandsEnabled)
$ilUser
Definition: imgupload.php:18
populateQuestionBrowserToolbarButtons(ilToolbarGUI $toolbar, $context)
static redirect($a_script)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ questionsTabGatewayObject()

ilObjTestGUI::questionsTabGatewayObject ( )
private

Definition at line 814 of file class.ilObjTestGUI.php.

References ilObjTest\QUESTION_SET_TYPE_DYNAMIC, ilObjTest\QUESTION_SET_TYPE_FIXED, and ilObjTest\QUESTION_SET_TYPE_RANDOM.

815  {
816  switch ($this->object->getQuestionSetType()) {
818  $this->ctrl->redirectByClass('ilTestExpressPageObjectGUI', 'showPage');
819 
820  // no break
822  $this->ctrl->redirectByClass('ilTestRandomQuestionSetConfigGUI');
823 
824  // no break
826  $this->ctrl->redirectByClass('ilObjTestDynamicQuestionSetConfigGUI');
827  }
828  }
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
const QUESTION_SET_TYPE_DYNAMIC
type setting value for dynamic question set (continues testing mode)

◆ randomselectObject()

ilObjTestGUI::randomselectObject ( )

Creates a form for random selection of questions.

Definition at line 1380 of file class.ilObjTestGUI.php.

References $_POST, $DIC, $ilUser, $key, getTabsManager(), and ilTestTabsManager\SUBTAB_ID_QST_LIST_VIEW.

1381  {
1382  global $DIC;
1383  $ilUser = $DIC['ilUser'];
1384  $this->getTabsManager()->getQuestionsSubTabs();
1386  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_random_select.html", "Modules/Test");
1387  $questionpools = &$this->object->getAvailableQuestionpools(false, false, false, true);
1388  $this->tpl->setCurrentBlock("option");
1389  $this->tpl->setVariable("VALUE_OPTION", "0");
1390  $this->tpl->setVariable("TEXT_OPTION", $this->lng->txt("all_available_question_pools"));
1391  $this->tpl->parseCurrentBlock();
1392  foreach ($questionpools as $key => $value) {
1393  $this->tpl->setCurrentBlock("option");
1394  $this->tpl->setVariable("VALUE_OPTION", $key);
1395  $this->tpl->setVariable("TEXT_OPTION", $value["title"]);
1396  $this->tpl->parseCurrentBlock();
1397  }
1398  $this->tpl->setCurrentBlock("hidden");
1399  $this->tpl->setVariable("HIDDEN_NAME", "sel_question_types");
1400  $this->tpl->setVariable("HIDDEN_VALUE", $_POST["sel_question_types"]);
1401  $this->tpl->parseCurrentBlock();
1402  $this->tpl->setCurrentBlock("adm_content");
1403  $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
1404  $this->tpl->setVariable("TXT_QPL_SELECT", $this->lng->txt("tst_random_select_questionpool"));
1405  $this->tpl->setVariable("TXT_NR_OF_QUESTIONS", $this->lng->txt("tst_random_nr_of_questions"));
1406  $this->tpl->setVariable("BTN_SUBMIT", $this->lng->txt("submit"));
1407  $this->tpl->setVariable("BTN_CANCEL", $this->lng->txt("cancel"));
1408  $this->tpl->parseCurrentBlock();
1409  }
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
$key
Definition: croninfo.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ redirectTo_ilObjTestSettingsGeneralGUI_showForm_Object()

ilObjTestGUI::redirectTo_ilObjTestSettingsGeneralGUI_showForm_Object ( )
private

Definition at line 884 of file class.ilObjTestGUI.php.

References ilObjTestSettingsGeneralGUI\CMD_SHOW_FORM.

885  {
886  require_once 'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
887  $this->ctrl->redirectByClass('ilObjTestSettingsGeneralGUI', ilObjTestSettingsGeneralGUI::CMD_SHOW_FORM);
888  }

◆ redirectToInfoScreenObject()

ilObjTestGUI::redirectToInfoScreenObject ( )

◆ removeImportFailsObject()

ilObjTestGUI::removeImportFailsObject ( )
protected

Definition at line 2860 of file class.ilObjTestGUI.php.

References ilAssQuestionSkillAssignmentImportFails\deleteRegisteredImportFails(), and ilTestSkillLevelThresholdImportFails\deleteRegisteredImportFails().

2861  {
2862  require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssQuestionSkillAssignmentImportFails.php';
2863  $qsaImportFails = new ilAssQuestionSkillAssignmentImportFails($this->object->getId());
2864  $qsaImportFails->deleteRegisteredImportFails();
2865 
2866  require_once 'Modules/Test/classes/class.ilTestSkillLevelThresholdImportFails.php';
2867  $sltImportFails = new ilTestSkillLevelThresholdImportFails($this->object->getId());
2868  $sltImportFails->deleteRegisteredImportFails();
2869 
2870  $this->ctrl->redirect($this, 'infoScreen');
2871  }
+ Here is the call graph for this function:

◆ removeQuestionsForm()

ilObjTestGUI::removeQuestionsForm (   $checked_questions)

Displays a form to confirm the removal of questions from the test.

Displays a form to confirm the removal of questions from the test

public

Definition at line 1768 of file class.ilObjTestGUI.php.

References ilObjectGUI\$data, $total, $txt, and assQuestion\_getQuestionTypeName().

Referenced by removeQuestionsObject().

1769  {
1770  $total = $this->object->evalTotalPersons();
1771  if ($total) {
1772  // the test was executed previously
1773  $question = sprintf($this->lng->txt("tst_remove_questions_and_results"), $total);
1774  } else {
1775  if (count($checked_questions) == 1) {
1776  $question = $this->lng->txt("tst_remove_question");
1777  } else {
1778  $question = $this->lng->txt("tst_remove_questions");
1779  }
1780  }
1781 
1782  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1783  $cgui = new ilConfirmationGUI();
1784  $cgui->setHeaderText($question);
1785 
1786  $this->ctrl->saveParameter($this, 'test_express_mode');
1787  $this->ctrl->saveParameter($this, 'q_id');
1788 
1789  $cgui->setFormAction($this->ctrl->getFormAction($this));
1790  $cgui->setCancel($this->lng->txt("cancel"), "cancelRemoveQuestions");
1791  $cgui->setConfirm($this->lng->txt("confirm"), "confirmRemoveQuestions");
1792 
1793  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
1794  $removablequestions = &$this->object->getTestQuestions();
1795  if (count($removablequestions)) {
1796  foreach ($removablequestions as $data) {
1797  if (in_array($data["question_id"], $checked_questions)) {
1798  $txt = $data["title"] . " (" . assQuestion::_getQuestionTypeName($data["type_tag"]) . ")";
1799  $txt .= ' [' . $this->lng->txt('question_id_short') . ': ' . $data['question_id'] . ']';
1800 
1801  if ($data["description"]) {
1802  $txt .= "<div class=\"small\">" . $data["description"] . "</div>";
1803  }
1804 
1805  $cgui->addItem("q_id[]", $data["question_id"], $txt);
1806  }
1807  }
1808  }
1809 
1810  $this->tpl->setContent($cgui->getHTML());
1811  }
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
$total
Definition: Utf8Test.php:87
$txt
Definition: error.php:11
Confirmation screen class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeQuestionsObject()

ilObjTestGUI::removeQuestionsObject ( )

Called when a selection of questions should be removed from the test.

Definition at line 1816 of file class.ilObjTestGUI.php.

References getTabsManager(), removeQuestionsForm(), and ilUtil\sendFailure().

1817  {
1818  $this->getTabsManager()->getQuestionsSubTabs();
1819 
1820  $checked_questions = $_REQUEST["q_id"];
1821 
1822  if (!is_array($checked_questions) && $checked_questions) {
1823  $checked_questions = array($checked_questions);
1824  }
1825 
1826  if (!is_array($checked_questions)) {
1827  $checked_questions = [];
1828  }
1829 
1830  if (count($checked_questions) > 0) {
1831  $this->removeQuestionsForm($checked_questions);
1832  } elseif (0 === count($checked_questions)) {
1833  ilUtil::sendFailure($this->lng->txt("tst_no_question_selected_for_removal"), true);
1834  $this->ctrl->redirect($this, "questions");
1835  }
1836  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
removeQuestionsForm($checked_questions)
Displays a form to confirm the removal of questions from the test.
+ Here is the call graph for this function:

◆ resetFilterObject()

ilObjTestGUI::resetFilterObject ( )

Resets the filter for the question browser.

Resets the filter for the question browser

public

Definition at line 1333 of file class.ilObjTestGUI.php.

1334  {
1335  $this->questionBrowser();
1336  }

◆ reviewobject()

ilObjTestGUI::reviewobject ( )

Review tab to create a print of all questions without points and solutions.

Review tab to create a print of all questions without points and solutions

public

Definition at line 2416 of file class.ilObjTestGUI.php.

References $_GET, $DIC, $table, $template, ilObjectGUI\$tpl, ilDatePresentation\formatDate(), ilTestPDFGenerator\generatePDF(), ilUtil\getStyleSheetLocation(), getTabsManager(), IL_CAL_UNIX, ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, PDF_PRINT_VIEW_QUESTIONS, ilUtil\prepareFormOutput(), ilPDFGeneratorUtils\prepareGenerationRequest(), assQuestionGUI\RENDER_PURPOSE_PREVIEW, ilUtil\sendInfo(), ilWACSignedPath\setTokenMaxLifetimeInSeconds(), ilDatePresentation\setUseRelativeDates(), ilTestTabsManager\TAB_ID_SETTINGS, and ilDatePresentation\useRelativeDates().

2417  {
2418  global $DIC;
2419  $ilAccess = $DIC['ilAccess'];
2420 
2421  if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
2422  // allow only write access
2423  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
2424  $this->ctrl->redirect($this, "infoScreen");
2425  }
2426  $this->getTabsManager()->getQuestionsSubTabs();
2427  $template = new ilTemplate("tpl.il_as_tst_print_test_confirm.html", true, true, "Modules/Test");
2428 
2429  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
2430 
2431  $isPdfDeliveryRequest = isset($_GET['pdf']) && $_GET['pdf'];
2432 
2433  $max_points = 0;
2434  $counter = 1;
2435 
2436  require_once 'Modules/Test/classes/class.ilTestQuestionHeaderBlockBuilder.php';
2437  $questionHeaderBlockBuilder = new ilTestQuestionHeaderBlockBuilder($this->lng);
2438  $questionHeaderBlockBuilder->setHeaderMode($this->object->getTitleOutput());
2439 
2440  if ($isPdfDeliveryRequest) {
2441  require_once 'Services/WebAccessChecker/classes/class.ilWACSignedPath.php';
2443 
2444  // prepare generation before contents are processed (for mathjax)
2446  }
2447 
2448  foreach ($this->object->questions as $question) {
2449  $template->setCurrentBlock("question");
2450  $question_gui = $this->object->createQuestionGUI("", $question);
2451  $question_gui->setRenderPurpose(assQuestionGUI::RENDER_PURPOSE_PREVIEW);
2452 
2453  $questionHeaderBlockBuilder->setQuestionTitle($question_gui->object->getTitle());
2454  $questionHeaderBlockBuilder->setQuestionPoints($question_gui->object->getMaximumPoints());
2455  $questionHeaderBlockBuilder->setQuestionPosition($counter);
2456  $template->setVariable("QUESTION_HEADER", $questionHeaderBlockBuilder->getHTML());
2457 
2458  $template->setVariable("SOLUTION_OUTPUT", $question_gui->getPreview(false));
2459  $template->parseCurrentBlock("question");
2460  $counter++;
2461  $max_points += $question_gui->object->getMaximumPoints();
2462  }
2463 
2464  $template->setVariable("TITLE", ilUtil::prepareFormOutput($this->object->getTitle()));
2465  $template->setVariable("PRINT_TEST", ilUtil::prepareFormOutput($this->lng->txt("review_view")));
2466  $template->setVariable("TXT_PRINT_DATE", ilUtil::prepareFormOutput($this->lng->txt("date")));
2467  $usedRelativeDates = ilDatePresentation::useRelativeDates();
2469  $template->setVariable(
2470  "VALUE_PRINT_DATE",
2472  );
2473  ilDatePresentation::setUseRelativeDates($usedRelativeDates);
2474  $template->setVariable("TXT_MAXIMUM_POINTS", ilUtil::prepareFormOutput($this->lng->txt("tst_maximum_points")));
2475  $template->setVariable("VALUE_MAXIMUM_POINTS", ilUtil::prepareFormOutput($max_points));
2476 
2477  if ($isPdfDeliveryRequest) {
2478  require_once 'Modules/Test/classes/class.ilTestPDFGenerator.php';
2480  } else {
2481  $this->ctrl->setParameter($this, "pdf", "1");
2482  $template->setCurrentBlock("pdf_export");
2483  $template->setVariable("PDF_URL", $this->ctrl->getLinkTarget($this, "review"));
2484  $this->ctrl->setParameter($this, "pdf", "");
2485  $template->setVariable("PDF_TEXT", $this->lng->txt("pdf_export"));
2486  $template->parseCurrentBlock();
2487 
2488  $template->setCurrentBlock("navigation_buttons");
2489  $template->setVariable("BUTTON_PRINT", $this->lng->txt("print"));
2490  $template->parseCurrentBlock();
2491 
2492 
2493  $this->tpl->setVariable("PRINT_CONTENT", $template->get());
2494  }
2495  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
const PDF_PRINT_VIEW_QUESTIONS
$template
global $DIC
Definition: saml.php:7
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
static setUseRelativeDates($a_status)
set use relative dates
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static useRelativeDates()
check if relative dates are used
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
special template class to simplify handling of ITX/PEAR
Date and time handling
static setTokenMaxLifetimeInSeconds($token_max_lifetime_in_seconds)
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
static prepareGenerationRequest($service, $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
+ Here is the call graph for this function:

◆ runObject()

ilObjTestGUI::runObject ( )

Definition at line 924 of file class.ilObjTestGUI.php.

925  {
926  $this->ctrl->redirect($this, "infoScreen");
927  }

◆ saveOrderAndObligationsObject()

ilObjTestGUI::saveOrderAndObligationsObject ( )

Definition at line 3574 of file class.ilObjTestGUI.php.

References $DIC, $id, $ilCtrl, ilObjTest\isQuestionObligationPossible(), and ilUtil\sendInfo().

3575  {
3576  global $DIC;
3577  $ilAccess = $DIC['ilAccess'];
3578  if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
3579  // allow only write access
3580  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
3581  $this->ctrl->redirect($this, "infoScreen");
3582  }
3583 
3584  global $DIC;
3585  $ilCtrl = $DIC['ilCtrl'];
3586 
3587  $orders = $obligations = array();
3588 
3589  foreach ((array) $_REQUEST['order'] as $qId => $order) {
3590  $id = (int) str_replace('q_', '', $qId);
3591 
3592  $orders[$id] = $order;
3593  }
3594 
3595  if ($this->object->areObligationsEnabled() && isset($_REQUEST['obligatory']) && is_array($_REQUEST['obligatory'])) {
3596  foreach ($_REQUEST['obligatory'] as $qId => $obligation) {
3597  $id = (int) str_replace('q_', '', $qId);
3598 
3600  $obligations[$id] = $obligation;
3601  }
3602  }
3603  }
3604 
3605  $this->object->setQuestionOrderAndObligations(
3606  $orders,
3607  $obligations
3608  );
3609 
3610  ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
3611  $ilCtrl->redirect($this, 'questions');
3612  }
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static isQuestionObligationPossible($questionId)
checks wether the obligation for question with given id is possible or not
+ Here is the call graph for this function:

◆ setTabsManager()

ilObjTestGUI::setTabsManager (   $tabsManager)
Parameters
ilTestTabsManager$tabsManager

Definition at line 866 of file class.ilObjTestGUI.php.

References $tabsManager.

Referenced by __construct().

867  {
868  $this->tabsManager = $tabsManager;
869  }
+ Here is the caller graph for this function:

◆ setTestAccess()

ilObjTestGUI::setTestAccess (   $testAccess)
Parameters
ilTestAccess$testAccess

Definition at line 850 of file class.ilObjTestGUI.php.

References $testAccess.

Referenced by __construct().

851  {
852  $this->testAccess = $testAccess;
853  }
+ Here is the caller graph for this function:

◆ showPageObject()

ilObjTestGUI::showPageObject ( )

Definition at line 3678 of file class.ilObjTestGUI.php.

References $DIC, and $ilCtrl.

Referenced by movePageObject().

3679  {
3680  global $DIC;
3681  $ilCtrl = $DIC['ilCtrl'];
3682 
3683  $ilCtrl->setParameterByClass('iltestexpresspageobjectgui', 'q_id', $_REQUEST['q_id']);
3684  $ilCtrl->redirectByClass('iltestexpresspageobjectgui', 'showPage');
3685  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ statisticsObject()

ilObjTestGUI::statisticsObject ( )

Definition at line 2925 of file class.ilObjTestGUI.php.

2926  {
2927  }

◆ takenObject()

ilObjTestGUI::takenObject ( )

Definition at line 2232 of file class.ilObjTestGUI.php.

2233  {
2234  }

◆ trackTestObjectReadEvent()

ilObjTestGUI::trackTestObjectReadEvent ( )
protected

Definition at line 762 of file class.ilObjTestGUI.php.

References $DIC, and ilChangeEvent\_recordReadEvent().

Referenced by executeCommand(), and redirectToInfoScreenObject().

763  {
764  /* @var ILIAS\DI\Container $DIC */ global $DIC;
765 
766  require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
767 
769  $this->object->getType(),
770  $this->object->getRefId(),
771  $this->object->getId(),
772  $DIC->user()->getId()
773  );
774  }
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadObject()

ilObjTestGUI::uploadObject (   $redirect = true)

display status information or report errors messages in case of error

public

Definition at line 1276 of file class.ilObjTestGUI.php.

References uploadTstObject().

1277  {
1278  $this->uploadTstObject();
1279  }
uploadTstObject()
imports test and question(s)
+ Here is the call graph for this function:

◆ uploadTstObject()

ilObjTestGUI::uploadTstObject ( )

imports test and question(s)

Definition at line 1017 of file class.ilObjTestGUI.php.

References $_POST, $_SESSION, $result, ilObjTest\_createImportDirectory(), ilObjTest\_getImportDirectory(), ilObjTest\_setImportDirectory(), CLOZE_TEST_IDENTIFIER, ilObjectGUI\createObject(), ilUtil\delDir(), ERROR_TEXT_IDENTIFIER, FILE_UPLOAD_IDENTIFIER, FLASHAPPLET_QUESTION_IDENTIFIER, FORMULA_QUESTION_IDENTIFIER, ilUtil\getImagePath(), IL_MO_VERIFY_QTI, IMAGEMAP_QUESTION_IDENTIFIER, importVerifiedFileObject(), JAVAAPPLET_QUESTION_IDENTIFIER, KPRIM_CHOICE_QUESTION_IDENTIFIER, LONG_MENU_QUESTION_IDENTIFIER, MATCHING_QUESTION_IDENTIFIER, MULTIPLE_CHOICE_QUESTION_IDENTIFIER, NUMERIC_QUESTION_IDENTIFIER, ORDERING_HORIZONTAL_IDENTIFIER, ORDERING_QUESTION_IDENTIFIER, QT_CLOZE, QT_ERRORTEXT, QT_FILEUPLOAD, QT_FLASHAPPLET, QT_FORMULA, QT_IMAGEMAP, QT_JAVAAPPLET, QT_KPRIM_CHOICE, QT_LONG_MENU, QT_MATCHING, QT_MULTIPLE_CHOICE_MR, QT_MULTIPLE_CHOICE_SR, QT_NUMERIC, QT_ORDERING, QT_ORDERING_HORIZONTAL, QT_TEXT, QT_TEXTSUBSET, ilObjTest\QUESTION_SET_TYPE_FIXED, ilUtil\sendFailure(), ilUtil\sendInfo(), SINGLE_CHOICE_QUESTION_IDENTIFIER, TEXT_QUESTION_IDENTIFIER, TEXTSUBSET_QUESTION_IDENTIFIER, and ilUtil\unzip().

Referenced by importFileObject(), and uploadObject().

1018  {
1019  if ($_FILES["xmldoc"]["error"] > UPLOAD_ERR_OK) {
1020  ilUtil::sendFailure($this->lng->txt("error_upload"));
1021  $this->createObject();
1022  return;
1023  }
1024  include_once("./Modules/Test/classes/class.ilObjTest.php");
1025  // create import directory
1026  $basedir = ilObjTest::_createImportDirectory();
1027 
1028  // copy uploaded file to import directory
1029  $file = pathinfo($_FILES["xmldoc"]["name"]);
1030  $full_path = $basedir . "/" . $_FILES["xmldoc"]["name"];
1031  ilUtil::moveUploadedFile($_FILES["xmldoc"]["tmp_name"], $_FILES["xmldoc"]["name"], $full_path);
1032 
1033  // unzip file
1034  ilUtil::unzip($full_path);
1035 
1036  // determine filenames of xml files
1037  $subdir = basename($file["basename"], "." . $file["extension"]);
1039  $xml_file = ilObjTest::_getImportDirectory() . '/' . $subdir . '/' . $subdir . ".xml";
1040  $qti_file = ilObjTest::_getImportDirectory() . '/' . $subdir . '/' . preg_replace("/test|tst/", "qti", $subdir) . ".xml";
1041  $results_file = ilObjTest::_getImportDirectory() . '/' . $subdir . '/' . preg_replace("/test|tst/", "results", $subdir) . ".xml";
1042 
1043  if (!is_file($qti_file)) {
1044  ilUtil::delDir($basedir);
1045  ilUtil::sendFailure($this->lng->txt("tst_import_non_ilias_zip"));
1046  $this->createObject();
1047  return;
1048  }
1049 
1050  // start verification of QTI files
1051  include_once "./Services/QTI/classes/class.ilQTIParser.php";
1052  $qtiParser = new ilQTIParser($qti_file, IL_MO_VERIFY_QTI, 0, "");
1053  $result = $qtiParser->startParsing();
1054  $founditems = &$qtiParser->getFoundItems();
1055 
1056  $complete = 0;
1057  $incomplete = 0;
1058  foreach ($founditems as $item) {
1059  if (strlen($item["type"])) {
1060  $complete++;
1061  } else {
1062  $incomplete++;
1063  }
1064  }
1065 
1066  if (count($founditems) && $complete == 0) {
1067  // delete import directory
1068  ilUtil::delDir($basedir);
1069 
1070  ilUtil::sendInfo($this->lng->txt("qpl_import_non_ilias_files"));
1071  $this->createObject();
1072  return;
1073  }
1074 
1075  $_SESSION["tst_import_results_file"] = $results_file;
1076  $_SESSION["tst_import_xml_file"] = $xml_file;
1077  $_SESSION["tst_import_qti_file"] = $qti_file;
1078  $_SESSION["tst_import_subdir"] = $subdir;
1079 
1080  if ($qtiParser->getQuestionSetType() != ilObjTest::QUESTION_SET_TYPE_FIXED) {
1081  $this->importVerifiedFileObject();
1082  return;
1083  }
1084 
1085  // display of found questions
1086  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.tst_import_verification.html", "Modules/Test");
1087  $row_class = array("tblrow1", "tblrow2");
1088  $counter = 0;
1089  foreach ($founditems as $item) {
1090  $this->tpl->setCurrentBlock("verification_row");
1091  $this->tpl->setVariable("ROW_CLASS", $row_class[$counter++ % 2]);
1092  $this->tpl->setVariable("QUESTION_TITLE", $item["title"]);
1093  $this->tpl->setVariable("QUESTION_IDENT", $item["ident"]);
1094  include_once "./Services/QTI/classes/class.ilQTIItem.php";
1095  switch ($item["type"]) {
1097  case QT_MULTIPLE_CHOICE_MR:
1098  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assMultipleChoice"));
1099  break;
1101  case QT_MULTIPLE_CHOICE_SR:
1102  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assSingleChoice"));
1103  break;
1105  case QT_KPRIM_CHOICE:
1106  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assKprimChoice"));
1107  break;
1109  case QT_LONG_MENU:
1110  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assLongMenu"));
1111  break;
1113  case QT_NUMERIC:
1114  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assNumeric"));
1115  break;
1117  case QT_FORMULA:
1118  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assFormulaQuestion"));
1119  break;
1121  case QT_TEXTSUBSET:
1122  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assTextSubset"));
1123  break;
1124  case CLOZE_TEST_IDENTIFIER:
1125  case QT_CLOZE:
1126  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assClozeTest"));
1127  break;
1128  case ERROR_TEXT_IDENTIFIER:
1129  case QT_ERRORTEXT:
1130  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assErrorText"));
1131  break;
1133  case QT_IMAGEMAP:
1134  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assImagemapQuestion"));
1135  break;
1137  case QT_JAVAAPPLET:
1138  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assJavaApplet"));
1139  break;
1141  case QT_FLASHAPPLET:
1142  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assFlashApplet"));
1143  break;
1145  case QT_MATCHING:
1146  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assMatchingQuestion"));
1147  break;
1149  case QT_ORDERING:
1150  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assOrderingQuestion"));
1151  break;
1154  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assOrderingHorizontal"));
1155  break;
1157  case QT_TEXT:
1158  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assTextQuestion"));
1159  break;
1161  case QT_FILEUPLOAD:
1162  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assFileUpload"));
1163  break;
1164  }
1165  $this->tpl->parseCurrentBlock();
1166  }
1167 
1168  // on import creation screen the pool was chosen (-1 for no pool)
1169  // BUT when no pool is available the input on creation screen is missing, so the field value -1 for no pool is not submitted.
1170  $QplOrTstID = isset($_POST["qpl"]) && (int) $_POST["qpl"] != 0 ? $_POST["qpl"] : -1;
1171 
1172  $this->tpl->setCurrentBlock("adm_content");
1173  $this->tpl->setVariable("TEXT_TYPE", $this->lng->txt("question_type"));
1174  $this->tpl->setVariable("TEXT_TITLE", $this->lng->txt("question_title"));
1175  $this->tpl->setVariable("FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt("tst_import_verify_found_questions"));
1176  $this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_tst"));
1177  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1178  $this->tpl->setVariable("ARROW", ilUtil::getImagePath("arrow_downright.svg"));
1179  $this->tpl->setVariable("QUESTIONPOOL_ID", $QplOrTstID);
1180  $this->tpl->setVariable("VALUE_IMPORT", $this->lng->txt("import"));
1181  $this->tpl->setVariable("VALUE_CANCEL", $this->lng->txt("cancel"));
1182  $this->tpl->parseCurrentBlock();
1183  }
const MATCHING_QUESTION_IDENTIFIER
const MULTIPLE_CHOICE_QUESTION_IDENTIFIER
const QT_MATCHING
const QT_FORMULA
const QT_FILEUPLOAD
const ERROR_TEXT_IDENTIFIER
$_SESSION["AccountId"]
$result
const QT_TEXT
const QT_ORDERING_HORIZONTAL
const KPRIM_CHOICE_QUESTION_IDENTIFIER
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
const LONG_MENU_QUESTION_IDENTIFIER
const TEXTSUBSET_QUESTION_IDENTIFIER
const QT_KPRIM_CHOICE
createObject()
create new object form
const QT_IMAGEMAP
const FILE_UPLOAD_IDENTIFIER
const QT_MULTIPLE_CHOICE_SR
const JAVAAPPLET_QUESTION_IDENTIFIER
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
const QT_LONG_MENU
const NUMERIC_QUESTION_IDENTIFIER
const ORDERING_HORIZONTAL_IDENTIFIER
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
const ORDERING_QUESTION_IDENTIFIER
const TEXT_QUESTION_IDENTIFIER
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const QT_JAVAAPPLET
const FLASHAPPLET_QUESTION_IDENTIFIER
static _createImportDirectory()
creates data directory for import files (data_dir/tst_data/tst_<id>/import, depending on data directo...
const QT_NUMERIC
importVerifiedFileObject()
imports question(s) into the questionpool (after verification)
const QT_TEXTSUBSET
const QT_FLASHAPPLET
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
const QT_CLOZE
const QT_MULTIPLE_CHOICE_MR
const IL_MO_VERIFY_QTI
const SINGLE_CHOICE_QUESTION_IDENTIFIER
const QT_ORDERING
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
$_POST["username"]
const CLOZE_TEST_IDENTIFIER
Question identifier constants.
static _setImportDirectory($a_import_dir=null)
set import directory
static _getImportDirectory()
Get the import directory location of the test.
const IMAGEMAP_QUESTION_IDENTIFIER
const QT_ERRORTEXT
const FORMULA_QUESTION_IDENTIFIER
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userResultsGatewayObject()

ilObjTestGUI::userResultsGatewayObject ( )
private

Definition at line 830 of file class.ilObjTestGUI.php.

References forwardToEvaluationGUI().

831  {
832  $this->ctrl->setCmdClass('ilTestEvaluationGUI');
833  $this->ctrl->setCmd('outUserResultsOverview');
834  $this->tabs_gui->clearTargets();
835 
836  $this->forwardToEvaluationGUI();
837  }
+ Here is the call graph for this function:

Field Documentation

◆ $infoScreenChildClasses

ilObjTestGUI::$infoScreenChildClasses
staticprivate
Initial value:
= array(
'ilpublicuserprofilegui', 'ilobjportfoliogui'
)

Definition at line 54 of file class.ilObjTestGUI.php.

◆ $object

ilObjTestGUI::$object = null

Definition at line 59 of file class.ilObjTestGUI.php.

Referenced by executeCommand().

◆ $objectiveOrientedContainer

ilObjTestGUI::$objectiveOrientedContainer
private

Definition at line 81 of file class.ilObjTestGUI.php.

Referenced by getObjectiveOrientedContainer().

◆ $tabsManager

ilObjTestGUI::$tabsManager
protected

Definition at line 76 of file class.ilObjTestGUI.php.

Referenced by __construct(), getTabsManager(), and setTabsManager().

◆ $testAccess

ilObjTestGUI::$testAccess
protected

Definition at line 86 of file class.ilObjTestGUI.php.

Referenced by getTestAccess(), and setTestAccess().

◆ $testPlayerFactory

ilObjTestGUI::$testPlayerFactory = null
private

Definition at line 65 of file class.ilObjTestGUI.php.

◆ $testQuestionSetConfigFactory

ilObjTestGUI::$testQuestionSetConfigFactory = null
private

Definition at line 62 of file class.ilObjTestGUI.php.

◆ $testSequenceFactory

ilObjTestGUI::$testSequenceFactory = null
private

Definition at line 71 of file class.ilObjTestGUI.php.

◆ $testSessionFactory

ilObjTestGUI::$testSessionFactory = null
private

Definition at line 68 of file class.ilObjTestGUI.php.


The documentation for this class was generated from the following file: