ILIAS  release_4-4 Revision
ilObjTestGUI Class Reference

Class ilObjTestGUI. More...

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

Public Member Functions

 ilObjTestGUI ()
 Constructor public. More...
 
 executeCommand ()
 execute command More...
 
 createUserResults ($show_pass_details, $show_answers, $show_reached_points, $show_user_results)
 
 runObject ()
 
 outEvaluationObject ()
 
 importFileObject ()
 form for new test object import More...
 
 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...
 
 confirmScoringObject ($confirmCmd='saveScoring', $cancelCmd='scoring')
 
 populateHiddenField ($value, $key, $path='')
 
 saveScoringObject ()
 Save the form input of the scoring form. More...
 
 scoringObject ($checkonly=FALSE)
 Display and fill the scoring settings form of the test. 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...
 
 filterAvailableQuestionsObject ()
 
 resetfilterAvailableQuestionsObject ()
 
 questionBrowser ()
 Creates a form to select questions from questionpools to insert the questions into the test. More...
 
 addQuestionObject ()
 
 questionsObject ()
 
 takenObject ()
 
 addMarkStepObject ()
 Add a new mark step to the tests marks. More...
 
 saveMarkSchemaFormData ()
 Save the mark schema POST data when the form was submitted. More...
 
 addSimpleMarkSchemaObject ()
 Add a simple mark schema to the tests marks. More...
 
 deleteMarkStepsObject ()
 Delete selected mark steps. More...
 
 cancelMarksObject ()
 Cancel the mark schema form and return to the properties form. More...
 
 saveMarksObject ()
 Save the mark schema. More...
 
 marksObject ()
 
 confirmDeleteAllUserResultsObject ()
 Deletes all user data for the test object. More...
 
 confirmDeleteSelectedUserDataObject ()
 Deletes the selected user data for the test object. More...
 
 cancelDeleteSelectedUserDataObject ()
 Cancels the deletion of all user data for the test object. More...
 
 deleteAllUserDataObject ()
 Asks for a confirmation to delete all user data of the test object. More...
 
 deleteAllUserResultsObject ()
 Asks for a confirmation to delete all user data of the test object. More...
 
 deleteSingleUserResultsObject ()
 Asks for a confirmation to delete selected user data of the test object. More...
 
 historyObject ()
 Creates the change history for a test. More...
 
 initImportForm ($a_new_type)
 
 participantsActionObject ()
 Evaluates the actions on the participants page. More...
 
 participantsObject ()
 Creates the output of the test participants. More...
 
 timingOverviewObject ()
 
 timingObject ()
 
 showTimingFormObject ()
 
 applyFilterCriteria ($in_rows)
 
 fpSetFilterObject ()
 
 fpResetFilterObject ()
 
 npSetFilterObject ()
 
 npResetFilterObject ()
 
 showDetailedResultsObject ()
 Shows the pass overview and the answers of one ore more users for the scored pass. More...
 
 showUserAnswersObject ()
 Shows the answers of one ore more users for the scored pass. More...
 
 showPassOverviewObject ()
 Shows the pass overview of the scored pass for one ore more users. More...
 
 showUserResults ($show_pass_details, $show_answers, $show_reached_points=FALSE)
 Shows the pass overview of the scored pass for one ore more users. More...
 
 removeParticipantObject ()
 
 saveClientIPObject ()
 
 printobject ()
 Print tab to create a print of all questions with points and solutions. More...
 
 addParticipantsObject ($a_user_ids=array())
 
 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 ()
 
 getBrowseForQuestionsTab (&$tabs_gui)
 
 getRandomQuestionsTab (&$tabs_gui)
 
 statisticsObject ()
 
 certificateObject ()
 Shows the certificate editor. More...
 
 getQuestionsSubTabs ()
 
 getStatisticsSubTabs ()
 
 getSettingsSubTabs ($hiddenTabs=array())
 
 getParticipantsSubTabs ()
 
 getTabs (&$tabs_gui)
 adds tabs to tab gui object More...
 
 _goto ($a_target)
 Redirect script to call a test with the test reference id. 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...
 
 saveOrderAndObligationsObject ()
 
 movePageObject ()
 
 showPageObject ()
 
 copyQuestionObject ()
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 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...
 
 editObject ()
 edit object More...
 
 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...
 

Data Fields

 $object = null
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $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

 movePageFormObject ()
 Move current page. More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 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...
 
 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...
 
 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...
 
 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)
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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...
 

Private Member Functions

 questionsTabGatewayObject ()
 
 redirectTo_ilObjTestSettingsGeneralGUI_showForm_Object ()
 
 prepareSubGuiOutput ()
 prepares ilias to get output rendered by sub gui class More...
 
 formTimingObject ()
 
 getQuestionpoolCreationForm ()
 
 applyTemplate ($templateData, $object)
 
 isDeleteDynamicTestResultsButtonRequired ($testSession, $testSequence)
 
 populateDeleteDynamicTestResultsButton ($testSession, &$big_button)
 

Private Attributes

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

Additional Inherited Members

- 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...
 

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, ilMDEditorGUI, ilCertificateGUI, ilPermissionGUI ilObjTestGUI: ilTestOutputGUI, ilTestPlayerDynamicQuestionSetGUI, ilLearningProgressGUI ilObjTestGUI: ilTestEvaluationGUI, ilAssGenFeedbackPageGUI, ilAssSpecFeedbackPageGUI ilObjTestGUI: ilInfoScreenGUI, ilShopPurchaseGUI, ilObjectCopyGUI, ilTestScoringGUI ilObjTestGUI: ilRepositorySearchGUI, ilScoringAdjustmentGUI, ilTestExportGUI ilObjTestGUI: assMultipleChoiceGUI, assClozeTestGUI, assMatchingQuestionGUI ilObjTestGUI: assOrderingQuestionGUI, assImagemapQuestionGUI, assJavaAppletGUI ilObjTestGUI: assNumericGUI, assErrorTextGUI, ilTestScoringByQuestionsGUI ilObjTestGUI: assTextSubsetGUI, assOrderingHorizontalGUI, ilTestToplistGUI ilObjTestGUI: assSingleChoiceGUI, assFileUploadGUI, assTextQuestionGUI, assFlashQuestionGUI ilObjTestGUI: ilTestExpressPageObjectGUI, ilPageEditorGUI, ilAssQuestionPageGUI ilObjTestGUI: ilObjQuestionPoolGUI, ilEditClipboardGUI, ilObjTestSettingsGeneralGUI ilObjTestGUI: ilCommonActionDispatcherGUI, ilObjTestDynamicQuestionSetConfigGUI ilObjTestGUI: ilTestRandomQuestionSetConfigGUI ilObjTestGUI: ilAssQuestionHintsGUI, ilAssQuestionFeedbackEditingGUI, ilLocalUnitConfigurationGUI, assFormulaQuestionGUI ilObjTestGUI: ilTestSettingsChangeConfirmationGUI

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

Member Function Documentation

◆ _goto()

ilObjTestGUI::_goto (   $a_target)

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 4843 of file class.ilObjTestGUI.php.

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

4844  {
4845  global $ilAccess, $ilErr, $lng;
4846 
4847  if ($ilAccess->checkAccess("read", "", $a_target))
4848  {
4849  //include_once "./Services/Utilities/classes/class.ilUtil.php";
4850  $_GET["baseClass"] = "ilObjTestGUI";
4851  $_GET["cmd"] = "infoScreen";
4852  $_GET["ref_id"] = $a_target;
4853  include_once("ilias.php");
4854  exit;
4855  //ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=infoScreen&ref_id=$a_target");
4856  }
4857  else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
4858  {
4859  ilUtil::sendInfo(sprintf($lng->txt("msg_no_perm_read_item"),
4860  ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true);
4862  }
4863 
4864  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
4865  }
exit
Definition: login.php:54
$_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)
+ Here is the call graph for this function:

◆ addDefaultsObject()

ilObjTestGUI::addDefaultsObject ( )

Adds the defaults of this test to the defaults.

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

References $_POST, and ilUtil\sendInfo().

3847  {
3848  if (strlen($_POST["name"]) > 0)
3849  {
3850  $this->object->addDefaults($_POST['name']);
3851  }
3852  else
3853  {
3854  ilUtil::sendInfo($this->lng->txt("tst_defaults_enter_name"));
3855  }
3856  $this->defaultsObject();
3857  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ addDidacticTemplateOptions()

ilObjTestGUI::addDidacticTemplateOptions ( array &  $a_options)

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

References $row, and ilSettingsTemplate\getAllSettingsTemplates().

749  {
750  include_once("./Modules/Test/classes/class.ilObjTest.php");
751  $tst = new ilObjTest();
752  $defaults = $tst->getAvailableDefaults();
753  if (count($defaults))
754  {
755  foreach ($defaults as $row)
756  {
757  $a_options["tstdef_".$row["test_defaults_id"]] = array($row["name"],
758  $this->lng->txt("tst_default_settings"));
759  }
760  }
761 
762  // using template?
763  include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
765  if($templates)
766  {
767  foreach($templates as $item)
768  {
769  $a_options["tsttpl_".$item["id"]] = array($item["title"],
770  nl2br(trim($item["description"])));
771  }
772  }
773  }
static getAllSettingsTemplates($a_type)
Get all settings templates of type.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjTestGUI::addLocatorItems ( )

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

References $_GET.

4242  {
4243  global $ilLocator;
4244  switch ($this->ctrl->getCmd())
4245  {
4246  case "run":
4247  case "infoScreen":
4248  case "redirectToInfoScreen":
4249  case "start":
4250  case "resume":
4251  case "previous":
4252  case "next":
4253  case "summary":
4254  case "finishTest":
4255  case "outCorrectSolution":
4256  case "passDetails":
4257  case "showAnswersOfUser":
4258  case "outUserResultsOverview":
4259  case "backFromSummary":
4260  case "show_answers":
4261  case "setsolved":
4262  case "resetsolved":
4263  case "outTestSummary":
4264  case "outQuestionSummary":
4265  case "gotoQuestion":
4266  case "selectImagemapRegion":
4267  case "confirmSubmitAnswers":
4268  case "finalSubmission":
4269  case "postpone":
4270  case "redirectQuestion":
4271  case "outUserPassDetails":
4272  case "checkPassword":
4273  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "infoScreen"), "", $_GET["ref_id"]);
4274  break;
4275  case "eval_stat":
4276  case "evalAllUsers":
4277  case "evalUserDetail":
4278  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "eval_stat"), "", $_GET["ref_id"]);
4279  break;
4280  case "create":
4281  case "save":
4282  case "cancel":
4283  case "importFile":
4284  case "cloneAll":
4285  case "importVerifiedFile":
4286  case "cancelImport":
4287  break;
4288  default:
4289  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
4290  break;
4291  }
4292  }
$_GET["client_id"]

◆ addMarkStepObject()

ilObjTestGUI::addMarkStepObject ( )

Add a new mark step to the tests marks.

Add a new mark step to the tests marks

public

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

References marksObject(), and saveMarkSchemaFormData().

2481  {
2482  $this->saveMarkSchemaFormData();
2483  $this->object->mark_schema->addMarkStep();
2484  $this->marksObject();
2485  }
saveMarkSchemaFormData()
Save the mark schema POST data when the form was submitted.
+ Here is the call graph for this function:

◆ addParticipantsObject()

ilObjTestGUI::addParticipantsObject (   $a_user_ids = array())

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

References $_POST, ilObjectGUI\$tpl, and ilUtil\sendInfo().

3654  {
3655  $countusers = 0;
3656  // add users
3657  if (is_array($a_user_ids))
3658  {
3659  $i = 0;
3660  foreach ($a_user_ids as $user_id)
3661  {
3662  $client_ip = $_POST["client_ip"][$i];
3663  $this->object->inviteUser($user_id, $client_ip);
3664  $countusers++;
3665  $i++;
3666  }
3667  }
3668  $message = "";
3669  if ($countusers)
3670  {
3671  $message = $this->lng->txt("tst_invited_selected_users");
3672  }
3673  if (strlen($message))
3674  {
3675  ilUtil::sendInfo($message, TRUE);
3676  }
3677  else
3678  {
3679  ilUtil::sendInfo($this->lng->txt("tst_invited_nobody"), TRUE);
3680  return false;
3681  }
3682 
3683  $this->ctrl->redirect($this, "participants");
3684  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ addQuestionObject()

ilObjTestGUI::addQuestionObject ( )

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

References $_REQUEST, ilObjectGUI\$data, $ilCtrl, ilObjectGUI\$lng, $options, $si, ilObjectGUI\$tpl, ilObjQuestionPool\_getAvailableQuestionpools(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT, ilRadioGroupInputGUI\addOption(), ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setSize(), and ilRadioOption\setValue().

2230  {
2231  global $lng, $ilCtrl, $tpl;
2232 
2233  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
2234 
2235  $ilCtrl->setParameter($this, 'qtype', $_REQUEST['qtype']);
2236 
2237  $form = new ilPropertyFormGUI();
2238 
2239  $form->setFormAction($ilCtrl->getFormAction($this, "executeCreateQuestion"));
2240  $form->setTitle($lng->txt("ass_create_question"));
2241  include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
2242 
2243  $pool = new ilObjQuestionPool();
2244  $questionTypes = $pool->getQuestionTypes(false, true);
2245  $options = array();
2246 
2247  // question type
2248  foreach($questionTypes as $label => $data)
2249  {
2250  $options[$data['question_type_id']] = $label;
2251  }
2252 
2253  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
2254  $si = new ilSelectInputGUI($lng->txt("question_type"), "qtype");
2255  $si->setOptions($options);
2256  $form->addItem($si, true);
2257 
2258  // position
2259  $questions = $this->object->getQuestionTitlesAndIndexes();
2260  if($questions)
2261  {
2262  $si = new ilSelectInputGUI($lng->txt("position"), "position");
2263  $options = array('0' => $lng->txt('first'));
2264  foreach($questions as $key => $title)
2265  {
2266  $options[$key] = $lng->txt('behind') . ' '. $title . ' ['.$this->lng->txt('question_id_short') . ': '. $key .']';
2267  }
2268  $si->setOptions($options);
2269  $si->setValue($_REQUEST['q_id']);
2270  $form->addItem($si, true);
2271  }
2272 
2273  // content editing mode
2275  {
2276  $ri = new ilRadioGroupInputGUI($lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
2277 
2278  $ri->addOption(new ilRadioOption(
2279  $lng->txt('tst_add_quest_cont_edit_mode_default'),
2281  ));
2282 
2283  $ri->addOption(new ilRadioOption(
2284  $lng->txt('tst_add_quest_cont_edit_mode_page_object'),
2286  ));
2287 
2289 
2290  $form->addItem($ri, true);
2291  }
2292  else
2293  {
2294  $hi = new ilHiddenInputGUI("question_content_editing_type");
2296  $form->addItem($hi, true);
2297  }
2298 
2299  if($this->object->getPoolUsage())
2300  {
2301  // use pool
2302  $usage = new ilRadioGroupInputGUI($this->lng->txt("assessment_pool_selection"), "usage");
2303  $usage->setRequired(true);
2304  $no_pool = new ilRadioOption($this->lng->txt("assessment_no_pool"), 1);
2305  $usage->addOption($no_pool);
2306  $existing_pool = new ilRadioOption($this->lng->txt("assessment_existing_pool"), 3);
2307  $usage->addOption($existing_pool);
2308  $new_pool = new ilRadioOption($this->lng->txt("assessment_new_pool"), 2);
2309  $usage->addOption($new_pool);
2310  $form->addItem($usage);
2311 
2312  $usage->setValue(1);
2313 
2314  $questionpools = ilObjQuestionPool::_getAvailableQuestionpools(FALSE, FALSE, TRUE, FALSE, FALSE, "write");
2315  $pools_data = array();
2316  foreach($questionpools as $key => $p)
2317  {
2318  $pools_data[$key] = $p['title'];
2319  }
2320  $pools = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "sel_qpl");
2321  $pools->setOptions($pools_data);
2322  $existing_pool->addSubItem($pools);
2323 
2324  $name = new ilTextInputGUI($this->lng->txt("name"), "txt_qpl");
2325  $name->setSize(50);
2326  $name->setMaxLength(50);
2327  $new_pool->addSubItem($name);
2328  }
2329 
2330  $form->addCommandButton("executeCreateQuestion", $lng->txt("submit"));
2331  $form->addCommandButton("questions", $lng->txt("cancel"));
2332 
2333  return $tpl->setContent($form->getHTML());
2334  }
This class represents an option in a radio group.
This class represents a selection list property in a property form.
This class represents a property form user interface.
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.
setValue($a_value)
Set Value.
if(!is_array($argv)) $options
setSize($a_size)
Set Size.
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 ...
& _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.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

◆ addSimpleMarkSchemaObject()

ilObjTestGUI::addSimpleMarkSchemaObject ( )

Add a simple mark schema to the tests marks.

Add a simple mark schema to the tests marks

public

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

References marksObject().

2527  {
2528  $this->object->mark_schema->createSimpleSchema($this->lng->txt("failed_short"), $this->lng->txt("failed_official"), 0, 0, $this->lng->txt("passed_short"), $this->lng->txt("passed_official"), 50, 1);
2529  $this->marksObject();
2530  }
+ Here is the call graph for this function:

◆ afterSave()

ilObjTestGUI::afterSave ( ilObject  $a_new_object)

save object public

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

References ilObjTest\_getTestDefaults(), applyTemplate(), ilObjectGUI\getDidacticTemplateVar(), ilObject\getRefId(), ilObjAssessmentFolderGUI\getSettingsTemplateConfig(), and ilUtil\sendSuccess().

780  {
781  $tstdef = $this->getDidacticTemplateVar("tstdef");
782  if ($tstdef)
783  {
784  $testDefaultsId = $tstdef;
785  $testDefaults = ilObjTest::_getTestDefaults($testDefaultsId);
786  $a_new_object->applyDefaults($testDefaults);
787  }
788 
789  $template_id = $this->getDidacticTemplateVar("tsttpl");
790  if($template_id)
791  {
792  include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
794 
795  $template_settings = $template->getSettings();
796  if($template_settings)
797  {
798  $this->applyTemplate($template_settings, $a_new_object);
799  }
800 
801  $a_new_object->setTemplate($template_id);
802  }
803 
804  $a_new_object->saveToDb();
805 
806  // always send a message
807  ilUtil::sendSuccess($this->lng->txt("object_added"),true);
808  $this->ctrl->setParameter($this, 'ref_id', $a_new_object->getRefId());
809  $this->ctrl->redirectByClass('ilObjTestSettingsGeneralGUI');
810  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getSettingsTemplateConfig()
Get settings template configuration object.
applyTemplate($templateData, $object)
getRefId()
get reference id public
getDidacticTemplateVar($a_type)
Get didactic template setting from creation screen.
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 3747 of file class.ilObjTestGUI.php.

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

Referenced by confirmedApplyDefaultsObject().

3748  {
3749  if( count($_POST["chb_defaults"]) != 1 )
3750  {
3752  $this->lng->txt("tst_defaults_apply_select_one")
3753  );
3754 
3755  return $this->defaultsObject();
3756  }
3757 
3758  // do not apply if user datasets exist
3759  if($this->object->evalTotalPersons() > 0)
3760  {
3762  $this->lng->txt("tst_defaults_apply_not_possible")
3763  );
3764 
3765  return $this->defaultsObject();
3766  }
3767 
3768  $defaults =& $this->object->getTestDefaults($_POST["chb_defaults"][0]);
3769  $defaultSettings = unserialize($defaults["defaults"]);
3770 
3771  if( isset($defaultSettings['isRandomTest']) )
3772  {
3773  if( $defaultSettings['isRandomTest'] )
3774  {
3775  $newQuestionSetType = ilObjTest::QUESTION_SET_TYPE_RANDOM;
3776  $this->object->setQuestionSetType(ilObjTest::QUESTION_SET_TYPE_RANDOM);
3777  }
3778  else
3779  {
3780  $newQuestionSetType = ilObjTest::QUESTION_SET_TYPE_FIXED;
3781  $this->object->setQuestionSetType(ilObjTest::QUESTION_SET_TYPE_FIXED);
3782  }
3783  }
3784  elseif( isset($defaultSettings['questionSetType']) )
3785  {
3786  $newQuestionSetType = $defaultSettings['questionSetType'];
3787  }
3788  $oldQuestionSetType = $this->object->getQuestionSetType();
3789  $questionSetTypeSettingSwitched = ( $oldQuestionSetType != $newQuestionSetType );
3790 
3791  $oldQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfigByType($oldQuestionSetType);
3792 
3793  switch( true )
3794  {
3795  case !$questionSetTypeSettingSwitched:
3796  case !$oldQuestionSetConfig->doesQuestionSetRelatedDataExist():
3797  case $confirmed:
3798 
3799  break;
3800 
3801  default:
3802 
3803  require_once 'Modules/Test/classes/confirmations/class.ilTestSettingsChangeConfirmationGUI.php';
3804  $confirmation = new ilTestSettingsChangeConfirmationGUI($this->lng, $this->object);
3805 
3806  $confirmation->setFormAction( $this->ctrl->getFormAction($this) );
3807  $confirmation->setCancel($this->lng->txt('cancel'), 'defaults');
3808  $confirmation->setConfirm($this->lng->txt('confirm'), 'confirmedApplyDefaults');
3809 
3810  $confirmation->setOldQuestionSetType($this->object->getQuestionSetType());
3811  $confirmation->setNewQuestionSetType($newQuestionSetType);
3812  $confirmation->setQuestionLossInfoEnabled(false);
3813  $confirmation->build();
3814 
3815  $confirmation->populateParametersFromPost();
3816 
3817  $this->tpl->setContent( $this->ctrl->getHTML($confirmation) );
3818 
3819  return;
3820  }
3821 
3822  if( $questionSetTypeSettingSwitched && $this->object->isOnline() )
3823  {
3824  $this->object->setOnline(false);
3825 
3826  $info = $this->lng->txt("tst_set_offline_due_to_switched_question_set_type_setting");
3827 
3828  ilUtil::sendInfo($info, true);
3829  }
3830 
3831  $this->object->applyDefaults($defaults);
3832 
3833  ilUtil::sendSuccess($this->lng->txt("tst_defaults_applied"), true);
3834 
3835  if( $questionSetTypeSettingSwitched && $oldQuestionSetConfig->doesQuestionSetRelatedDataExist() )
3836  {
3837  $oldQuestionSetConfig->removeQuestionSetRelatedData();
3838  }
3839 
3840  $this->ctrl->redirect($this, 'defaults');
3841  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyFilterCriteria()

ilObjTestGUI::applyFilterCriteria (   $in_rows)

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

References $_SESSION, $result, and $row.

Referenced by participantsObject().

3294  {
3295  global $ilDB;
3296 
3297  $sess_filter = $_SESSION['form_']['selection'];
3298  $sess_filter = str_replace('"','',$sess_filter);
3299  $sess_filter = explode(':', $sess_filter);
3300  $filter = substr($sess_filter[2],0, strlen($sess_filter[2])-1);
3301 
3302  if ($filter == 'all' || $filter == false)
3303  {
3304  return $in_rows; #unchanged - no filter.
3305  }
3306 
3307  $with_result = array();
3308  $without_result = array();
3309  foreach ($in_rows as $row)
3310  {
3311  $result = $ilDB->query(
3312  'SELECT count(solution_id) count
3313  FROM tst_solutions
3314  WHERE active_fi = ' . $ilDB->quote($row['active_id'])
3315  );
3316  $count = $ilDB->fetchAssoc($result);
3317  $count = $count['count'];
3318 
3319  if ($count == 0)
3320  {
3321  $without_result[] = $row;
3322  }
3323  else
3324  {
3325  $with_result[] = $row;
3326  }
3327  }
3328 
3329  if ($filter == 'withSolutions')
3330  {
3331  return $with_result;
3332  }
3333  return $without_result;
3334 
3335  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$result
+ Here is the caller graph for this function:

◆ applyTemplate()

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

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

References $object.

Referenced by afterSave().

5307  {
5308  // map formFieldName => setterName
5309  $simpleSetters = array(
5310  'anonymity' => 'setAnonymity',
5311  'question_set_type' => 'setQuestionSetType',
5312  'use_pool' => 'setPoolUsage',
5313  'test_enabled_views' => 'setEnabledViewMode',
5314  //'express_allow_question_pool' => 'setExpressModeQuestionPoolAllowed',
5315  'introduction' => 'setIntroduction',
5316  'showinfo' => 'setShowInfo',
5317  'finalstatement' => 'setFinalStatement',
5318  'showfinalstatement' => 'setShowFinalStatement',
5319  'chb_shuffle_questions' => 'setShuffleQuestions',
5320  'list_of_questions' => 'setListOfQuestionsSettings',
5321  'chb_show_marker' => 'setShowMarker',
5322  'chb_show_cancel' => 'setShowCancel',
5323  'kiosk' => 'setKiosk',
5324  'nr_of_tries' => 'setNrOfTries',
5325  'chb_processing_time' => 'setEnableProcessingTime',
5326  'chb_use_previous_answers' => 'setUsePreviousAnswers',
5327  'forcejs' => 'setForceJS',
5328  'title_output' => 'setTitleOutput',
5329  'password' => 'setPassword',
5330  'fixedparticipants' => 'setFixedParticipants',
5331  'allowedUsers' => 'setAllowedUsers',
5332  'allowedUsersTimeGap' => 'setAllowedUsersTimeGap',
5333  'mailnotification' => 'setMailNotification',
5334  'mailnottype' => 'setMailNotificationType',
5335  //'' => '',
5336  'count_system' => 'setCountSystem',
5337  'mc_scoring' => 'setMCScoring',
5338  'score_cutting' => 'setScoreCutting',
5339  'pass_scoring' => 'setScoreReporting',
5340 
5341  'instant_feedback' => 'setScoringFeedbackOptionsByArray',
5342 
5343  'results_presentation' => 'setResultsPresentationOptionsByArray',
5344  'export_settings' => 'setExportSettings',
5345  'print_bs_with_res' => 'setPrintBestSolutionWithResult',
5346  );
5347 
5348  if (!$templateData['results_presentation']['value'])
5349  {
5350  $templateData['results_presentation']['value'] = array();
5351  }
5352 
5353  foreach($simpleSetters as $field => $setter)
5354  {
5355  if($templateData[$field])
5356  {
5357  $object->$setter($templateData[$field]['value']);
5358  }
5359  }
5360  }
+ 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 1545 of file class.ilObjTestGUI.php.

Referenced by copyAndLinkQuestionsToPoolObject(), copyAndLinkToQuestionpoolObject(), and copyQuestionsToPoolObject().

1546  {
1547  $this->ctrl->redirect($this, "questions");
1548  }
+ Here is the caller graph for this function:

◆ backToRepositoryObject()

ilObjTestGUI::backToRepositoryObject ( )

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

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

813  {
814  include_once "./Services/Utilities/classes/class.ilUtil.php";
815  $path = $this->tree->getPathFull($this->object->getRefID());
816  ilUtil::redirect($this->getReturnLocation("cancel","./ilias.php?baseClass=ilRepositoryGUI&cmd=frameset&ref_id=" . $path[count($path) - 2]["child"]));
817  }
$path
Definition: index.php:22
static redirect($a_script)
http redirect to other 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 1716 of file class.ilObjTestGUI.php.

References questionBrowser().

1717  {
1718  $this->questionBrowser();
1719  }
questionBrowser()
Creates a form to select questions from questionpools to insert the questions into the test...
+ Here is the call graph for this function:

◆ buildPageViewToolbar()

ilObjTestGUI::buildPageViewToolbar (   $qid = 0)

Questions per page.

Parameters

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

References $_REQUEST, $ilCtrl, $ilUser, ilObjectGUI\$lng, $options, $si, $total, ilObjTestAccess\_lookupOnlineTestAccess(), and getQuestionsSubTabs().

Referenced by executeCommand().

4874  {
4875  if($this->create_question_mode)
4876  return;
4877 
4878  global $ilToolbar, $ilCtrl, $lng;
4879 
4880  $this->getQuestionsSubTabs();
4881 
4882  $ilCtrl->saveParameter($this, 'q_mode');
4883 
4884  $ilCtrl->setParameterByClass('iltestexpresspageobjectgui', 'test_express_mode', 1);
4885  $ilCtrl->setParameter($this, 'test_express_mode', 1);
4886  $ilCtrl->setParameterByClass('iltestexpresspageobjectgui', 'q_id', $_REQUEST['q_id']);
4887  $ilCtrl->setParameter($this, 'q_id', $_REQUEST['q_id']);
4888  $ilToolbar->setFormAction($ilCtrl->getFormActionByClass('iltestexpresspageobjectgui', 'edit'));
4889 
4890  if($this->object->evalTotalPersons() == 0)
4891  {
4892  /*
4893  include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
4894  $pool = new ilObjQuestionPool();
4895  $questionTypes = $pool->getQuestionTypes();$options = array();
4896  foreach($questionTypes as $label => $data) {
4897  $options[$data['question_type_id']] = $label;
4898  }
4899 
4900  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
4901  $si = new ilSelectInputGUI($lng->txt("test_add_new_question"), "qtype");
4902  $si->setOptions($options);
4903  $ilToolbar->addInputItem($si, true);
4904  /*
4905  // use pool
4906  if ($this->object->isExpressModeQuestionPoolAllowed()) {
4907  include_once("./Services/Form/classes/class.ilCheckboxInputGUI.php");
4908  $cb = new ilCheckboxInputGUI($lng->txt("test_use_pool"), "use_pool");
4909  $ilToolbar->addInputItem($cb, true);
4910  }
4911  */
4912  $ilToolbar->addFormButton($lng->txt("ass_create_question"), "addQuestion");
4913 
4914  $ilToolbar->addSeparator();
4915 
4916  if($this->object->getPoolUsage())
4917  {
4918  $ilToolbar->addFormButton($lng->txt("tst_browse_for_questions"), "browseForQuestions");
4919 
4920  $show_separator = true;
4921  }
4922  }
4923 
4924  $questions = $this->object->getQuestionTitlesAndIndexes();
4925 
4926  // desc
4927  $options = array();
4928  foreach($questions as $id => $label)
4929  {
4930  $options[$id] = $label . ' ['. $this->lng->txt('question_id_short') . ': ' . $id . ']';
4931  }
4932 
4933  $optionKeys = array_keys($options);
4934 
4935  if(!$options)
4936  {
4937  $options[] = $lng->txt('none');
4938  }
4939  //else if (count($options) > 1) {
4940 // $addSeparator = false;
4941 // if ($optionKeys[0] != $qid) {
4942 // //$ilToolbar->addFormButton($lng->txt("test_prev_question"), "prevQuestion");
4943 // $ilToolbar->addLink($lng->txt("test_prev_question"), $ilCtrl->getLinkTargetByClass('iltestexpresspageobjectgui', 'prevQuestion'));
4944 // $addSeparator = true;
4945 // }
4946 // else {
4947 // $ilToolbar->addSpacer(45);
4948 // }
4949 //
4950 // if ($optionKeys[count($optionKeys)-1] != $qid) {
4951 // //$ilToolbar->addFormButton($lng->txt("test_next_question"), "nextQuestion");
4952 // $ilToolbar->addLink($lng->txt("test_next_question"), $ilCtrl->getLinkTargetByClass('iltestexpresspageobjectgui', 'nextQuestion'));
4953 // $addSeparator = true;
4954 // }
4955 // else {
4956 // $ilToolbar->addSpacer(45);
4957 // }
4958 //
4959 // //if ($addSeparator) {
4960 // $ilToolbar->addSeparator();
4961 // //}
4962 
4963  if(count($questions))
4964  {
4965  if(isset($show_separator) && $show_separator)
4966  {
4967  $ilToolbar->addSeparator();
4968  }
4969 
4970  $ilToolbar->addLink($lng->txt("test_prev_question"), $ilCtrl->getLinkTargetByClass('iltestexpresspageobjectgui', 'prevQuestion'), !(count($options) > 1 && $optionKeys[0] != $qid));
4971  $ilToolbar->addLink($lng->txt("test_next_question"), $ilCtrl->getLinkTargetByClass('iltestexpresspageobjectgui', 'nextQuestion'), !(count($options) > 1 && $optionKeys[count($optionKeys) - 1] != $qid));
4972  }
4973 
4974  if(count($questions) > 1)
4975  {
4976 
4977  $ilToolbar->addSeparator();
4978 
4979  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
4980  $si = new ilSelectInputGUI($lng->txt("test_jump_to"), "q_id");
4981  $si->addCustomAttribute("onChange=\"forms['ilToolbar'].submit();\"");
4982  $si->setOptions($options);
4983 
4984  if($qid)
4985  {
4986  $si->setValue($qid);
4987  }
4988 
4989  $ilToolbar->addInputItem($si, true);
4990  }
4991 
4992  $total = $this->object->evalTotalPersons();
4993 
4994  /*if (count($options)) {
4995  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
4996  $si = new ilSelectInputGUI($lng->txt("test_jump_to"), "q_id");
4997  $si->addCustomAttribute("onChange=\"forms['ilToolbar'].submit();\"");
4998  $si->setOptions($options);
4999 
5000  if ($qid) {
5001  $si->setValue($qid);
5002  }
5003 
5004  $ilToolbar->addInputItem($si, true);
5005  }*/
5006 
5007  if(count($questions) && !$total)
5008  {
5009  $ilCtrl->setParameter($this, 'q_id', $_REQUEST['q_id']);
5010  $ilToolbar->addSeparator();
5011  $ilToolbar->addButton($lng->txt("test_delete_page"), $ilCtrl->getLinkTarget($this, "removeQuestions"));
5012  }
5013 
5014  if(count($questions) > 1 && !$total)
5015  {
5016  $ilToolbar->addSeparator();
5017  $ilToolbar->addButton($lng->txt("test_move_page"), $ilCtrl->getLinkTarget($this, "movePageForm"));
5018  }
5019 
5020  global $ilAccess, $ilUser;
5021 
5022  $online_access = false;
5023  if($this->object->getFixedParticipants())
5024  {
5025  include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
5026  $online_access_result = ilObjTestAccess::_lookupOnlineTestAccess($this->object->getId(), $ilUser->getId());
5027  if($online_access_result === true)
5028  {
5029  $online_access = true;
5030  }
5031  }
5032 
5033  if($this->object->isOnline() && $this->object->isComplete( $this->testQuestionSetConfigFactory->getQuestionSetConfig() ))
5034  {
5035  if((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id))
5036  {
5037  $testSession = $this->testSessionFactory->getSession();
5038 
5039  $executable = $this->object->isExecutable($testSession, $ilUser->getId(), $allowPassIncrease = TRUE);
5040 
5041  if($executable["executable"])
5042  {
5043  $player_factory = new ilTestPlayerFactory($this->object);
5044  $player_instance = $player_factory->getPlayerGUI();
5045 
5046  if ($testSession->getActiveId() > 0)
5047  {
5048  $ilToolbar->addSeparator();
5049  $ilToolbar->addButton($lng->txt('tst_resume_test'), $ilCtrl->getLinkTarget($player_instance, 'resumePlayer'));
5050  }
5051  else
5052  {
5053  $ilToolbar->addSeparator();
5054  $ilToolbar->addButton($lng->txt('tst_start_test'), $ilCtrl->getLinkTarget($player_instance, 'startTest'));
5055  }
5056  }
5057  }
5058  }
5059  }
This class represents a selection list property in a property form.
global $ilCtrl
Definition: ilias.php:18
_lookupOnlineTestAccess($a_test_id, $a_user_id)
Checks if a user is allowd to run an online exam.
if(!is_array($argv)) $options
global $ilUser
Definition: imgupload.php:15
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ 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 1803 of file class.ilObjTestGUI.php.

1804  {
1805  $this->ctrl->redirect($this, "questions");
1806  }

◆ cancelDeleteSelectedUserDataObject()

ilObjTestGUI::cancelDeleteSelectedUserDataObject ( )

Cancels the deletion of all user data for the test object.

Cancels the deletion of all user data for the test object

public

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

2805  {
2806  $this->ctrl->redirect($this, "participants");
2807  }

◆ cancelMarksObject()

ilObjTestGUI::cancelMarksObject ( )

Cancel the mark schema form and return to the properties form.

Cancel the mark schema form and return to the properties form

public

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

2564  {
2565  $this->ctrl->redirect($this, "marks");
2566  }

◆ cancelRandomSelectObject()

ilObjTestGUI::cancelRandomSelectObject ( )

Cancels the form for random selection of questions.

Cancels the form for random selection of questions

public

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

1617  {
1618  $this->ctrl->redirect($this, "questions");
1619  }

◆ cancelRemoveQuestionsObject()

ilObjTestGUI::cancelRemoveQuestionsObject ( )

Cancels the removal of questions from the test.

Cancels the removal of questions from the test

public

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

References $_REQUEST.

1982  {
1983  if ($_REQUEST['test_express_mode']) {
1984  $this->ctrl->setParameter($this, 'q_id', $_REQUEST['q_id']);
1985  $this->ctrl->redirect($this, "showPage");
1986  }
1987  else {
1988  $this->ctrl->redirect($this, "questions");
1989  }
1990  }
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7

◆ certificateObject()

ilObjTestGUI::certificateObject ( )

Shows the certificate editor.

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

4333  {
4334  include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
4335  include_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php";
4336  $output_gui = new ilCertificateGUI(new ilTestCertificateAdapter($this->object));
4337  $output_gui->certificateEditor();
4338  }
GUI class to create PDF certificates.

◆ confirmDeleteAllUserResultsObject()

ilObjTestGUI::confirmDeleteAllUserResultsObject ( )

Deletes all user data for the test object.

Deletes all user data for the test object

public

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

References ilObjectGUI\$lng, and ilUtil\sendSuccess().

2752  {
2753  global $ilDB, $lng;
2754 
2755  require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
2756 
2757  $participantData = new ilTestParticipantData($ilDB, $lng);
2758  $participantData->load($this->object->getTestId());
2759 
2760  $this->object->removeTestResults($participantData);
2761 
2762  ilUtil::sendSuccess($this->lng->txt("tst_all_user_data_deleted"), true);
2763  $this->ctrl->redirect($this, "participants");
2764  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
+ Here is the call graph for this function:

◆ confirmDeleteSelectedUserDataObject()

ilObjTestGUI::confirmDeleteSelectedUserDataObject ( )

Deletes the selected user data for the test object.

Deletes the selected user data for the test object

public

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

References $_POST, ilObjectGUI\$lng, and ilUtil\sendSuccess().

2774  {
2775  global $ilDB, $lng;
2776 
2777  require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
2778  $participantData = new ilTestParticipantData($ilDB, $lng);
2779 
2780  if( $this->object->getFixedParticipants() )
2781  {
2782  $participantData->setUserIds($_POST["chbUser"]);
2783  }
2784  else
2785  {
2786  $participantData->setActiveIds($_POST["chbUser"]);
2787  }
2788 
2789  $participantData->load($this->object->getTestId());
2790 
2791  $this->object->removeTestResults($participantData);
2792 
2793  ilUtil::sendSuccess($this->lng->txt("tst_selected_user_data_deleted"), true);
2794  $this->ctrl->redirect($this, "participants");
2795  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
+ Here is the call graph for this function:

◆ confirmedApplyDefaultsObject()

ilObjTestGUI::confirmedApplyDefaultsObject ( )

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

References applyDefaultsObject().

3739  {
3740  $this->applyDefaultsObject(true);
3741  return;
3742  }
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 1910 of file class.ilObjTestGUI.php.

References $_POST, $_REQUEST, and ilUtil\sendSuccess().

1911  {
1912  $checked_questions = $_POST["q_id"];
1913 
1914  $questions = $this->object->getQuestionTitlesAndIndexes();
1915  $deleted = array();
1916  foreach((array)$checked_questions as $value)
1917  {
1918  $this->object->removeQuestion($value);
1919  $deleted[] = $value;
1920  }
1921 
1922  $this->object->saveCompleteStatus( $this->testQuestionSetConfigFactory->getQuestionSetConfig() );
1923 
1924  ilUtil::sendSuccess($this->lng->txt("tst_questions_removed"));
1925 
1926  if($_REQUEST['test_express_mode'])
1927  {
1928  $prev = null;
1929  $return_to = null;
1930  $deleted_tmp = $deleted;
1931  $first = array_shift($deleted_tmp);
1932  foreach((array)$questions as $key => $value)
1933  {
1934  if(!in_array($key, $deleted))
1935  {
1936  $prev = $key;
1937  if(!$first)
1938  {
1939  $return_to = $prev;
1940  break;
1941  }
1942  else continue;
1943  }
1944  else if($key == $first)
1945  {
1946  if($prev)
1947  {
1948  $return_to = $prev;
1949  break;
1950  }
1951  $first = array_shift($deleted_tmp);
1952  }
1953  }
1954 
1955  if(
1956  count($questions) == count($checked_questions) ||
1957  !$return_to
1958  )
1959  {
1960  $this->ctrl->setParameter($this, 'q_id', '');
1961  $this->ctrl->redirect($this, 'showPage');
1962  }
1963 
1964  $this->ctrl->setParameter($this, 'q_id', $return_to);
1965  $this->ctrl->redirect($this, "showPage");
1966  }
1967  else
1968  {
1969  $this->ctrl->setParameter($this, 'q_id', '');
1970  $this->ctrl->redirect($this, 'questions');
1971  }
1972  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ confirmScoringObject()

ilObjTestGUI::confirmScoringObject (   $confirmCmd = 'saveScoring',
  $cancelCmd = 'scoring' 
)

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

References $_POST, and populateHiddenField().

1059  {
1060  $this->lng->txt('tst_trigger_result_refreshing');
1061 
1062  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_properties_save_confirmation.html", "Modules/Test");
1063  $information = $this->lng->txt('tst_trigger_result_refreshing');
1064 
1065  foreach ($_POST as $key => $value)
1066  {
1067  if (strcmp($key, "cmd") == 0)
1068  {
1069  continue;
1070  }
1071 
1072  $this->populateHiddenField( $value, $key );
1073  }
1074  $this->tpl->setCurrentBlock("hidden_variable");
1075  $this->tpl->setVariable("HIDDEN_KEY", "tst_properties_confirmation");
1076  $this->tpl->setVariable("HIDDEN_VALUE", "1");
1077  $this->tpl->parseCurrentBlock();
1078  $this->tpl->setCurrentBlock("adm_content");
1079  $this->tpl->setVariable("TXT_CONFIRMATION", $this->lng->txt("confirmation"));
1080  $this->tpl->setVariable("TXT_INFORMATION", $information);
1081  $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
1082  $this->tpl->setVariable("CMD_CONFIRM", $confirmCmd);
1083  $this->tpl->setVariable("BTN_CONFIRM", $this->lng->txt("confirm"));
1084  $this->tpl->setVariable("CMD_CANCEL", $cancelCmd);
1085  $this->tpl->setVariable("BTN_CANCEL", $this->lng->txt("cancel"));
1086  }
$_POST['username']
Definition: cron.php:12
populateHiddenField($value, $key, $path='')
+ Here is the call graph for this function:

◆ copyAndLinkQuestionsToPoolObject()

ilObjTestGUI::copyAndLinkQuestionsToPoolObject ( )

ilObjectDataCache $ilObjDataCache

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

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

Referenced by createQuestionPoolAndCopyObject().

5106  {
5107  global $ilObjDataCache;
5108 
5109  $qplId = $ilObjDataCache->lookupObjId($_REQUEST['sel_qpl']);
5110  $result = $this->copyQuestionsToPool($_REQUEST['q_id'], $qplId);
5111 
5112  foreach($result->ids as $oldId => $newId)
5113  {
5114  $questionInstance = assQuestion::_instanciateQuestion($oldId);
5115 
5116  if( assQuestion::originalQuestionExists($questionInstance->getOriginalId()) )
5117  {
5118  $oldOriginal = assQuestion::_instanciateQuestion($questionInstance->getOriginalId());
5119  $oldOriginal->delete($oldOriginal->getId());
5120  }
5121 
5122  $questionInstance->setNewOriginalId($newId);
5123  }
5124 
5125  $this->backObject();
5126  }
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
$result
static originalQuestionExists($questionId)
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
backObject()
Called when the back button in the question browser was pressed.
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 5161 of file class.ilObjTestGUI.php.

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

Referenced by createQuestionPoolAndCopyObject().

5162  {
5163  global $lng;
5164 
5165  require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
5166 
5167  // #13761; All methods use for this request should be revised, thx japo ;-)
5168  if(
5169  'copyAndLinkToQuestionpool' == $this->ctrl->getCmd() &&
5170  (!isset($_REQUEST['q_id']) || !is_array($_REQUEST['q_id']))
5171  )
5172  {
5173  ilUtil::sendFailure($this->lng->txt('tst_no_question_selected_for_moving_to_qpl'), true);
5174  $this->ctrl->redirect($this, 'questions');
5175  }
5176 
5177  if(isset($_REQUEST['q_id']) && is_array($_REQUEST['q_id']))
5178  {
5179  foreach($_REQUEST['q_id'] as $q_id)
5180  {
5182  {
5183  continue;
5184  }
5185 
5187 
5188  if($type !== 'tst')
5189  {
5190  ilUtil::sendFailure($lng->txt('tst_link_only_unassigned'), true);
5191  $this->backObject();
5192  return;
5193  }
5194  }
5195  }
5196 
5197  $this->createQuestionpoolTargetObject('copyAndLinkQuestionsToPool');
5198  }
static _getOriginalId($question_id)
Returns the original id of a question.
static originalQuestionExists($questionId)
createQuestionpoolTargetObject($cmd)
Called when a new question should be created from a test Important: $cmd may be overwritten if no que...
static lookupParentObjId($questionId)
ilDB $ilDB
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
backObject()
Called when the back button in the question browser was pressed.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyQuestionObject()

ilObjTestGUI::copyQuestionObject ( )

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

References $_REQUEST, assQuestion\_instanciateQuestionGUI(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

5469  {
5470  global $ilAccess;
5471  if (!$ilAccess->checkAccess("write", "", $this->ref_id))
5472  {
5473  // allow only write access
5474  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
5475  $this->ctrl->redirect($this, "infoScreen");
5476  }
5477 
5478  if ($_REQUEST['q_id'] && !is_array($_REQUEST['q_id']))
5479  $ids = array($_REQUEST['q_id']);
5480  else if ($_REQUEST['q_id'])
5481  $ids = $_REQUEST['q_id'];
5482  else
5483  {
5484  ilUtil::sendFailure( $this->lng->txt('copy_no_questions_selected'), true );
5485  $this->ctrl->redirect($this, 'questions');
5486  }
5487 
5488  $copy_count = 0;
5489 
5490  $questionTitles = $this->object->getQuestionTitles();
5491 
5492  foreach($ids as $id)
5493  {
5494  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
5495  $question = assQuestion::_instanciateQuestionGUI($id);
5496  if ($question)
5497  {
5498  $title = $question->object->getTitle();
5499  $i = 2;
5500  while( in_array( $title . ' (' . $i . ')', $questionTitles ))
5501  $i++;
5502 
5503  $title .= ' (' . $i . ')';
5504 
5505  $questionTitles[] = $title;
5506 
5507  $new_id = $question->object->duplicate(false, $title);
5508 
5509  $clone = assQuestion::_instanciateQuestionGUI($new_id);
5510  $clone->object->setObjId($this->object->getId());
5511  $clone->object->saveToDb();
5512 
5513  $this->object->insertQuestion( $this->testQuestionSetConfigFactory->getQuestionSetConfig(), $new_id, true );
5514 
5515  $copy_count++;
5516  }
5517  }
5518 
5519  ilUtil::sendSuccess($this->lng->txt('copy_questions_success'), true);
5520 
5521  $this->ctrl->redirect($this, 'questions');
5522  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static & _instanciateQuestionGUI($question_id)
Creates an instance of a question gui with a given question 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.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ copyQuestionsToPool()

ilObjTestGUI::copyQuestionsToPool (   $questionIds,
  $qplId 
)

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

References $result, and copyQuestionToPool().

Referenced by copyAndLinkQuestionsToPoolObject(), and copyQuestionsToPoolObject().

5068  {
5069  $newIds = array();
5070  foreach($questionIds as $q_id)
5071  {
5072  $newId = $this->copyQuestionToPool($q_id, $qplId);
5073  $newIds[$q_id] = $newId;
5074  }
5075 
5076  $result = new stdClass();
5077  $result->ids = $newIds;
5078  $result->qpoolid = $qplId;
5079 
5080  return $result;
5081  }
$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 5061 of file class.ilObjTestGUI.php.

References $_REQUEST, backObject(), and copyQuestionsToPool().

5062  {
5063  $this->copyQuestionsToPool($_REQUEST['q_id'], $_REQUEST['sel_qpl']);
5064  $this->backObject();
5065  }
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
backObject()
Called when the back button in the question browser was pressed.
copyQuestionsToPool($questionIds, $qplId)
+ Here is the call graph for this function:

◆ copyQuestionToPool()

ilObjTestGUI::copyQuestionToPool (   $sourceQuestionId,
  $targetParentId 
)

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

References assQuestion\instantiateQuestionGUI().

Referenced by copyQuestionsToPool().

5084  {
5085  require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
5086  $question_gui = assQuestion::instantiateQuestionGUI($sourceQuestionId);
5087 
5088  $newtitle = $question_gui->object->getTitle();
5089  if ($question_gui->object->questionTitleExists($targetParentId, $question_gui->object->getTitle()))
5090  {
5091  $counter = 2;
5092  while ($question_gui->object->questionTitleExists($targetParentId, $question_gui->object->getTitle() . " ($counter)"))
5093  {
5094  $counter++;
5095  }
5096  $newtitle = $question_gui->object->getTitle() . " ($counter)";
5097  }
5098 
5099  return $question_gui->object->createNewOriginalFromThisDuplicate($targetParentId, $newtitle);
5100  }
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 5156 of file class.ilObjTestGUI.php.

References createQuestionpoolTargetObject().

5157  {
5158  $this->createQuestionpoolTargetObject('copyQuestionsToPool');
5159  }
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 1815 of file class.ilObjTestGUI.php.

References $_REQUEST, $ilCtrl, $ilUser, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjQuestionPool\_getAvailableQuestionpools(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT, ilRadioGroupInputGUI\addOption(), getQuestionsSubTabs(), ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled(), ilUtil\redirect(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setSize(), and ilRadioOption\setValue().

Referenced by executeCreateQuestionObject().

1816  {
1817  global $ilUser;
1818  $this->getQuestionsSubTabs();
1819  //$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_qpl_select.html", "Modules/Test");
1820  $questionpools =& $this->object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE, FALSE, "write");
1821 
1822  if ($this->object->getPoolUsage()) {
1823  global $lng, $ilCtrl, $tpl;
1824 
1825  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
1826 
1827  $form = new ilPropertyFormGUI();
1828  $form->setFormAction($ilCtrl->getFormAction($this, "executeCreateQuestion"));
1829  $form->setTitle($lng->txt("ass_create_question"));
1830  include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
1831 
1832 
1833  $hidden = new ilHiddenInputGUI('sel_question_types');
1834  $hidden->setValue($_REQUEST["sel_question_types"]);
1835  $form->addItem($hidden);
1836 
1837  // content editing mode
1839  {
1840  $ri = new ilRadioGroupInputGUI($lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
1841 
1842  $ri->addOption(new ilRadioOption(
1843  $lng->txt('tst_add_quest_cont_edit_mode_default'),
1845  ));
1846 
1847  $ri->addOption(new ilRadioOption(
1848  $lng->txt('tst_add_quest_cont_edit_mode_page_object'),
1850  ));
1851 
1853 
1854  $form->addItem($ri, true);
1855  }
1856  else
1857  {
1858  $hi = new ilHiddenInputGUI("question_content_editing_type");
1860  $form->addItem($hi, true);
1861  }
1862 
1863  // use pool
1864  $usage = new ilRadioGroupInputGUI($this->lng->txt("assessment_pool_selection"), "usage");
1865  $usage->setRequired(true);
1866  $no_pool = new ilRadioOption($this->lng->txt("assessment_no_pool"), 1);
1867  $usage->addOption($no_pool);
1868  $existing_pool = new ilRadioOption($this->lng->txt("assessment_existing_pool"), 3);
1869  $usage->addOption($existing_pool);
1870  $new_pool = new ilRadioOption($this->lng->txt("assessment_new_pool"), 2);
1871  $usage->addOption($new_pool);
1872  $form->addItem($usage);
1873 
1874  $usage->setValue(1);
1875 
1876  $questionpools = ilObjQuestionPool::_getAvailableQuestionpools(FALSE, FALSE, TRUE, FALSE, FALSE, "write");
1877  $pools_data = array();
1878  foreach($questionpools as $key => $p) {
1879  $pools_data[$key] = $p['title'];
1880  }
1881  $pools = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "sel_qpl");
1882  $pools->setOptions($pools_data);
1883  $existing_pool->addSubItem($pools);
1884 
1885 
1886  $this->lng->loadLanguageModule('rbac');
1887  $name = new ilTextInputGUI($this->lng->txt("rbac_create_qpl"), "txt_qpl");
1888  $name->setSize(50);
1889  $name->setMaxLength(50);
1890  $new_pool->addSubItem($name);
1891 
1892  $form->addCommandButton("executeCreateQuestion", $lng->txt("submit"));
1893  $form->addCommandButton("cancelCreateQuestion", $lng->txt("cancel"));
1894 
1895  return $this->tpl->setVariable('ADM_CONTENT', $form->getHTML());
1896 
1897  }
1898  else {
1899  global $ilCtrl;
1900 
1901  $ilCtrl->setParameterByClass('iltestexpresspageobjectgui', 'sel_question_types', $_REQUEST["sel_question_types"]);
1902  $link = $ilCtrl->getLinkTargetByClass('iltestexpresspageobjectgui', 'handleToolbarCommand','',false,false);
1903  ilUtil::redirect($link);
1904  }
1905  }
This class represents an option in a radio group.
This class represents a selection list property in a property form.
This class represents a property form user interface.
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.
setValue($a_value)
Set Value.
setSize($a_size)
Set Size.
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"
global $ilUser
Definition: imgupload.php:15
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
& _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.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
static redirect($a_script)
http redirect to other script
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 1558 of file class.ilObjTestGUI.php.

References ilObjectGUI\$tree.

Referenced by createQuestionPoolAndCopyObject(), and executeCreateQuestionObject().

1559  {
1560  global $tree;
1561  $parent_ref = $tree->getParentId($this->object->getRefId());
1562  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
1563  $qpl = new ilObjQuestionPool();
1564  $qpl->setType("qpl");
1565  $qpl->setTitle($name);
1566  $qpl->setDescription($description);
1567  $qpl->create();
1568  $qpl->createReference();
1569  $qpl->putInTree($parent_ref);
1570  $qpl->setPermissions($parent_ref);
1571  $qpl->setOnline(1); // must be online to be available
1572  $qpl->saveToDb();
1573  return $qpl->getRefId();
1574  }
+ Here is the caller graph for this function:

◆ createQuestionPoolAndCopyObject()

ilObjTestGUI::createQuestionPoolAndCopyObject ( )

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

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

5201  {
5202  $form = $this->getQuestionpoolCreationForm();
5203 
5204  if ($_REQUEST['title'])
5205  {
5206  $title = $_REQUEST['title'];
5207  }
5208  else
5209  {
5210  $title = $_REQUEST['txt_qpl'];
5211  }
5212 
5213  if (!$title)
5214  {
5215  ilUtil::sendInfo($this->lng->txt("questionpool_not_entered"));
5216  return $this->copyAndLinkToQuestionpoolObject();
5217  }
5218 
5219  $ref_id = $this->createQuestionPool($title, $_REQUEST['description']);
5220  $_REQUEST['sel_qpl'] = $ref_id;
5221 
5222  //if ($_REQUEST['link'])
5223  //{
5225  //}
5226  //else
5227  //{
5228  // $this->copyQuestionsToPoolObject();
5229  //}
5230  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
copyAndLinkQuestionsToPoolObject()
ilObjectDataCache $ilObjDataCache
createQuestionPool($name="dummy", $description="")
Creates a new questionpool and returns the reference id.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ 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 5238 of file class.ilObjTestGUI.php.

References $_REQUEST, $cmd, $ilUser, getQuestionpoolCreationForm(), and getQuestionsSubTabs().

Referenced by copyAndLinkToQuestionpoolObject(), and copyToQuestionpoolObject().

5239  {
5240  global $ilUser, $ilTabs;
5241  $this->getQuestionsSubTabs();
5242  $ilTabs->activateSubTab('edit_test_questions');
5243 
5244  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_qpl_select_copy.html", "Modules/Test");
5245  $questionpools =& $this->object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE, FALSE, "write");
5246  if(count($questionpools) == 0)
5247  {
5248  $this->tpl->setCurrentBlock("option");
5249  $this->tpl->setVariable("VALUE_QPL", "");
5250  $this->tpl->parseCurrentBlock();
5251  }
5252  else
5253  {
5254  foreach($questionpools as $key => $value)
5255  {
5256  $this->tpl->setCurrentBlock("option");
5257  $this->tpl->setVariable("VALUE_OPTION", $key);
5258  $this->tpl->setVariable("TEXT_OPTION", $value["title"]);
5259  $this->tpl->parseCurrentBlock();
5260  }
5261  }
5262 
5263  if(isset($_REQUEST['q_id']) && is_array($_REQUEST['q_id']))
5264  {
5265  foreach($_REQUEST['q_id'] as $id)
5266  {
5267  $this->tpl->setCurrentBlock("hidden");
5268  $this->tpl->setVariable("HIDDEN_NAME", "q_id[]");
5269  $this->tpl->setVariable("HIDDEN_VALUE", $id);
5270  $this->tpl->parseCurrentBlock();
5271  $this->tpl->setCurrentBlock("adm_content");
5272  }
5273  }
5274  $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
5275 
5276  if(count($questionpools) == 0)
5277  {
5278  $this->tpl->setVariable("TXT_QPL_SELECT", $this->lng->txt("tst_enter_questionpool"));
5279  $cmd = 'createQuestionPoolAndCopy';
5280  }
5281  else
5282  {
5283  $this->tpl->setVariable("TXT_QPL_SELECT", $this->lng->txt("tst_select_questionpool"));
5284  }
5285 
5286  $this->tpl->setVariable("CMD_SUBMIT", $cmd);
5287  $this->tpl->setVariable("BTN_SUBMIT", $this->lng->txt("submit"));
5288  $this->tpl->setVariable("BTN_CANCEL", $this->lng->txt("cancel"));
5289 
5290  $createForm = $this->getQuestionpoolCreationForm();
5291  switch($cmd)
5292  {
5293  case 'copyAndLinkQuestionsToPool':
5294  $hidden = new ilHiddenInputGUI('link');
5295  $hidden->setValue(1);
5296  $createForm->addItem($hidden);
5297  break;
5298  case 'copyQuestionsToPool':
5299  break;
5300  }
5301  $createForm->setFormAction($this->ctrl->getFormAction($this));
5302 
5303  $this->tpl->parseCurrentBlock();
5304  }
$cmd
Definition: sahs_server.php:35
This class represents a hidden form property in a property form.
global $ilUser
Definition: imgupload.php:15
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ 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 1628 of file class.ilObjTestGUI.php.

References $_POST, assQuestion\_getQuestionTypeName(), and getQuestionsSubTabs().

1629  {
1630  $this->getQuestionsSubTabs();
1631  $question_array = $this->object->randomSelectQuestions($_POST["nr_of_questions"], $_POST["sel_qpl"]);
1632  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_random_question_offer.html", "Modules/Test");
1633  $color_class = array("tblrow1", "tblrow2");
1634  $counter = 0;
1635  $questionpools =& $this->object->getAvailableQuestionpools(true);
1636  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
1637  foreach ($question_array as $question_id)
1638  {
1639  $dataset = $this->object->getQuestionDataset($question_id);
1640  $this->tpl->setCurrentBlock("QTab");
1641  $this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
1642  $this->tpl->setVariable("QUESTION_TITLE", $dataset->title);
1643  $this->tpl->setVariable("QUESTION_COMMENT", $dataset->description);
1644  $this->tpl->setVariable("QUESTION_TYPE", assQuestion::_getQuestionTypeName($dataset->type_tag));
1645  $this->tpl->setVariable("QUESTION_AUTHOR", $dataset->author);
1646  $this->tpl->setVariable("QUESTION_POOL", $questionpools[$dataset->obj_fi]["title"]);
1647  $this->tpl->parseCurrentBlock();
1648  $counter++;
1649  }
1650  if (count($question_array) == 0)
1651  {
1652  $this->tpl->setCurrentBlock("Emptytable");
1653  $this->tpl->setVariable("TEXT_NO_QUESTIONS_AVAILABLE", $this->lng->txt("no_questions_available"));
1654  $this->tpl->parseCurrentBlock();
1655  }
1656  else
1657  {
1658  $this->tpl->setCurrentBlock("Selectionbuttons");
1659  $this->tpl->setVariable("BTN_YES", $this->lng->txt("random_accept_sample"));
1660  $this->tpl->setVariable("BTN_NO", $this->lng->txt("random_another_sample"));
1661  $this->tpl->parseCurrentBlock();
1662  }
1663  $chosen_questions = join($question_array, ",");
1664  $this->tpl->setCurrentBlock("adm_content");
1665  $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
1666  $this->tpl->setVariable("QUESTION_TITLE", $this->lng->txt("tst_question_title"));
1667  $this->tpl->setVariable("QUESTION_COMMENT", $this->lng->txt("description"));
1668  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("tst_question_type"));
1669  $this->tpl->setVariable("QUESTION_AUTHOR", $this->lng->txt("author"));
1670  $this->tpl->setVariable("QUESTION_POOL", $this->lng->txt("qpl"));
1671  $this->tpl->setVariable("VALUE_CHOSEN_QUESTIONS", $chosen_questions);
1672  $this->tpl->setVariable("VALUE_QUESTIONPOOL_SELECTION", $_POST["sel_qpl"]);
1673  $this->tpl->setVariable("VALUE_NR_OF_QUESTIONS", $_POST["nr_of_questions"]);
1674  $this->tpl->setVariable("TEXT_QUESTION_OFFER", $this->lng->txt("tst_question_offer"));
1675  $this->tpl->setVariable("BTN_CANCEL", $this->lng->txt("cancel"));
1676  $this->tpl->parseCurrentBlock();
1677  }
$_POST['username']
Definition: cron.php:12
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
+ Here is the call graph for this function:

◆ createUserResults()

ilObjTestGUI::createUserResults (   $show_pass_details,
  $show_answers,
  $show_reached_points,
  $show_user_results 
)
Parameters
$show_pass_details
$show_answers
$show_reached_points
$show_user_results
Returns
ilTemplate

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

References $results.

Referenced by showUserResults().

643  {
644  $template = new ilTemplate("tpl.il_as_tst_participants_result_output.html", TRUE, TRUE, "Modules/Test");
645  include_once "./Modules/Test/classes/class.ilTestServiceGUI.php";
646  $serviceGUI = new ilTestServiceGUI($this->object);
647  $count = 0;
648  foreach ($show_user_results as $key => $active_id)
649  {
650  $count++;
651  $results = "";
652  if ($this->object->getFixedParticipants())
653  {
654  $active_id = $this->object->getActiveIdOfUser( $active_id );
655  }
656  if ($active_id > 0)
657  {
658  $results = $serviceGUI->getResultsOfUserOutput(
659  $this->testSessionFactory->getSession( $active_id ),
660  $active_id,
661  $this->object->_getResultPass( $active_id ),
662  $show_pass_details,
663  $show_answers,
664  FALSE,
665  $show_reached_points
666  );
667  }
668  if ($count < count( $show_user_results ))
669  {
670  $template->touchBlock( "break" );
671  }
672  $template->setCurrentBlock( "user_result" );
673  $template->setVariable( "USER_RESULT", $results );
674  $template->parseCurrentBlock();
675  }
676  $template->setVariable( "BACK_TEXT", $this->lng->txt( "back" ) );
677  $template->setVariable( "BACK_URL", $this->ctrl->getLinkTargetByClass( "ilobjtestgui", "participants" ) );
678  $template->setVariable( "PRINT_TEXT", $this->lng->txt( "print" ) );
679  $template->setVariable( "PRINT_URL", "javascript:window.print();" );
680  return $template;
681  }
special template class to simplify handling of ITX/PEAR
$results
Service GUI class for tests.
+ Here is the caller graph for this function:

◆ deleteAllUserDataObject()

ilObjTestGUI::deleteAllUserDataObject ( )

Asks for a confirmation to delete all user data of the test object.

Asks for a confirmation to delete all user data of the test object

DEPRECATED?

public

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

References ilUtil\sendQuestion().

2819  {
2820  ilUtil::sendQuestion($this->lng->txt("confirm_delete_all_user_data"));
2821  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_maintenance.html", "Modules/Test");
2822 
2823  $this->tpl->setCurrentBlock("confirm_delete");
2824  $this->tpl->setVariable("BTN_CONFIRM_DELETE_ALL", $this->lng->txt("confirm"));
2825  $this->tpl->setVariable("BTN_CANCEL_DELETE_ALL", $this->lng->txt("cancel"));
2826  $this->tpl->parseCurrentBlock();
2827 
2828  $this->tpl->setCurrentBlock("adm_content");
2829  $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
2830  $this->tpl->parseCurrentBlock();
2831  }
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
+ Here is the call graph for this function:

◆ deleteAllUserResultsObject()

ilObjTestGUI::deleteAllUserResultsObject ( )

Asks for a confirmation to delete all user data of the test object.

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

2837  {
2838  // display confirmation message
2839  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2840  $cgui = new ilConfirmationGUI();
2841  $cgui->setFormAction($this->ctrl->getFormAction($this, "participants"));
2842  $cgui->setHeaderText($this->lng->txt("delete_all_user_data_confirmation"));
2843  $cgui->setCancel($this->lng->txt("cancel"), "participants");
2844  $cgui->setConfirm($this->lng->txt("proceed"), "confirmDeleteAllUserResults");
2845 
2846  $this->tpl->setContent($cgui->getHTML());
2847  }
Confirmation screen class.

◆ deleteDefaultsObject()

ilObjTestGUI::deleteDefaultsObject ( )

Deletes selected test defaults.

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

References $_POST, and ilUtil\sendInfo().

3720  {
3721  if(isset($_POST['chb_defaults']) && is_array($_POST['chb_defaults']) && count($_POST['chb_defaults']))
3722  {
3723  foreach($_POST['chb_defaults'] as $test_default_id)
3724  {
3725  $this->object->deleteDefaults($test_default_id);
3726  }
3727  }
3728  else
3729  {
3730  ilUtil::sendInfo($this->lng->txt('select_one'));
3731  }
3732  $this->defaultsObject();
3733  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ deleteMarkStepsObject()

ilObjTestGUI::deleteMarkStepsObject ( )

Delete selected mark steps.

Delete selected mark steps

public

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

References $_POST, marksObject(), saveMarkSchemaFormData(), and ilUtil\sendInfo().

2540  {
2541  $this->saveMarkSchemaFormData();
2542  $delete_mark_steps = array();
2543  foreach ($_POST as $key => $value) {
2544  if (preg_match("/cb_(\d+)/", $key, $matches)) {
2545  array_push($delete_mark_steps, $matches[1]);
2546  }
2547  }
2548  if (count($delete_mark_steps)) {
2549  $this->object->mark_schema->deleteMarkSteps($delete_mark_steps);
2550  } else {
2551  ilUtil::sendInfo($this->lng->txt("tst_delete_missing_mark"));
2552  }
2553  $this->marksObject();
2554  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
saveMarkSchemaFormData()
Save the mark schema POST data when the form was submitted.
+ Here is the call graph for this function:

◆ deleteSingleUserResultsObject()

ilObjTestGUI::deleteSingleUserResultsObject ( )

Asks for a confirmation to delete selected user data of the test object.

Asks for a confirmation to delete selected user data of the test object

public

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

References $_POST, ilObjUser\_lookupName(), ilUtil\getImagePath(), and ilUtil\sendInfo().

2857  {
2858  if (count($_POST["chbUser"]) == 0)
2859  {
2860  ilUtil::sendInfo($this->lng->txt("select_one_user"), TRUE);
2861  $this->ctrl->redirect($this, "participants");
2862  }
2863 
2864  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2865  $cgui = new ilConfirmationGUI();
2866  $cgui->setHeaderText($this->lng->txt("confirm_delete_single_user_data"));
2867 
2868  $cgui->setFormAction($this->ctrl->getFormAction($this));
2869  $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteSelectedUserData");
2870  $cgui->setConfirm($this->lng->txt("confirm"), "confirmDeleteSelectedUserData");
2871 
2872  include_once './Services/User/classes/class.ilObjUser.php';
2873  foreach ($_POST["chbUser"] as $key => $active_id)
2874  {
2875  if ($this->object->getFixedParticipants())
2876  {
2877  $user_id = $active_id;
2878  }
2879  else
2880  {
2881  $user_id = $this->object->_getUserIdFromActiveId($active_id);
2882  }
2883  $user = ilObjUser::_lookupName($user_id);
2884 
2885  if ($this->object->getAnonymity())
2886  {
2887  $name = $this->lng->txt("anonymous");
2888  }
2889  else if($user["lastname"])
2890  {
2891  $name = $user["lastname"].", ".$user["firstname"]." (".
2892  $user["login"].")";
2893  }
2894  else
2895  {
2896  $name = $this->lng->txt("deleted_user");
2897  }
2898 
2899  $cgui->addItem("chbUser[]", $active_id, $name,
2900  ilUtil::getImagePath("icon_usr.png"), $this->lng->txt("usr"));
2901  }
2902 
2903  $this->tpl->setContent($cgui->getHTML());
2904  }
static _lookupName($a_user_id)
lookup user name
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Confirmation screen class.
+ Here is the call graph for this function:

◆ download_paragraphObject()

ilObjTestGUI::download_paragraphObject ( )

download source code paragraph

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

References $_GET, and exit.

1507  {
1508  include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php");
1509  $pg_obj = new ilAssQuestionPage($_GET["pg_id"]);
1510  $pg_obj->send_paragraph ($_GET["par_id"], $_GET["downloadtitle"]);
1511  exit;
1512  }
exit
Definition: login.php:54
$_GET["client_id"]
Question page object.

◆ downloadFileObject()

ilObjTestGUI::downloadFileObject ( )

download file

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

References $_GET, $file, and exit.

1484  {
1485  $file = explode("_", $_GET["file_id"]);
1486  include_once("./Modules/File/classes/class.ilObjFile.php");
1487  $fileObj =& new ilObjFile($file[count($file) - 1], false);
1488  $fileObj->sendFile();
1489  exit;
1490  }
print $file
exit
Definition: login.php:54
$_GET["client_id"]
Class ilObjFile.

◆ executeCommand()

ilObjTestGUI::executeCommand ( )

execute command

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

References $_GET, $_POST, $_REQUEST, $cmd, $ilCtrl, $ilErr, ilObjectGUI\$ilias, $ilUser, ilObjectGUI\$lng, $object, $ret, ilObjectGUI\$tpl, ilObjectGUI\$tree, assQuestionGUI\_getQuestionGUI(), ilPaymentObject\_requiresPurchaseToAccess(), ilObjectGUI\addHeaderAction(), ilMDEditorGUI\addObserver(), buildPageViewToolbar(), exit, ilObjStyleSheet\getContentStylePath(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), assQuestion\getQuestionTypeFromDb(), ilObjStyleSheet\getSyntaxStylePath(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ilObjectGUI\prepareOutput(), prepareSubGuiOutput(), questionBrowser(), questionsObject(), and ilObjectGUI\setLocator().

88  {
89  global $ilAccess, $ilNavigationHistory, $ilCtrl, $ilErr, $tpl, $lng, $ilTabs, $ilPluginAdmin, $ilDB, $tree, $ilUser;
90 
91  if((!$ilAccess->checkAccess("read", "", $_GET["ref_id"])))
92  {
93  global $ilias;
94  $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
95  }
96 
97  $cmd = $this->ctrl->getCmd("infoScreen");
98 
99  $cmdsDisabledDueToOfflineStatus = array(
100  'resumePlayer', 'resumePlayer', 'outUserResultsOverview', 'outUserListOfAnswerPasses'
101  );
102 
103  if(!$this->getCreationMode() && !$this->object->isOnline() && in_array($cmd, $cmdsDisabledDueToOfflineStatus))
104  {
105  $cmd = 'infoScreen';
106  }
107 
108  $next_class = $this->ctrl->getNextClass($this);
109  $this->ctrl->setReturn($this, "infoScreen");
110 
111  if(method_exists($this->object, "getTestStyleLocation")) $this->tpl->addCss($this->object->getTestStyleLocation("output"), "screen");
112 
113  // add entry to navigation history
114  if(!$this->getCreationMode() &&
115  $ilAccess->checkAccess("read", "", $_GET["ref_id"])
116  )
117  {
118  $ilNavigationHistory->addItem($_GET["ref_id"],
119  "ilias.php?baseClass=ilObjTestGUI&cmd=infoScreen&ref_id=" . $_GET["ref_id"], "tst");
120  }
121 
122  if(!$this->getCreationMode())
123  {
124  if(IS_PAYMENT_ENABLED)
125  {
126  require_once 'Services/Payment/classes/class.ilPaymentObject.php';
127  if(ilPaymentObject::_requiresPurchaseToAccess($this->object->getRefId(), $type = (isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)))
128  {
129  $this->setLocator();
130  $this->tpl->getStandardTemplate();
131 
132  include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
133  $pp = new ilShopPurchaseGUI((int)$_GET['ref_id']);
134  $ret = $this->ctrl->forwardCommand($pp);
135  $this->tpl->show();
136  exit();
137  }
138  }
139  }
140 
141  // elba hack for storing question id for inserting new question after
142  if($_REQUEST['prev_qid'])
143  {
144  global $___prev_question_id;
145  $___prev_question_id = $_REQUEST['prev_qid'];
146  $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']);
147  }
148 
149  if( !$this->getCreationMode() && $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken() )
150  {
151  if( !$this->testQuestionSetConfigFactory->getQuestionSetConfig()->isValidRequestOnBrokenQuestionSetDepencies($next_class, $cmd) )
152  {
153  $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
154  }
155  }
156 
157  switch($next_class)
158  {
159  case 'iltestexportgui':
160  if(!$ilAccess->checkAccess('write', '', $this->ref_id))
161  {
162  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
163  }
164 
165  $this->prepareOutput();
166  $this->addHeaderAction();
167  require_once 'Modules/Test/classes/class.ilTestExportGUI.php';
168  $ilCtrl->forwardCommand(new ilTestExportGUI($this));
169  break;
170 
171  case "ilinfoscreengui":
172  $this->prepareOutput();
173  $this->addHeaderAction();
174  $this->infoScreen(); // forwards command
175  break;
176  case 'ilmdeditorgui':
177  if(!$ilAccess->checkAccess('write', '', $this->object->getRefId()))
178  {
179  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
180  }
181 
182  $this->prepareOutput();
183  $this->addHeaderAction();
184  require_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
185  $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
186  $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
187 
188  $this->ctrl->forwardCommand($md_gui);
189  break;
190 
191  case "iltestoutputgui":
192  require_once "./Modules/Test/classes/class.ilTestOutputGUI.php";
193  if(!$this->object->getKioskMode()) $this->prepareOutput();
194 
195  $output_gui =& new ilTestOutputGUI($this->object);
196  $this->ctrl->forwardCommand($output_gui);
197  break;
198 
199  case "iltestplayerdynamicquestionsetgui":
200  require_once "./Modules/Test/classes/class.ilTestPlayerDynamicQuestionSetGUI.php";
201  if (!$this->object->getKioskMode()) $this->prepareOutput();
202  $output_gui =& new ilTestPlayerDynamicQuestionSetGUI($this->object);
203  $this->ctrl->forwardCommand($output_gui);
204  break;
205 
206  case "iltestevaluationgui":
207  $this->prepareOutput();
208  $this->addHeaderAction();
209  include_once "./Modules/Test/classes/class.ilTestEvaluationGUI.php";
210  $evaluation_gui =& new ilTestEvaluationGUI($this->object);
211  $this->ctrl->forwardCommand($evaluation_gui);
212  break;
213 
214  case "iltestservicegui":
215  $this->prepareOutput();
216  $this->addHeaderAction();
217  require_once "./Modules/Test/classes/class.ilTestServiceGUI.php";
218  $serviceGUI =& new ilTestServiceGUI($this->object);
219  $this->ctrl->forwardCommand($serviceGUI);
220  break;
221 
222  case 'ilpermissiongui':
223  $this->prepareOutput();
224  $this->addHeaderAction();
225  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
226  $perm_gui =& new ilPermissionGUI($this);
227  $ret =& $this->ctrl->forwardCommand($perm_gui);
228  break;
229 
230  case "illearningprogressgui":
231  $this->prepareOutput();
232  $this->addHeaderAction();
233  require_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
234  $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $this->object->getRefId());
235  $this->ctrl->forwardCommand($new_gui);
236 
237  break;
238 
239  case "ilcertificategui":
240  $this->prepareOutput();
241  $this->addHeaderAction();
242  require_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
243  require_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php";
244  $output_gui = new ilCertificateGUI(new ilTestCertificateAdapter($this->object));
245  $this->ctrl->forwardCommand($output_gui);
246  break;
247 
248  case "iltestscoringgui":
249  $this->prepareOutput();
250  $this->addHeaderAction();
251  require_once "./Modules/Test/classes/class.ilTestScoringGUI.php";
252  $output_gui = new ilTestScoringGUI($this->object);
253  $this->ctrl->forwardCommand($output_gui);
254  break;
255 
256  case 'iltestscoringbyquestionsgui':
257  $this->prepareOutput();
258  $this->addHeaderAction();
259  include_once 'Modules/Test/classes/class.ilTestScoringByQuestionsGUI.php';
260  $output_gui = new ilTestScoringByQuestionsGUI($this->object);
261  $this->ctrl->forwardCommand($output_gui);
262  break;
263 
264  case 'ilobjtestsettingsgeneralgui':
265  $this->prepareOutput();
266  $this->addHeaderAction();
267  require_once 'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
268  $gui = new ilObjTestSettingsGeneralGUI(
269  $this->ctrl, $ilAccess, $this->lng, $this->tpl, $this->tree, $ilDB, $ilPluginAdmin, $ilUser, $this
270  );
271  $this->ctrl->forwardCommand($gui);
272  break;
273 
274  case 'ilobjtestdynamicquestionsetconfiggui':
275  $this->prepareOutput();
276  $this->addHeaderAction();
277  require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfigGUI.php';
278  $gui = new ilObjTestDynamicQuestionSetConfigGUI($this->ctrl, $ilAccess, $ilTabs, $this->lng, $this->tpl, $ilDB, $tree, $ilPluginAdmin, $this->object);
279  $this->ctrl->forwardCommand($gui);
280  break;
281 
282  case 'iltestrandomquestionsetconfiggui':
283  $this->prepareOutput();
284  $this->addHeaderAction();
285  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetConfigGUI.php';
286  $gui = new ilTestRandomQuestionSetConfigGUI($this->ctrl, $ilAccess, $ilTabs, $this->lng, $this->tpl, $ilDB, $tree, $ilPluginAdmin, $this->object);
287  $this->ctrl->forwardCommand($gui);
288  break;
289 
290  case 'ilobjectcopygui':
291  $this->prepareOutput();
292  $this->addHeaderAction();
293  require_once './Services/Object/classes/class.ilObjectCopyGUI.php';
294  $cp = new ilObjectCopyGUI($this);
295  $cp->setType('tst');
296  $this->ctrl->forwardCommand($cp);
297  break;
298 
299  case 'ilrepositorysearchgui':
300  $this->prepareOutput();
301  $this->addHeaderAction();
302  require_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
303  $rep_search =& new ilRepositorySearchGUI();
304  $rep_search->setCallback($this,
305  'addParticipantsObject',
306  array()
307  );
308 
309  // Set tabs
310  $this->ctrl->setReturn($this, 'participants');
311  $ret =& $this->ctrl->forwardCommand($rep_search);
312  $this->tabs_gui->setTabActive('participants');
313  break;
314 
315  case 'ilpageeditorgui':
316  case 'iltestexpresspageobjectgui':
317 
318  require_once 'Modules/TestQuestionPool/classes/class.ilAssIncompleteQuestionPurger.php';
319  $incompleteQuestionPurger = new ilAssIncompleteQuestionPurger($ilDB);
320  $incompleteQuestionPurger->setOwnerId($ilUser->getId());
321  $incompleteQuestionPurger->purge();
322 
323  $qid = $_REQUEST['q_id'];
324 
325  // :FIXME: does not work
326  // $this->ctrl->saveParameterByClass(array('iltestexpresspageobjectgui', 'assorderingquestiongui', 'ilpageeditorgui', 'ilpcquestion', 'ilpcquestiongui'), 'test_express_mode');
327 
328  if(!$qid || $qid == 'Array')
329  {
330  $questions = $this->object->getQuestionTitlesAndIndexes();
331  if(!is_array($questions))
332  $questions = array();
333 
334  $keys = array_keys($questions);
335  $qid = $keys[0];
336 
337  $_REQUEST['q_id'] = $qid;
338  $_GET['q_id'] = $qid;
339  $_POST['q_id'] = $qid;
340  }
341 
342  $this->prepareOutput();
343  if(!in_array($cmd, array('addQuestion', 'browseForQuestions')))
344  {
345  $this->buildPageViewToolbar($qid);
346  }
347 
348  if(!$qid || in_array($cmd, array('insertQuestions', 'browseForQuestions')))
349  {
350  require_once "./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php";
351  $pageObject = new ilTestExpressPageObjectGUI (0);
352  $pageObject->test_object = $this->object;
353  $ret =& $this->ctrl->forwardCommand($pageObject);
354  break;
355  }
356  require_once "./Services/Style/classes/class.ilObjStyleSheet.php";
357  $this->tpl->setCurrentBlock("ContentStyle");
358  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
360  $this->tpl->parseCurrentBlock();
361 
362  // syntax style
363  $this->tpl->setCurrentBlock("SyntaxStyle");
364  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
366  $this->tpl->parseCurrentBlock();
367  require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
368 
369  $q_gui = assQuestionGUI::_getQuestionGUI("", $qid);
370  if(!($q_gui instanceof assQuestionGUI))
371  {
372  $this->ctrl->setParameterByClass('iltestexpresspageobjectgui', 'q_id', '');
373  $this->ctrl->redirectByClass('iltestexpresspageobjectgui', $this->ctrl->getCmd());
374  }
375 
376  $q_gui->outAdditionalOutput();
377  $q_gui->object->setObjId($this->object->getId());
378  $question = $q_gui->object;
379  $this->ctrl->saveParameter($this, "q_id");
380 
381  #$this->lng->loadLanguageModule("content");
382  $this->ctrl->setReturnByClass("ilTestExpressPageObjectGUI", "view");
383  $this->ctrl->setReturn($this, "questions");
384 
385  require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php";
386  require_once "./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php";
387 
388  $page_gui = new ilTestExpressPageObjectGUI($qid);
389  $page_gui->test_object = $this->object;
390  $page_gui->setEditPreview(true);
391  $page_gui->setEnabledTabs(false);
392  if(strlen($this->ctrl->getCmd()) == 0)
393  {
394  $this->ctrl->setCmdClass(get_class($page_gui));
395  $this->ctrl->setCmd("preview");
396  }
397 
398  $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
399  $page_gui->setTemplateTargetVar("ADM_CONTENT");
400 
401  $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? "edit" : 'preview');
402 
403  $page_gui->setHeader($question->getTitle());
404  $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile"));
405  $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "fullscreen"));
406  $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
407  $page_gui->setPresentationTitle($question->getTitle() . ' ['. $this->lng->txt('question_id_short') . ': ' . $question->getId() . ']');
408  $ret =& $this->ctrl->forwardCommand($page_gui);
409 
410  global $ilTabs;
411  $ilTabs->activateTab('assQuestions');
412 
413  $this->tpl->setContent($ret);
414  break;
415 
416  case 'ilassquestionpagegui':
417  require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
418  //echo $_REQUEST['prev_qid'];
419  if($_REQUEST['prev_qid'])
420  {
421  $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']);
422  }
423 
424  $this->prepareOutput();
425  //global $___test_express_mode;
426  //$___test_express_mode = true;
427  $_GET['calling_test'] = $this->object->getRefId();
428  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
429  $this->tpl->setCurrentBlock("ContentStyle");
430  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
432  $this->tpl->parseCurrentBlock();
433 
434  // syntax style
435  $this->tpl->setCurrentBlock("SyntaxStyle");
436  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
438  $this->tpl->parseCurrentBlock();
439  require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
440  $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
441  $q_gui->setQuestionTabs();
442  $q_gui->outAdditionalOutput();
443  $q_gui->object->setObjId($this->object->getId());
444  $question =& $q_gui->object;
445  $this->ctrl->saveParameter($this, "q_id");
446  $this->lng->loadLanguageModule("content");
447  $this->ctrl->setReturnByClass("ilAssQuestionPageGUI", "view");
448  $this->ctrl->setReturn($this, "questions");
449  $page_gui = new ilAssQuestionPageGUI($_GET["q_id"]);
450  $page_gui->setEditPreview(true);
451  if(strlen($this->ctrl->getCmd()) == 0)
452  {
453  $this->ctrl->setCmdClass(get_class($page_gui));
454  $this->ctrl->setCmd("preview");
455  }
456  $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
457  $page_gui->setTemplateTargetVar("ADM_CONTENT");
458  $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? "edit" : 'preview');
459  $page_gui->setHeader($question->getTitle());
460  $page_gui->setPresentationTitle($question->getTitle() . ' ['. $this->lng->txt('question_id_short') . ': ' . $question->getId() . ']');
461  $ret =& $this->ctrl->forwardCommand($page_gui);
462  $this->tpl->setContent($ret);
463  break;
464 
465  case 'ilassspecfeedbackpagegui':
466  require_once "./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPageGUI.php";
467  $pg_gui = new ilAssSpecFeedbackPageGUI((int) $_GET["feedback_id"]);
468  $this->ctrl->forwardCommand($pg_gui);
469  break;
470 
471  case 'ilassgenfeedbackpagegui':
472  require_once "./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPageGUI.php";
473  $pg_gui = new ilAssGenFeedbackPageGUI((int) $_GET["feedback_id"]);
474  $this->ctrl->forwardCommand($pg_gui);
475  break;
476 
477  case 'illocalunitconfigurationgui':
478  $this->prepareSubGuiOutput();
479 
480  // set return target
481  $this->ctrl->setReturn($this, "questions");
482 
483  // set context tabs
484  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
485  $questionGUI = assQuestionGUI::_getQuestionGUI('', $_GET['q_id']);
486  $questionGUI->object->setObjId($this->object->getId());
487  $questionGUI->setQuestionTabs();
488 
489  require_once 'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php';
490  require_once 'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
491  $gui = new ilLocalUnitConfigurationGUI(
492  new ilUnitConfigurationRepository((int)$_GET['q_id'])
493  );
494  $this->ctrl->forwardCommand($gui);
495  break;
496 
497  case "ilcommonactiondispatchergui":
498  require_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
500  $this->ctrl->forwardCommand($gui);
501  break;
502 
503  case 'ilassquestionhintsgui':
504 
505  $this->prepareSubGuiOutput();
506 
507  // set return target
508  $this->ctrl->setReturn($this, "questions");
509 
510  // set context tabs
511  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
512  $questionGUI =& assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
513  $questionGUI->object->setObjId($this->object->getId());
514  $questionGUI->setQuestionTabs();
515 
516  // forward to ilAssQuestionHintsGUI
517  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
518  $gui = new ilAssQuestionHintsGUI($questionGUI);
519  $ilCtrl->forwardCommand($gui);
520 
521  break;
522 
523  case 'ilassquestionfeedbackeditinggui':
524 
525  $this->prepareSubGuiOutput();
526 
527  // set return target
528  $this->ctrl->setReturn($this, "questions");
529 
530  // set context tabs
531  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
532  $questionGUI = assQuestionGUI::_getQuestionGUI('', $_GET['q_id']);
533  $questionGUI->object->setObjId($this->object->getId());
534  $questionGUI->setQuestionTabs();
535 
536  // forward to ilAssQuestionFeedbackGUI
537  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
538  $gui = new ilAssQuestionFeedbackEditingGUI($questionGUI, $ilCtrl, $ilAccess, $tpl, $ilTabs, $lng);
539  $ilCtrl->forwardCommand($gui);
540 
541  break;
542 
543  case 'iltesttoplistgui':
544  $this->prepareOutput();
545  require_once './Modules/Test/classes/class.ilTestToplistGUI.php';
546  $gui = new ilTestToplistGUI($this);
547  $this->ctrl->forwardCommand($gui);
548  break;
549 
550  case 'ilscoringadjustmentgui':
551  $this->prepareOutput();
552  require_once './Modules/Test/classes/class.ilScoringAdjustmentGUI.php';
553  $gui = new ilScoringAdjustmentGUI($this->object);
554  $this->ctrl->forwardCommand($gui);
555  break;
556 
557  case '':
558  case 'ilobjtestgui':
559  $this->prepareOutput();
560  $this->addHeaderAction();
561  if((strcmp($cmd, "properties") == 0) && ($_GET["browse"]))
562  {
563  $this->questionBrowser();
564  return;
565  }
566  if((strcmp($cmd, "properties") == 0) && ($_GET["up"] || $_GET["down"]))
567  {
568  $this->questionsObject();
569  return;
570  }
571  $cmd .= "Object";
572  $ret =& $this->$cmd();
573  break;
574  default:
575  // elba hack for storing question id for inserting new question after
576  if($_REQUEST['prev_qid'])
577  {
578  global $___prev_question_id;
579  $___prev_question_id = $_REQUEST['prev_qid'];
580  $this->ctrl->setParameterByClass('ilassquestionpagegui', 'prev_qid', $_REQUEST['prev_qid']);
581  $this->ctrl->setParameterByClass($_GET['sel_question_types'] . 'gui', 'prev_qid', $_REQUEST['prev_qid']);
582  }
583  $this->create_question_mode = true;
584  $this->prepareOutput();
585 
586  $this->ctrl->setReturn($this, "questions");
587  require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
588  $q_gui =& assQuestionGUI::_getQuestionGUI($_GET['sel_question_types'], $_GET["q_id"]);
589  $q_gui->object->setObjId($this->object->getId());
590  if(!$_GET['sel_question_types'])
591  $qType = assQuestion::getQuestionTypeFromDb($_GET['q_id']);
592  else
593  {
594  $qType = $_GET['sel_question_types'];
595  }
596  $this->ctrl->setParameterByClass($qType . "GUI", 'prev_qid', $_REQUEST['prev_qid']);
597  $this->ctrl->setParameterByClass($qType . "GUI", 'test_ref_id', $_REQUEST['ref_id']);
598  $this->ctrl->setParameterByClass($qType . "GUI", 'q_id', $_REQUEST['q_id']);
599  if($_REQUEST['test_express_mode'])
600  $this->ctrl->setParameterByClass($qType . "GUI", 'test_express_mode', 1);
601 
602  #global $___test_express_mode;
603  #$___test_express_mode = true;
604  if(!$q_gui->isSaveCommand())
605  $_GET['calling_test'] = $this->object->getRefId();
606 
607  $q_gui->setQuestionTabs();
608  #unset($___test_express_mode);
609  $ret =& $this->ctrl->forwardCommand($q_gui);
610  break;
611  }
612  if ( !in_array(strtolower($_GET["baseClass"]), array('iladministrationgui', 'ilrepositorygui')) &&
613  $this->getCreationMode() != true)
614  {
615  $this->tpl->show();
616  }
617  }
Scoring class for tests.
exit
Definition: login.php:54
$_POST['username']
Definition: cron.php:12
Export User Interface Class.
GUI class for the workflow of copying objects.
Generic feedback page GUI class.
$_GET["client_id"]
buildPageViewToolbar($qid=0)
Questions per page.
Output class for assessment test execution.
Class ilShopPurchaseGUI.
$cmd
Definition: sahs_server.php:35
static _requiresPurchaseToAccess($a_ref_id, $a_purchasetype='')
this function should be used by all buyable repository objects !!
addObserver(&$a_class, $a_method, $a_element)
Class ilUnitConfigurationRepository.
Scoring class for tests.
Question page GUI class.
questionBrowser()
Creates a form to select questions from questionpools to insert the questions into the test...
getSyntaxStylePath()
get syntax style path
global $ilCtrl
Definition: ilias.php:18
prepareSubGuiOutput()
prepares ilias to get output rendered by sub gui class
& _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
Output class for assessment test evaluation.
GUI class to create PDF certificates.
Basic GUI class for assessment questions.
prepareOutput()
prepare output
Specific feedback page GUI class.
global $ilUser
Definition: imgupload.php:15
getContentStylePath($a_style_id)
get content style path
getCreationMode()
get creation mode
getQuestionTypeFromDb($question_id)
get question type for question id
Class ilLocalUnitConfigurationGUI.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Service GUI class for tests.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
Class ilScoringAdjustmentGUI.
addHeaderAction()
Add header action menu.
ilTestExpressPageObjectGUI: assMultipleChoiceGUI, assClozeTestGUI, assMatchingQuestionGUI ilTestExpr...
Class ilObjUserTrackingGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
setLocator()
set Locator
+ 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 1728 of file class.ilObjTestGUI.php.

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

1729  {
1730  $qpl_ref_id = $_REQUEST["sel_qpl"];
1731 
1732  $qpl_mode = $_REQUEST['usage'];
1733 
1734  if(isset($_REQUEST['qtype']))
1735  {
1736  include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
1737  $sel_question_types = ilObjQuestionPool::getQuestionTypeByTypeId($_REQUEST["qtype"]);
1738  }
1739  else if(isset($_REQUEST['sel_question_types']))
1740  {
1741  $sel_question_types = $_REQUEST["sel_question_types"];
1742  }
1743 
1744  if (!$qpl_mode || ($qpl_mode == 2 && strcmp($_REQUEST["txt_qpl"], "") == 0) || ($qpl_mode == 3 && strcmp($qpl_ref_id, "") == 0))
1745  //if ((strcmp($_REQUEST["txt_qpl"], "") == 0) && (strcmp($qpl_ref_id, "") == 0))
1746  {
1747  // Mantis #14890
1748  $_REQUEST['sel_question_types'] = $sel_question_types;
1749  ilUtil::sendInfo($this->lng->txt("questionpool_not_entered"));
1750  $this->createQuestionObject();
1751  return;
1752  }
1753  else
1754  {
1755  $_SESSION["test_id"] = $this->object->getRefId();
1756  if ($qpl_mode == 2 && strcmp($_REQUEST["txt_qpl"], "") != 0)
1757  {
1758  // create a new question pool and return the reference id
1759  $qpl_ref_id = $this->createQuestionPool($_REQUEST["txt_qpl"]);
1760  }
1761  else if ($qpl_mode == 1)
1762  {
1763  $qpl_ref_id = $_GET["ref_id"];
1764  }
1765 
1766  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php";
1767  $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;
1768 
1769  if (isset($_REQUEST['prev_qid']))
1770  {
1771  $baselink .= '&prev_qid=' . $_REQUEST['prev_qid'];
1772  }
1773  else if(isset($_REQUEST['position']))
1774  {
1775  $baselink .= '&prev_qid=' . $_REQUEST['position'];
1776  }
1777 
1778  if ($_REQUEST['test_express_mode']) {
1779  $baselink .= '&test_express_mode=1';
1780  }
1781 
1782  if( isset($_REQUEST['add_quest_cont_edit_mode']) )
1783  {
1785  $baselink, "add_quest_cont_edit_mode={$_REQUEST['add_quest_cont_edit_mode']}", false
1786  );
1787  }
1788 
1789 #var_dump($_REQUEST['prev_qid']);
1790  ilUtil::redirect($baselink);
1791 
1792  exit();
1793  }
1794  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
exit
Definition: login.php:54
createQuestionObject()
Called when a new question should be created from a test.
$_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.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ filterAvailableQuestionsObject()

ilObjTestGUI::filterAvailableQuestionsObject ( )

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

2188  {
2189  include_once "./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
2190  $table_gui = new ilTestQuestionBrowserTableGUI($this, 'browseForQuestions');
2191  $table_gui->writeFilterToSession();
2192  $this->ctrl->redirect($this, "browseForQuestions");
2193  }

◆ filterObject()

ilObjTestGUI::filterObject ( )

Sets the filter for the question browser.

Sets the filter for the question browser

public

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

References questionBrowser().

1522  {
1523  $this->questionBrowser();
1524  }
questionBrowser()
Creates a form to select questions from questionpools to insert the questions into the test...
+ Here is the call graph for this function:

◆ formTimingObject()

ilObjTestGUI::formTimingObject ( )
private

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

References $_GET, $_POST, $options, ilDatePresentation\formatDate(), IL_CAL_DATETIME, and ilFormPropertyGUI\setInfo().

Referenced by showTimingFormObject(), and timingObject().

3226  {
3227  global $ilAccess;
3228 
3229  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
3230  $form = new ilPropertyFormGUI();
3231  $form->setFormAction($this->ctrl->getFormAction($this));
3232  $form->setTableWidth("100%");
3233  $form->setId("tst_change_workingtime");
3234  $form->setTitle($this->lng->txt("tst_change_workingtime"));
3235 
3236  // test users
3237  $participantslist = new ilSelectInputGUI($this->lng->txt('participants'), "participant");
3238  $participants =& $this->object->getTestParticipants();
3239  $times = $this->object->getStartingTimeOfParticipants();
3240  $addons = $this->object->getTimeExtensionsOfParticipants();
3241  $options = array(
3242  '' => $this->lng->txt('please_select'),
3243  '0' => $this->lng->txt('all_participants')
3244  );
3245  foreach ($participants as $participant)
3246  {
3247  $started = "";
3248 
3249  if ($this->object->getAnonymity())
3250  {
3251  $name = $this->lng->txt("anonymous");
3252  }
3253  else
3254  {
3255  $name = $participant['lastname'] . ', ' . $participant['firstname'];
3256  }
3257 
3258 
3259  if ($times[$participant['active_id']])
3260  {
3261  $started = ", ".$this->lng->txt('tst_started').': '.ilDatePresentation::formatDate(new ilDateTime($times[$participant['active_id']], IL_CAL_DATETIME));
3262  }
3263  if ($addons[$participant['active_id']] > 0) $started .= ", " . $this->lng->txt('extratime') . ': ' . $addons[$participant['active_id']] . ' ' . $this->lng->txt('minutes');
3264  $options[$participant['active_id']] = $participant['login'] . ' (' .$name. ')'.$started;
3265  }
3266  $participantslist->setRequired(true);
3267  $participantslist->setOptions($options);
3268  $form->addItem($participantslist);
3269 
3270  // extra time
3271  $extratime = new ilNumberInputGUI($this->lng->txt("extratime"), "extratime");
3272  $extratime->setInfo($this->lng->txt('tst_extratime_info'));
3273  $extratime->setRequired(true);
3274  $extratime->setMinValue(0);
3275  $extratime->setMinvalueShouldBeGreater(false);
3276  $extratime->setSuffix($this->lng->txt('minutes'));
3277  $extratime->setSize(5);
3278  $form->addItem($extratime);
3279 
3280  if (is_array($_POST) && strlen($_POST['cmd']['timing'])) $form->setValuesByArray($_POST);
3281 
3282  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) $form->addCommandButton("timing", $this->lng->txt("save"));
3283  $form->addCommandButton('timingOverview', $this->lng->txt("cancel"));
3284  return $form;
3285  }
$_POST['username']
Definition: cron.php:12
const IL_CAL_DATETIME
This class represents a selection list property in a property form.
This class represents a property form user interface.
$_GET["client_id"]
setInfo($a_info)
Set Information Text.
if(!is_array($argv)) $options
This class represents a number property in a property form.
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fpResetFilterObject()

ilObjTestGUI::fpResetFilterObject ( )

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

References participantsObject(), and ilTable2GUI\resetFilter().

3347  {
3348  include_once("./Modules/Test/classes/tables/class.ilTestFixedParticipantsTableGUI.php");
3349  $table_gui = new ilTestFixedParticipantsTableGUI(
3350  $this, "participants", false, $this->object->getAnonymity(), 0
3351  );
3352  $table_gui->resetFilter(); // writes filter to session
3353  $table_gui->resetOffset(); // sets record offest to 0 (first page)
3354  $this->participantsObject();
3355  }
participantsObject()
Creates the output of the test participants.
resetFilter()
Reset filter.
+ Here is the call graph for this function:

◆ fpSetFilterObject()

ilObjTestGUI::fpSetFilterObject ( )

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

References participantsObject(), and ilTable2GUI\writeFilterToSession().

3338  {
3339  include_once("./Modules/Test/classes/tables/class.ilTestFixedParticipantsTableGUI.php");
3340  $table_gui = new ilTestFixedParticipantsTableGUI($this, "participants", false, $this->object->getAnonymity(), 0);
3341  $table_gui->writeFilterToSession(); // writes filter to session
3342  $table_gui->resetOffset(); // sets record offest to 0 (first page)
3343  $this->participantsObject();
3344  }
participantsObject()
Creates the output of the test participants.
writeFilterToSession()
Write filter values to session.
+ Here is the call graph for this function:

◆ fullscreenObject()

ilObjTestGUI::fullscreenObject ( )

show fullscreen view

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

References $_GET.

1496  {
1497  include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
1498  $page_gui = new ilAssQuestionPageGUI($_GET["pg_id"]);
1499  $page_gui->showMediaFullscreen();
1500 
1501  }
$_GET["client_id"]
Question page GUI class.

◆ getBrowseForQuestionsTab()

ilObjTestGUI::getBrowseForQuestionsTab ( $tabs_gui)

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

Referenced by getTabs().

4295  {
4296  global $ilAccess;
4297  if ($ilAccess->checkAccess("write", "", $this->ref_id))
4298  {
4299  $this->ctrl->saveParameterByClass($this->ctrl->getCmdClass(), 'q_id');
4300  // edit page
4301  $tabs_gui->setBackTarget($this->lng->txt("backtocallingtest"), $this->ctrl->getLinkTargetByClass($this->ctrl->getCmdClass(), "questions"));
4302  $tabs_gui->addTarget("tst_browse_for_questions",
4303  $this->ctrl->getLinkTarget($this, "browseForQuestions"),
4304  array("browseForQuestions", "filter", "resetFilter", "resetTextFilter", "insertQuestions"),
4305  "", "", TRUE
4306  );
4307  }
4308  }
+ Here is the caller graph for this function:

◆ getParticipantsSubTabs()

ilObjTestGUI::getParticipantsSubTabs ( )

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

Referenced by participantsObject(), timingObject(), and timingOverviewObject().

4470  {
4471  global $ilTabs;
4472 
4473  // participants subtab
4474  $ilTabs->addSubTabTarget( "participants",
4475  $this->ctrl->getLinkTarget($this,'participants'),
4476  array(
4477  "participants", "saveClientIP",
4478  "removeParticipant",
4479  "showParticipantAnswersForAuthor",
4480  "deleteAllUserResults",
4481  "cancelDeleteAllUserData", "deleteSingleUserResults",
4482  "outParticipantsResultsOverview", "outParticipantsPassDetails",
4483  "showPassOverview", "showUserAnswers", "participantsAction",
4484  "showDetailedResults",
4485  'npResetFilter', 'npSetFilter'
4486  ),
4487  ""
4488  );
4489 
4490  if( !$this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken() )
4491  {
4492  if($this->object->getProcessingTimeInSeconds() > 0 && $this->object->getNrOfTries() == 1)
4493  {
4494  // extratime subtab
4495  $ilTabs->addSubTabTarget( "timing",
4496  $this->ctrl->getLinkTarget($this,'timingOverview'),
4497  array("timing", "timingOverview"), "", ""
4498  );
4499  }
4500  }
4501  }
+ Here is the caller graph for this function:

◆ getQuestionpoolCreationForm()

ilObjTestGUI::getQuestionpoolCreationForm ( )
private

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

References $_REQUEST, ilObjectGUI\$lng, and ilFormPropertyGUI\setRequired().

Referenced by createQuestionPoolAndCopyObject(), and createQuestionpoolTargetObject().

5129  {
5130  global $lng;
5131  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
5132  $form = new ilPropertyFormGUI();
5133 
5134  $title = new ilTextInputGUI($lng->txt('title'), 'title');
5135  $title->setRequired(true);
5136  $form->addItem($title);
5137 
5138  $description = new ilTextAreaInputGUI($lng->txt('description'), 'description');
5139  $form->addItem($description);
5140 
5141  $form->addCommandButton('createQuestionPoolAndCopy', $lng->txt('create'));
5142 
5143  if(isset($_REQUEST['q_id']) && is_array($_REQUEST['q_id']))
5144  {
5145  foreach($_REQUEST['q_id'] as $id)
5146  {
5147  $hidden = new ilHiddenInputGUI('q_id[]');
5148  $hidden->setValue($id);
5149  $form->addItem($hidden);
5150  }
5151  }
5152 
5153  return $form;
5154  }
This class represents a property form user interface.
This class represents a hidden form property in a property form.
This class represents a text property in a property form.
This class represents a text area property in a property form.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionsSubTabs()

ilObjTestGUI::getQuestionsSubTabs ( )

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

References $_REQUEST, $ilCtrl, and ilObjAssessmentFolderGUI\getSettingsTemplateConfig().

Referenced by buildPageViewToolbar(), createQuestionObject(), createQuestionpoolTargetObject(), createRandomSelectionObject(), printobject(), questionsObject(), randomselectObject(), and removeQuestionsObject().

4341  {
4342  global $ilTabs, $ilCtrl;
4343  $ilTabs->activateTab('assQuestions');
4344  $a_cmd = $ilCtrl->getCmd();
4345 
4346  if (!$this->object->isRandomTest())
4347  {
4348  #if (in_array($this->object->getEnabledViewMode(), array('both', 'express'))) {
4349  $questions_per_page = ($a_cmd == 'questions_per_page' || ($a_cmd == 'removeQuestions' && $_REQUEST['test_express_mode'])) ? true : false;
4350 
4351  $this->tabs_gui->addSubTabTarget(
4352  "questions_per_page_view",
4353  $this->ctrl->getLinkTargetByClass('iltestexpresspageobjectgui', 'showPage'),
4354  "", "", "", $questions_per_page);
4355  #}
4356  }
4357  include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
4358  $template = new ilSettingsTemplate($this->object->getTemplate(), ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
4359 
4360  if (!in_array('questions', $template->getHiddenTabs())) {
4361  // questions subtab
4362  $ilTabs->addSubTabTarget("edit_test_questions",
4363  $this->ctrl->getLinkTarget($this,'questions'),
4364  array("questions", "browseForQuestions", "questionBrowser", "createQuestion",
4365  "randomselect", "filter", "resetFilter", "insertQuestions",
4366  "back", "createRandomSelection", "cancelRandomSelect",
4367  "insertRandomSelection", "removeQuestions", "moveQuestions",
4368  "insertQuestionsBefore", "insertQuestionsAfter", "confirmRemoveQuestions",
4369  "cancelRemoveQuestions", "executeCreateQuestion", "cancelCreateQuestion",
4370  "addQuestionpool", "saveRandomQuestions", "saveQuestionSelectionMode"),
4371  "");
4372 
4373  if (in_array($a_cmd, array('questions', 'createQuestion')) || ($a_cmd == 'removeQuestions' && !$_REQUEST['test_express_mode']))
4374  $this->tabs_gui->activateSubTab('edit_test_questions');
4375  }
4376  #}
4377 
4378  // print view subtab
4379  if (!$this->object->isRandomTest())
4380  {
4381  $ilTabs->addSubTabTarget("print_view",
4382  $this->ctrl->getLinkTarget($this,'print'),
4383  "print", "", "", $this->ctrl->getCmd() == 'print');
4384  $ilTabs->addSubTabTarget('review_view',
4385  $this->ctrl->getLinkTarget($this, 'review'),
4386  'review', '', '', $this->ctrl->getCmd() == 'review');
4387  }
4388 
4389 
4390  }
static getSettingsTemplateConfig()
Get settings template configuration object.
global $ilCtrl
Definition: ilias.php:18
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
Settings template application class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRandomQuestionsTab()

ilObjTestGUI::getRandomQuestionsTab ( $tabs_gui)

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

4311  {
4312  global $ilAccess;
4313  if ($ilAccess->checkAccess("write", "", $this->ref_id))
4314  {
4315  // edit page
4316  $tabs_gui->setBackTarget($this->lng->txt("backtocallingtest"), $this->ctrl->getLinkTarget($this, "questions"));
4317  $tabs_gui->addTarget("random_selection",
4318  $this->ctrl->getLinkTarget($this, "randomQuestions"),
4319  array("randomQuestions"),
4320  "", ""
4321  );
4322  }
4323  }

◆ getSettingsSubTabs()

ilObjTestGUI::getSettingsSubTabs (   $hiddenTabs = array())

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

References ilObjectGUI\$ilias, and ilCertificate\isActive().

Referenced by getTabs().

4417  {
4418  global $ilTabs, $ilias;
4419 
4420  // general subtab
4421  $ilTabs->addSubTabTarget('general', $this->ctrl->getLinkTargetByClass('ilObjTestSettingsGeneralGUI'),
4422  '', // auto activation regardless from cmd
4423  array('ilobjtestsettingsgeneralgui') // auto activation for ilObjTestSettingsGeneralGUI
4424  );
4425 
4426  if (!in_array('mark_schema', $hiddenTabs)) {
4427  // mark schema subtab
4428  $ilTabs->addSubTabTarget(
4429  "mark_schema",
4430  $this->ctrl->getLinkTarget($this,'marks'),
4431  array("marks", "addMarkStep", "deleteMarkSteps", "addSimpleMarkSchema",
4432  "saveMarks", "cancelMarks"),
4433  array("", "ilobjtestgui", "ilcertificategui")
4434  );
4435  }
4436 
4437  // scoring subtab
4438  $ilTabs->addSubTabTarget(
4439  "scoring",
4440  $this->ctrl->getLinkTarget($this,'scoring'),
4441  array("scoring"),
4442  array("", "ilobjtestgui", "ilcertificategui")
4443  );
4444 
4445  // certificate subtab
4446  include_once "Services/Certificate/classes/class.ilCertificate.php";
4448  {
4449  $ilTabs->addSubTabTarget(
4450  "certificate",
4451  $this->ctrl->getLinkTarget($this,'certificate'),
4452  array("certificate", "certificateEditor", "certificateRemoveBackground", "certificateSave",
4453  "certificatePreview", "certificateDelete", "certificateUpload", "certificateImport"),
4454  array("", "ilobjtestgui", "ilcertificategui")
4455  );
4456  }
4457 
4458  if (!in_array('defaults', $hiddenTabs)) {
4459  // defaults subtab
4460  $ilTabs->addSubTabTarget(
4461  "tst_default_settings",
4462  $this->ctrl->getLinkTarget($this, "defaults"),
4463  array("defaults", "deleteDefaults", "addDefaults", "applyDefaults"),
4464  array("", "ilobjtestgui", "ilcertificategui")
4465  );
4466  }
4467  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStatisticsSubTabs()

ilObjTestGUI::getStatisticsSubTabs ( )

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

Referenced by getTabs().

4393  {
4394  global $ilTabs;
4395 
4396  // user results subtab
4397  $ilTabs->addSubTabTarget("eval_all_users",
4398  $this->ctrl->getLinkTargetByClass("iltestevaluationgui", "outEvaluation"),
4399  array("outEvaluation", "detailedEvaluation", "exportEvaluation", "evalUserDetail", "passDetails",
4400  "outStatisticsResultsOverview", "statisticsPassDetails")
4401  , "");
4402 
4403  // aggregated results subtab
4404  $ilTabs->addSubTabTarget("tst_results_aggregated",
4405  $this->ctrl->getLinkTargetByClass("iltestevaluationgui", "eval_a"),
4406  array("eval_a"),
4407  "", "");
4408 
4409  // question export
4410  $ilTabs->addSubTabTarget("tst_single_results",
4411  $this->ctrl->getLinkTargetByClass("iltestevaluationgui", "singleResults"),
4412  array("singleResults"),
4413  "", "");
4414  }
+ Here is the caller graph for this function:

◆ getTabs()

ilObjTestGUI::getTabs ( $tabs_gui)

adds tabs to tab gui object

Parameters
ilTabsGUI$tabs_gui

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

References $_GET, $ilUser, ilObjAssessmentFolder\_getManualScoring(), ilLearningProgressAccess\checkAccess(), getBrowseForQuestionsTab(), getSettingsSubTabs(), ilObjAssessmentFolderGUI\getSettingsTemplateConfig(), getStatisticsSubTabs(), ilObjTest\QUESTION_SET_TYPE_DYNAMIC, ilObjTest\QUESTION_SET_TYPE_FIXED, and ilObjTest\QUESTION_SET_TYPE_RANDOM.

4509  {
4510  global $ilAccess, $ilUser, $ilHelp;
4511 
4512  if (preg_match('/^ass(.*?)gui$/i', $this->ctrl->getNextClass($this))) {
4513  return;
4514  }
4515  else if ($this->ctrl->getNextClass($this) == 'ilassquestionpagegui') {
4516  return;
4517  }
4518 
4519  $ilHelp->setScreenIdComponent("tst");
4520 
4521  $hidden_tabs = array();
4522 
4523  $template = $this->object->getTemplate();
4524  if($template)
4525  {
4526  include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
4528 
4529  $hidden_tabs = $template->getHiddenTabs();
4530  }
4531 
4532  // for local use in this fucking sledge hammer method
4533  $curUserHasWriteAccess = $ilAccess->checkAccess("write", "", $this->ref_id);
4534 
4535  switch( $this->ctrl->getCmdClass() )
4536  {
4537  case 'iltestoutputgui':
4538 
4539  return; // no tabs .. no subtabs .. during test pass
4540 
4541  case 'ilobjtestsettingsgeneralgui':
4542 
4543  if( $curUserHasWriteAccess )
4544  {
4545  $this->getSettingsSubTabs($hidden_tabs);
4546  }
4547 
4548  break;
4549  }
4550 
4551  switch ($this->ctrl->getCmd())
4552  {
4553  case "resume":
4554  case "previous":
4555  case "next":
4556  case "summary":
4557  case "directfeedback":
4558  case "finishTest":
4559  case "outCorrectSolution":
4560  case "passDetails":
4561  case "showAnswersOfUser":
4562  case "outUserResultsOverview":
4563  case "backFromSummary":
4564  case "show_answers":
4565  case "setsolved":
4566  case "resetsolved":
4567  case "confirmFinish":
4568  case "outTestSummary":
4569  case "outQuestionSummary":
4570  case "gotoQuestion":
4571  case "selectImagemapRegion":
4572  case "confirmSubmitAnswers":
4573  case "finalSubmission":
4574  case "postpone":
4575  case "redirectQuestion":
4576  case "outUserPassDetails":
4577  case "checkPassword":
4578  case "exportCertificate":
4579  case "finishListOfAnswers":
4580  case "backConfirmFinish":
4581  case "showFinalStatement":
4582  return;
4583  break;
4584  case "browseForQuestions":
4585  case "filter":
4586  case "resetFilter":
4587  case "resetTextFilter":
4588  case "insertQuestions":
4589  // #8497: resetfilter is also used in lp
4590  if($this->ctrl->getNextClass($this) != "illearningprogressgui")
4591  {
4592  return $this->getBrowseForQuestionsTab($tabs_gui);
4593  }
4594  break;
4595  case "scoring":
4596  case "marks":
4597  case "saveMarks":
4598  case "cancelMarks":
4599  case "addMarkStep":
4600  case "deleteMarkSteps":
4601  case "addSimpleMarkSchema":
4602  case "certificate":
4603  case "certificateservice":
4604  case "certificateImport":
4605  case "certificateUpload":
4606  case "certificateEditor":
4607  case "certificateDelete":
4608  case "certificateSave":
4609  case "defaults":
4610  case "deleteDefaults":
4611  case "addDefaults":
4612  case "applyDefaults":
4613  case "inviteParticipants":
4614  case "searchParticipants":
4615  if( $curUserHasWriteAccess && in_array($this->ctrl->getCmdClass(), array('ilobjtestgui', 'ilcertificategui')) )
4616  {
4617  $this->getSettingsSubTabs($hidden_tabs);
4618  }
4619  break;
4620  case "export":
4621  case "print":
4622  break;
4623  case "statistics":
4624  case "eval_a":
4625  case "detailedEvaluation":
4626  case "outEvaluation":
4627  case "singleResults":
4628  case "exportEvaluation":
4629  case "evalUserDetail":
4630  case "passDetails":
4631  case "outStatisticsResultsOverview":
4632  case "statisticsPassDetails":
4633  $this->getStatisticsSubTabs();
4634  break;
4635  }
4636 
4637  if (strcmp(strtolower(get_class($this->object)), "ilobjtest") == 0)
4638  {
4639  // questions tab
4640  if ($ilAccess->checkAccess("write", "", $this->ref_id) && !in_array('assQuestions', $hidden_tabs))
4641  {
4642  $force_active = ($_GET["up"] != "" || $_GET["down"] != "")
4643  ? true
4644  : false;
4645  if (!$force_active)
4646  {
4647  if ($_GET["browse"] == 1) $force_active = true;
4648  }
4649 
4650  switch( $this->object->getQuestionSetType() )
4651  {
4653  $target = $this->ctrl->getLinkTargetByClass('iltestexpresspageobjectgui','showPage');
4654  break;
4655 
4657  $target = $this->ctrl->getLinkTargetByClass('ilTestRandomQuestionSetConfigGUI');
4658  break;
4659 
4661  $target = $this->ctrl->getLinkTargetByClass('ilObjTestDynamicQuestionSetConfigGUI');
4662  break;
4663  }
4664 
4665  $tabs_gui->addTarget("assQuestions",
4666  //$this->ctrl->getLinkTarget($this,'questions'),
4667  $target,
4668  array("questions", "browseForQuestions", "questionBrowser", "createQuestion",
4669  "randomselect", "filter", "resetFilter", "insertQuestions",
4670  "back", "createRandomSelection", "cancelRandomSelect",
4671  "insertRandomSelection", "removeQuestions", "moveQuestions",
4672  "insertQuestionsBefore", "insertQuestionsAfter", "confirmRemoveQuestions",
4673  "cancelRemoveQuestions", "executeCreateQuestion", "cancelCreateQuestion",
4674  "addQuestionpool", "saveRandomQuestions", "saveQuestionSelectionMode", "print",
4675  "addsource", "removesource", "randomQuestions"),
4676  "", "", $force_active);
4677  }
4678 
4679  // info tab
4680  if ($ilAccess->checkAccess("read", "", $this->ref_id) && !in_array('info_short', $hidden_tabs))
4681  {
4682  $tabs_gui->addTarget("info_short",
4683  $this->ctrl->getLinkTarget($this,'infoScreen'),
4684  array("infoScreen", "outIntroductionPage", "showSummary",
4685  "setAnonymousId", "outUserListOfAnswerPasses", "redirectToInfoScreen"));
4686  }
4687 
4688  // settings tab
4689  if ($ilAccess->checkAccess("write", "", $this->ref_id))
4690  {
4691  if (!in_array('settings', $hidden_tabs))
4692  {
4693  $settingsCommands = array(
4694  "marks", "addMarkStep", "deleteMarkSteps", "addSimpleMarkSchema", "saveMarks", "cancelMarks",
4695  "certificate", "certificateEditor", "certificateRemoveBackground", "certificateSave",
4696  "certificatePreview", "certificateDelete", "certificateUpload", "certificateImport",
4697  "scoring", "defaults", "addDefaults", "deleteDefaults", "applyDefaults",
4698  "inviteParticipants", "saveFixedParticipantsStatus", "searchParticipants", "addParticipants" // ARE THEY RIGHT HERE
4699  );
4700 
4701  require_once 'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
4702  $reflection = new ReflectionClass('ilObjTestSettingsGeneralGUI');
4703  foreach($reflection->getConstants() as $name => $value)
4704  if(substr($name, 0, 4) == 'CMD_') $settingsCommands[] = $value;
4705 
4706  $settingsCommands[] = ""; // DO NOT KNOW WHAT THIS IS DOING, BUT IT'S REQUIRED
4707 
4708  $tabs_gui->addTarget("settings",
4709  $this->ctrl->getLinkTargetByClass('ilObjTestSettingsGeneralGUI'),
4710  $settingsCommands, array("ilobjtestsettingsgeneralgui", "ilobjtestgui", "ilcertificategui")
4711  );
4712  }
4713 
4714  if (!in_array('participants', $hidden_tabs))
4715  {
4716  // participants
4717  $tabs_gui->addTarget("participants",
4718  $this->ctrl->getLinkTarget($this,'participants'),
4719  array(
4720  "participants", "saveClientIP",
4721  "removeParticipant",
4722  "showParticipantAnswersForAuthor",
4723  "deleteAllUserResults",
4724  "cancelDeleteAllUserData", "deleteSingleUserResults",
4725  "outParticipantsResultsOverview", "outParticipantsPassDetails",
4726  "showPassOverview", "showUserAnswers", "participantsAction",
4727  "showDetailedResults",
4728  'timing', 'timingOverview', 'npResetFilter', 'npSetFilter', 'showTimingForm'
4729  ),
4730  ""
4731  );
4732  }
4733  }
4734 
4735  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
4736  if(ilLearningProgressAccess::checkAccess($this->object->getRefId()) && !in_array('learning_progress', $hidden_tabs))
4737  {
4738  $tabs_gui->addTarget('learning_progress',
4739  $this->ctrl->getLinkTargetByClass(array('illearningprogressgui'),''),
4740  '',
4741  array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui'));
4742  }
4743 
4744  if ($ilAccess->checkAccess("write", "", $this->ref_id) && !in_array('manscoring', $hidden_tabs))
4745  {
4746  include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
4748  if (count($scoring))
4749  {
4750  // scoring tab
4751  $tabs_gui->addTarget(
4752  "manscoring", $this->ctrl->getLinkTargetByClass('ilTestScoringGUI', 'showManScoringParticipantsTable'),
4753  array(
4754  'showManScoringParticipantsTable', 'applyManScoringParticipantsFilter', 'resetManScoringParticipantsFilter', 'showManScoringParticipantScreen',
4755  'showManScoringByQuestionParticipantsTable', 'applyManScoringByQuestionFilter', 'resetManScoringByQuestionFilter', 'saveManScoringByQuestion'
4756 
4757  ), ''
4758  );
4759  }
4760  }
4761 
4762  // Scoring Adjustment
4763  $setting = new ilSetting('assessment');
4764  $scoring_adjust_active = (bool) $setting->get('assessment_adjustments_enabled', false);
4765  if ($ilAccess->checkAccess("write", "", $this->ref_id) && $scoring_adjust_active && !in_array('scoringadjust', $hidden_tabs))
4766  {
4767  // scoring tab
4768  $tabs_gui->addTarget(
4769  "scoringadjust", $this->ctrl->getLinkTargetByClass('ilScoringAdjustmentGUI', 'showquestionlist'),
4770  array(
4771  'showquestionlist',
4772  'applyManScoringParticipantsFilter',
4773  'saveManScoringByQuestion'
4774  ), ''
4775  );
4776  }
4777 
4778  if ((($ilAccess->checkAccess("tst_statistics", "", $this->ref_id)) || ($ilAccess->checkAccess("write", "", $this->ref_id))) && !in_array('statistics', $hidden_tabs))
4779  {
4780  // statistics tab
4781  $tabs_gui->addTarget("statistics",
4782  $this->ctrl->getLinkTargetByClass("iltestevaluationgui", "outEvaluation"),
4783  array("statistics", "outEvaluation", "exportEvaluation", "detailedEvaluation", "eval_a", "evalUserDetail",
4784  "passDetails", "outStatisticsResultsOverview", "statisticsPassDetails", "singleResults")
4785  , "");
4786  }
4787 
4788  if ($ilAccess->checkAccess("write", "", $this->ref_id))
4789  {
4790  if (!in_array('history', $hidden_tabs)) {
4791 
4792  // history
4793  $tabs_gui->addTarget("history",
4794  $this->ctrl->getLinkTarget($this,'history'),
4795  "history", "");
4796  }
4797 
4798  if (!in_array('meta_data', $hidden_tabs)) {
4799  // meta data
4800  $tabs_gui->addTarget("meta_data",
4801  $this->ctrl->getLinkTargetByClass('ilmdeditorgui','listSection'),
4802  "", "ilmdeditorgui");
4803  }
4804 
4805  if(!in_array('export', $hidden_tabs))
4806  {
4807  // export tab
4808  $tabs_gui->addTarget(
4809  "export",
4810  $this->ctrl->getLinkTargetByClass('iltestexportgui' ,''),
4811  '',
4812  array('iltestexportgui')
4813  );
4814  }
4815  }
4816 
4817  if ($ilAccess->checkAccess("edit_permission", "", $this->ref_id)&& !in_array('permissions', $hidden_tabs))
4818  {
4819  $tabs_gui->addTarget("perm_settings",
4820  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
4821  }
4822  }
4823 
4824  if( $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken() )
4825  {
4826  $hideTabs = $this->testQuestionSetConfigFactory->getQuestionSetConfig()->getHiddenTabsOnBrokenDepencies();
4827 
4828  foreach($hideTabs as $tabId)
4829  {
4830  $tabs_gui->removeTab($tabId);
4831  }
4832  }
4833  }
static getSettingsTemplateConfig()
Get settings template configuration object.
ILIAS Setting Class.
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
$_GET["client_id"]
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
getSettingsSubTabs($hiddenTabs=array())
getBrowseForQuestionsTab(&$tabs_gui)
global $ilUser
Definition: imgupload.php:15
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)
Settings template application class.
_getManualScoring()
Retrieve the manual scoring settings.
+ Here is the call 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 2913 of file class.ilObjTestGUI.php.

References $log, and ilObjAssessmentFolder\_getLog().

2914  {
2915  include_once "./Modules/Test/classes/tables/class.ilTestHistoryTableGUI.php";
2916  $table_gui = new ilTestHistoryTableGUI($this, 'history');
2917  $table_gui->setTestObject($this->object);
2918  include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
2919  $log =& ilObjAssessmentFolder::_getLog(0, time(), $this->object->getId(), TRUE);
2920  $table_gui->setData($log);
2921  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
2922  }
& _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:

◆ ilObjTestGUI()

ilObjTestGUI::ilObjTestGUI ( )

Constructor public.

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

References $_GET, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tree, and ilObjectGUI\ilObjectGUI().

60  {
61  global $lng, $ilCtrl, $ilDB, $ilPluginAdmin, $tree;
62  $lng->loadLanguageModule("assessment");
63  $this->type = "tst";
64  $this->ctrl =& $ilCtrl;
65  $this->ctrl->saveParameter($this, array("ref_id", "test_ref_id", "calling_test", "test_express_mode", "q_id"));
66  $this->ilObjectGUI("",$_GET["ref_id"], true, false);
67 
68  if( $this->object instanceof ilObjTest )
69  {
70  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
71  $this->testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $this->object);
72 
73  require_once 'Modules/Test/classes/class.ilTestPlayerFactory.php';
74  $this->testPlayerFactory = new ilTestPlayerFactory($this->object);
75 
76  require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
77  $this->testSessionFactory = new ilTestSessionFactory($this->object);
78 
79  require_once 'Modules/Test/classes/class.ilTestSequenceFactory.php';
80  $this->testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this->object);
81  }
82  }
$_GET["client_id"]
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ importFileObject()

ilObjTestGUI::importFileObject ( )

form for new test object import

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

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

735  {
736  $form = $this->initImportForm($_REQUEST["new_type"]);
737  if($form->checkInput())
738  {
739  $this->ctrl->setParameter($this, "new_type", $this->type);
740  $this->uploadTstObject();
741  }
742 
743  // display form to correct errors
744  $form->setValuesByPost();
745  $this->tpl->setContent($form->getHTML());
746  }
initImportForm($a_new_type)
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
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 980 of file class.ilObjTestGUI.php.

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

981  {
982  include_once "./Modules/Test/classes/class.ilObjTest.php";
983  // create new questionpool object
984  $newObj = new ilObjTest(0, true);
985  // set type of questionpool object
986  $newObj->setType($_GET["new_type"]);
987  // set title of questionpool object to "dummy"
988  $newObj->setTitle("dummy");
989  // set description of questionpool object
990  $newObj->setDescription("test import");
991  // create the questionpool class in the ILIAS database (object_data table)
992  $newObj->create(true);
993  // create a reference for the questionpool object in the ILIAS database (object_reference table)
994  $newObj->createReference();
995  // put the questionpool object in the administration tree
996  $newObj->putInTree($_GET["ref_id"]);
997  // get default permissions and set the permissions for the questionpool object
998  $newObj->setPermissions($_GET["ref_id"]);
999  // notify the questionpool object and all its parent objects that a "new" object was created
1000  $newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());
1001  // empty mark schema
1002  $newObj->mark_schema->flush();
1003 
1004  // start parsing of QTI files
1005  include_once "./Services/QTI/classes/class.ilQTIParser.php";
1006 
1007  // Handle selection of "no questionpool" as qpl_id = -1 -> use test object id instead.
1008  // TODO: chek if empty strings in $_POST["qpl_id"] relates to a bug or not
1009  if ($_POST["qpl_id"] == "-1")
1010  {
1011  $qpl_id = $newObj->id;
1012  }
1013  else
1014  {
1015  $qpl_id = $_POST["qpl_id"];
1016  }
1017 
1018  $qtiParser = new ilQTIParser($_SESSION["tst_import_qti_file"], IL_MO_PARSE_QTI, $qpl_id, $_POST["ident"]);
1019  $qtiParser->setTestObject($newObj);
1020  $result = $qtiParser->startParsing();
1021  $newObj->saveToDb();
1022 
1023  // import page data
1024  include_once ("./Modules/LearningModule/classes/class.ilContObjParser.php");
1025  $contParser = new ilContObjParser($newObj, $_SESSION["tst_import_xml_file"], $_SESSION["tst_import_subdir"]);
1026  $contParser->setQuestionMapping($qtiParser->getImportMapping());
1027  $contParser->startParsing();
1028 
1029  // import test results
1030  if (@file_exists($_SESSION["tst_import_results_file"]))
1031  {
1032  include_once ("./Modules/Test/classes/class.ilTestResultsImportParser.php");
1033  $results = new ilTestResultsImportParser($_SESSION["tst_import_results_file"], $newObj);
1034  $results->startParsing();
1035  }
1036 
1037  // delete import directory
1039  ilUtil::sendSuccess($this->lng->txt("object_imported"),true);
1040 
1041  $newObj->updateMetaData();
1042 
1043  ilUtil::redirect("ilias.php?ref_id=".$newObj->getRefId().
1044  "&baseClass=ilObjTestGUI");
1045  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Content Object Parser.
$_POST['username']
Definition: cron.php:12
$result
_getImportDirectory()
Get the import directory location of the test.
$_GET["client_id"]
const IL_MO_PARSE_QTI
$results
static redirect($a_script)
http redirect to other script
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call 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 3864 of file class.ilObjTestGUI.php.

3865  {
3866  $this->ctrl->setCmd("showSummary");
3867  $this->ctrl->setCmdClass("ilinfoscreengui");
3868  $this->infoScreen();
3869  }

◆ initImportForm()

ilObjTestGUI::initImportForm (   $a_new_type)

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

References $_GET, $_POST, $options, ilSelectInputGUI\setOptions(), and ilFileInputGUI\setSuffixes().

Referenced by importFileObject().

2925  {
2926  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2927  $form = new ilPropertyFormGUI();
2928  $form->setTarget("_top");
2929  $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
2930  $this->ctrl->setParameter($this, "new_type", $new_type);
2931  $form->setFormAction($this->ctrl->getFormAction($this));
2932  $form->setTitle($this->lng->txt("import_tst"));
2933 
2934  // file
2935  include_once("./Services/Form/classes/class.ilFileInputGUI.php");
2936  $fi = new ilFileInputGUI($this->lng->txt("import_file"), "xmldoc");
2937  $fi->setSuffixes(array("zip"));
2938  $fi->setRequired(true);
2939  $form->addItem($fi);
2940 
2941  // question pool
2942  include_once("./Modules/Test/classes/class.ilObjTest.php");
2943  $tst = new ilObjTest();
2944  $questionpools = $tst->getAvailableQuestionpools(TRUE, FALSE, TRUE, TRUE);
2945  if (count($questionpools))
2946  {
2947  $options = array("-1" => $this->lng->txt("dont_use_questionpool"));
2948  foreach ($questionpools as $key => $value)
2949  {
2950  $options[$key] = $value["title"];
2951  }
2952 
2953  $pool = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "qpl");
2954  $pool->setOptions($options);
2955  $form->addItem($pool);
2956  }
2957 
2958  $form->addCommandButton("importFile", $this->lng->txt("import"));
2959  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
2960 
2961  return $form;
2962  }
$_POST['username']
Definition: cron.php:12
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.
if(!is_array($argv)) $options
setOptions($a_options)
Set Options.
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ 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 2127 of file class.ilObjTestGUI.php.

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

2128  {
2129  // get all questions to move
2130  $move_questions = $_SESSION['tst_qst_move_' . $this->object->getTestId()];
2131  if (count($_POST['q_id']) == 0)
2132  {
2133  ilUtil::sendFailure($this->lng->txt("no_target_selected_for_move"), true);
2134  $this->ctrl->redirect($this, 'questions');
2135  }
2136  if (count($_POST['q_id']) > 1)
2137  {
2138  ilUtil::sendFailure($this->lng->txt("too_many_targets_selected_for_move"), true);
2139  $this->ctrl->redirect($this, 'questions');
2140  }
2141  $insert_mode = 1;
2142  $this->object->moveQuestions($_SESSION['tst_qst_move_' . $this->object->getTestId()], $_POST['q_id'][0], $insert_mode);
2143  ilUtil::sendSuccess($this->lng->txt("msg_questions_moved"), true);
2144  unset($_SESSION['tst_qst_move_' . $this->object->getTestId()]);
2145  $this->ctrl->redirect($this, "questions");
2146  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ insertQuestionsBeforeObject()

ilObjTestGUI::insertQuestionsBeforeObject ( )

Insert checked questions before the actual selection.

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

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

2103  {
2104  // get all questions to move
2105  $move_questions = $_SESSION['tst_qst_move_' . $this->object->getTestId()];
2106 
2107  if (count($_POST['q_id']) == 0)
2108  {
2109  ilUtil::sendFailure($this->lng->txt("no_target_selected_for_move"), true);
2110  $this->ctrl->redirect($this, 'questions');
2111  }
2112  if (count($_POST['q_id']) > 1)
2113  {
2114  ilUtil::sendFailure($this->lng->txt("too_many_targets_selected_for_move"), true);
2115  $this->ctrl->redirect($this, 'questions');
2116  }
2117  $insert_mode = 0;
2118  $this->object->moveQuestions($_SESSION['tst_qst_move_' . $this->object->getTestId()], $_POST['q_id'][0], $insert_mode);
2119  ilUtil::sendSuccess($this->lng->txt("msg_questions_moved"), true);
2120  unset($_SESSION['tst_qst_move_' . $this->object->getTestId()]);
2121  $this->ctrl->redirect($this, "questions");
2122  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ insertQuestionsObject()

ilObjTestGUI::insertQuestionsObject ( )

Insert questions from the questionbrowser into the test.

public

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

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

2154  {
2155  $selected_array = (is_array($_POST['q_id'])) ? $_POST['q_id'] : array();
2156  if (!count($selected_array))
2157  {
2158  ilUtil::sendInfo($this->lng->txt("tst_insert_missing_question"), true);
2159  $this->ctrl->redirect($this, "browseForQuestions");
2160  }
2161  else
2162  {
2163  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
2164  $manscoring = FALSE;
2165  foreach ($selected_array as $key => $value)
2166  {
2167  $this->object->insertQuestion( $this->testQuestionSetConfigFactory->getQuestionSetConfig(), $value );
2168  if (!$manscoring)
2169  {
2170  $manscoring = $manscoring | assQuestion::_needsManualScoring($value);
2171  }
2172  }
2173  $this->object->saveCompleteStatus( $this->testQuestionSetConfigFactory->getQuestionSetConfig() );
2174  if ($manscoring)
2175  {
2176  ilUtil::sendInfo($this->lng->txt("manscoring_hint"), TRUE);
2177  }
2178  else
2179  {
2180  ilUtil::sendSuccess($this->lng->txt("tst_questions_inserted"), TRUE);
2181  }
2182  $this->ctrl->redirect($this, "questions");
2183  return;
2184  }
2185  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
_needsManualScoring($question_id)
+ 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 1686 of file class.ilObjTestGUI.php.

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

1687  {
1688  $selected_array = split(",", $_POST["chosen_questions"]);
1689  if (!count($selected_array))
1690  {
1691  ilUtil::sendInfo($this->lng->txt("tst_insert_missing_question"));
1692  }
1693  else
1694  {
1695  $total = $this->object->evalTotalPersons();
1696  if ($total)
1697  {
1698  // the test was executed previously
1699  ilUtil::sendInfo(sprintf($this->lng->txt("tst_insert_questions_and_results"), $total));
1700  }
1701  else
1702  {
1703  ilUtil::sendInfo($this->lng->txt("tst_insert_questions"));
1704  }
1705  foreach ($selected_array as $key => $value)
1706  {
1707  $this->object->insertQuestion( $this->testQuestionSetConfigFactory->getQuestionSetConfig(), $value );
1708  }
1709  $this->object->saveCompleteStatus( $this->testQuestionSetConfigFactory->getQuestionSetConfig() );
1710  ilUtil::sendSuccess($this->lng->txt("tst_questions_inserted"), true);
1711  $this->ctrl->redirect($this, "questions");
1712  return;
1713  }
1714  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ isDeleteDynamicTestResultsButtonRequired()

ilObjTestGUI::isDeleteDynamicTestResultsButtonRequired (   $testSession,
  $testSequence 
)
private
Parameters
$testSession
$testSequence
Returns
bool

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

Referenced by redirectToInfoScreenObject().

5530  {
5531  if( !$testSession->getActiveId() )
5532  {
5533  return false;
5534  }
5535 
5536  if( !$this->object->isDynamicTest() )
5537  {
5538  return false;
5539  }
5540 
5541  if( !$this->object->isPassDeletionAllowed() )
5542  {
5543  return false;
5544  }
5545 
5546  if( !$testSequence->hasStarted($testSession) )
5547  {
5548  return false;
5549  }
5550 
5551  return true;
5552  }
+ Here is the caller graph for this function:

◆ marksObject()

ilObjTestGUI::marksObject ( )

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

References ilUtil\getImagePath(), and ilUtil\sendInfo().

Referenced by addMarkStepObject(), addSimpleMarkSchemaObject(), deleteMarkStepsObject(), and saveMarksObject().

2634  {
2635  global $ilAccess;
2636  if (!$ilAccess->checkAccess("write", "", $this->ref_id))
2637  {
2638  // allow only write access
2639  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
2640  $this->ctrl->redirect($this, "infoScreen");
2641  }
2642 
2643  if (!$this->object->canEditMarks())
2644  {
2645  ilUtil::sendInfo($this->lng->txt("cannot_edit_marks"));
2646  }
2647 
2648  $this->object->mark_schema->sort();
2649 
2650  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_marks.html", "Modules/Test");
2651  $marks = $this->object->mark_schema->mark_steps;
2652  $rows = array("tblrow1", "tblrow2");
2653  $counter = 0;
2654  foreach ($marks as $key => $value)
2655  {
2656  $this->tpl->setCurrentBlock("markrow");
2657  $this->tpl->setVariable("MARK_SHORT", $value->getShortName());
2658  $this->tpl->setVariable("MARK_OFFICIAL", $value->getOfficialName());
2659  $this->tpl->setVariable("MARK_PERCENTAGE", sprintf("%.2f", $value->getMinimumLevel()));
2660  $this->tpl->setVariable("MARK_PASSED", strtolower($this->lng->txt("tst_mark_passed")));
2661  $this->tpl->setVariable("MARK_ID", "$key");
2662  $this->tpl->setVariable("ROW_CLASS", $rows[$counter % 2]);
2663 
2664  if( $value->getPassed() )
2665  {
2666  $this->tpl->setVariable("MARK_PASSED_CHECKED", " checked=\"checked\"");
2667  }
2668 
2669  $this->tpl->parseCurrentBlock();
2670  $counter++;
2671  }
2672  if (count($marks) == 0)
2673  {
2674  $this->tpl->setCurrentBlock("Emptyrow");
2675  $this->tpl->setVariable("EMPTY_ROW", $this->lng->txt("tst_no_marks_defined"));
2676  $this->tpl->setVariable("ROW_CLASS", $rows[$counter % 2]);
2677  $this->tpl->parseCurrentBlock();
2678  }
2679  else
2680  {
2681  if ($ilAccess->checkAccess("write", "", $this->ref_id) && $this->object->canEditMarks())
2682  {
2683  $this->tpl->setCurrentBlock("selectall");
2684  $counter++;
2685  $this->tpl->setVariable("ROW_CLASS", $rows[$counter % 2]);
2686  $this->tpl->setVariable("SELECT_ALL", $this->lng->txt("select_all"));
2687  $this->tpl->parseCurrentBlock();
2688  $this->tpl->setCurrentBlock("Footer");
2689  $this->tpl->setVariable("ARROW", "<img src=\"" . ilUtil::getImagePath("arrow_downright.png") . "\" alt=\"".$this->lng->txt("arrow_downright")."\"/>");
2690  $this->tpl->setVariable("BUTTON_EDIT", $this->lng->txt("edit"));
2691  $this->tpl->setVariable("BUTTON_DELETE", $this->lng->txt("delete"));
2692  $this->tpl->parseCurrentBlock();
2693  }
2694  }
2695 
2696  if ($this->object->getReportingDate())
2697  {
2698  $this->tpl->setCurrentBlock("ects");
2699  if ($this->object->ects_output)
2700  {
2701  $this->tpl->setVariable("CHECKED_ECTS", " checked=\"checked\"");
2702  }
2703  $this->tpl->setVariable("TEXT_OUTPUT_ECTS_GRADES", $this->lng->txt("ects_output_of_ects_grades"));
2704  $this->tpl->setVariable("TEXT_ALLOW_ECTS_GRADES", $this->lng->txt("ects_allow_ects_grades"));
2705  $this->tpl->setVariable("TEXT_USE_FX", $this->lng->txt("ects_use_fx_grade"));
2706  if (preg_match("/\d+/", $this->object->ects_fx))
2707  {
2708  $this->tpl->setVariable("CHECKED_FX", " checked=\"checked\"");
2709  $this->tpl->setVariable("VALUE_PERCENT_FX", sprintf("value=\"%s\" ", $this->object->ects_fx));
2710  }
2711  $this->tpl->setVariable("TEXT_PERCENT", $this->lng->txt("ects_use_fx_grade_part2"));
2712  $this->tpl->setVariable("ECTS_GRADE", $this->lng->txt("ects_grade"));
2713  $this->tpl->setVariable("PERCENTILE", $this->lng->txt("percentile"));
2714  $this->tpl->setVariable("ECTS_GRADE_A", "A - " . $this->lng->txt("ects_grade_a_short"));
2715  $this->tpl->setVariable("VALUE_GRADE_A", $this->object->ects_grades["A"]);
2716  $this->tpl->setVariable("ECTS_GRADE_B", "B - " . $this->lng->txt("ects_grade_b_short"));
2717  $this->tpl->setVariable("VALUE_GRADE_B", $this->object->ects_grades["B"]);
2718  $this->tpl->setVariable("ECTS_GRADE_C", "C - " . $this->lng->txt("ects_grade_c_short"));
2719  $this->tpl->setVariable("VALUE_GRADE_C", $this->object->ects_grades["C"]);
2720  $this->tpl->setVariable("ECTS_GRADE_D", "D - " . $this->lng->txt("ects_grade_d_short"));
2721  $this->tpl->setVariable("VALUE_GRADE_D", $this->object->ects_grades["D"]);
2722  $this->tpl->setVariable("ECTS_GRADE_E", "E - " . $this->lng->txt("ects_grade_e_short"));
2723  $this->tpl->setVariable("VALUE_GRADE_E", $this->object->ects_grades["E"]);
2724 
2725  $this->tpl->parseCurrentBlock();
2726  }
2727 
2728  $this->tpl->setCurrentBlock("adm_content");
2729  $this->tpl->setVariable("ACTION_MARKS", $this->ctrl->getFormAction($this));
2730  $this->tpl->setVariable("HEADER_SHORT", $this->lng->txt("tst_mark_short_form"));
2731  $this->tpl->setVariable("HEADER_OFFICIAL", $this->lng->txt("tst_mark_official_form"));
2732  $this->tpl->setVariable("HEADER_PERCENTAGE", $this->lng->txt("tst_mark_minimum_level"));
2733  $this->tpl->setVariable("HEADER_PASSED", $this->lng->txt("tst_mark_passed"));
2734  if ($ilAccess->checkAccess("write", "", $this->ref_id) && $this->object->canEditMarks())
2735  {
2736  $this->tpl->setVariable("BUTTON_NEW", $this->lng->txt("tst_mark_create_new_mark_step"));
2737  $this->tpl->setVariable("BUTTON_NEW_SIMPLE", $this->lng->txt("tst_mark_create_simple_mark_schema"));
2738  $this->tpl->setVariable("SAVE", $this->lng->txt("save"));
2739  $this->tpl->setVariable("CANCEL", $this->lng->txt("cancel"));
2740  }
2741  $this->tpl->parseCurrentBlock();
2742  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ movePageFormObject()

ilObjTestGUI::movePageFormObject ( )
protected

Move current page.

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

References $_REQUEST, $ilCtrl, ilObjectGUI\$lng, $options, ilObjectGUI\$tpl, and ilSelectInputGUI\setOptions().

5407  {
5408  global $lng, $ilCtrl, $tpl;
5409 
5410  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
5411  $form = new ilPropertyFormGUI();
5412  $form->setFormAction($ilCtrl->getFormAction($this, "movePage"));
5413  $form->setTitle($lng->txt("test_move_page"));
5414 
5415  $old_pos = new ilHiddenInputGUI("q_id");
5416  $old_pos->setValue($_REQUEST['q_id']);
5417  $form->addItem($old_pos);
5418 
5419  $questions = $this->object->getQuestionTitlesAndIndexes();
5420  if (!is_array($questions))
5421  $questions = array();
5422 
5423  foreach($questions as $k => $q) {
5424  if ($k == $_REQUEST['q_id']) {
5425  unset($questions[$k]);
5426  continue;
5427  }
5428  $questions[$k] = $lng->txt('behind') . ' '. $q;
5429  }
5430  #$questions['0'] = $lng->txt('first');
5431 
5432  $options = array(
5433  0 => $lng->txt('first')
5434  );
5435  foreach($questions as $k => $q) {
5436  $options[$k] = $q . ' ['. $this->lng->txt('question_id_short') . ': ' . $k . ']';
5437  }
5438 
5439  $pos = new ilSelectInputGUI($lng->txt("position"), "position_after");
5440  $pos->setOptions($options);
5441  $form->addItem($pos);
5442 
5443  $form->addCommandButton("movePage", $lng->txt("submit"));
5444  $form->addCommandButton("showPage", $lng->txt("cancel"));
5445 
5446  return $tpl->setContent($form->getHTML());
5447  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents a hidden form property in a property form.
if(!is_array($argv)) $options
setOptions($a_options)
Set Options.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ movePageObject()

ilObjTestGUI::movePageObject ( )

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

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

5449  {
5450  global $ilAccess;
5451  if (!$ilAccess->checkAccess("write", "", $this->ref_id))
5452  {
5453  // allow only write access
5454  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
5455  $this->ctrl->redirect($this, "infoScreen");
5456  }
5457 
5458  $this->object->moveQuestionAfter($_REQUEST['q_id'], $_REQUEST['position_after']);
5459  $this->showPageObject();
5460  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ moveQuestionsObject()

ilObjTestGUI::moveQuestionsObject ( )

Marks selected questions for moving.

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

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

2084  {
2085  $selected_questions = NULL;
2086  $selected_questions = $_POST['q_id'];
2087  if (is_array($selected_questions))
2088  {
2089  $_SESSION['tst_qst_move_' . $this->object->getTestId()] = $_POST['q_id'];
2090  ilUtil::sendSuccess($this->lng->txt("msg_selected_for_move"), true);
2091  }
2092  else
2093  {
2094  ilUtil::sendFailure($this->lng->txt('no_selection_for_move'), TRUE);
2095  }
2096  $this->ctrl->redirect($this, 'questions');
2097  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ npResetFilterObject()

ilObjTestGUI::npResetFilterObject ( )

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

References participantsObject(), and ilTable2GUI\resetFilter().

3370  {
3371  include_once("./Modules/Test/classes/tables/class.ilTestParticipantsTableGUI.php");
3372  $table_gui = new ilTestParticipantsTableGUI(
3373  $this, "participants", false, $this->object->getAnonymity(), 0
3374  );
3375  $table_gui->resetFilter(); // writes filter to session
3376  $table_gui->resetOffset(); // sets record offest to 0 (first page)
3377  $this->participantsObject();
3378 
3379  }
participantsObject()
Creates the output of the test participants.
resetFilter()
Reset filter.
+ Here is the call graph for this function:

◆ npSetFilterObject()

ilObjTestGUI::npSetFilterObject ( )

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

References participantsObject(), and ilTable2GUI\writeFilterToSession().

3358  {
3359  include_once("./Modules/Test/classes/tables/class.ilTestParticipantsTableGUI.php");
3360  $table_gui = new ilTestParticipantsTableGUI(
3361  $this, "participants", false, $this->object->getAnonymity(), 0
3362  );
3363  $table_gui->writeFilterToSession(); // writes filter to session
3364  $table_gui->resetOffset(); // sets record offest to 0 (first page)
3365  $this->participantsObject();
3366 
3367  }
participantsObject()
Creates the output of the test participants.
writeFilterToSession()
Write filter values to session.
+ Here is the call graph for this function:

◆ outEvaluationObject()

ilObjTestGUI::outEvaluationObject ( )

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

727  {
728  $this->ctrl->redirectByClass("iltestevaluationgui", "outEvaluation");
729  }

◆ participantsActionObject()

ilObjTestGUI::participantsActionObject ( )

Evaluates the actions on the participants page.

public

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

References $_POST.

2970  {
2971  $command = $_POST["command"];
2972  if (strlen($command))
2973  {
2974  $method = $command . "Object";
2975  if (method_exists($this, $method))
2976  {
2977  $this->$method();
2978  return;
2979  }
2980  }
2981  $this->ctrl->redirect($this, "participants");
2982  }
$_POST['username']
Definition: cron.php:12

◆ participantsObject()

ilObjTestGUI::participantsObject ( )

Creates the output of the test participants.

public

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

References ilObjectGUI\$data, ilObjectGUI\$lng, ilObjTestAccess\_getParticipantData(), applyFilterCriteria(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), getParticipantsSubTabs(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilTable2GUI\setFilterCommand().

Referenced by fpResetFilterObject(), fpSetFilterObject(), npResetFilterObject(), and npSetFilterObject().

2990  {
2991  global $ilAccess, $ilToolbar, $lng;
2992 
2993  $this->getParticipantsSubTabs();
2994 
2995  if (!$ilAccess->checkAccess("write", "", $this->ref_id))
2996  {
2997  // allow only write access
2998  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
2999  $this->ctrl->redirect($this, "infoScreen");
3000  }
3001 
3002  if( $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken($this->tree) )
3003  {
3005  $this->testQuestionSetConfigFactory->getQuestionSetConfig()->getDepenciesBrokenMessage($this->lng)
3006  );
3007  }
3008  elseif( $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesInVulnerableState($this->tree) )
3009  {
3011  $this->questionSetConfig->getDepenciesInVulnerableStateMessage($this->lng)
3012  );
3013  }
3014 
3015  if ($this->object->getFixedParticipants())
3016  {
3017  // search button
3018  include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
3020  $this,
3021  $tb,
3022  array(
3023  'auto_complete_name' => $lng->txt('user'),
3024  'submit_name' => $lng->txt('add')
3025  )
3026  );
3027 
3028  // search button
3029  $ilToolbar->addButton($this->lng->txt("tst_search_users"),
3030  $this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI','start'));
3031 
3032 
3033  $participants =& $this->object->getInvitedUsers();
3034  $rows = array();
3035  foreach ($participants as $data)
3036  {
3037  $maxpass = $this->object->_getMaxPass($data["active_id"]);
3038  if (!is_null($maxpass))
3039  {
3040  $maxpass += 1;
3041  }
3042  $access = "";
3043  if (strlen($data["active_id"]))
3044  {
3045  $last_access = $this->object->_getLastAccess($data["active_id"]);
3046  $access = $last_access;
3047  }
3048  $this->ctrl->setParameterByClass('iltestevaluationgui', 'active_id', $data['active_id']);
3049 
3050  if ($data['active_id'] == null) // if no active id is set, user is invitee not participant...
3051  {
3052  if ( strlen($data["firstname"].$data["lastname"]) == 0 )
3053  {
3054  $fullname = $lng->txt("deleted_user");
3055  }
3056  else if($this->object->getAnonymity())
3057  {
3058  $fullname = $lng->txt('anonymous');
3059  }
3060  else
3061  {
3062  $fullname = trim($data["lastname"] . ", " . $data["firstname"] . " " . $data["title"]);
3063  }
3064  } else {
3065  include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
3066  $fullname = ilObjTestAccess::_getParticipantData($data['active_id']);
3067  }
3068 
3069  array_push($rows, array(
3070  'usr_id' => $data["usr_id"],
3071  'active_id' => $data['active_id'],
3072  'login' => $data["login"],
3073  'clientip' => $data["clientip"],
3074  'firstname' => $data["firstname"],
3075  'lastname' => $data["lastname"],
3076  'name' => $fullname,
3077  'started' => ($data["active_id"] > 0) ? 1 : 0,
3078  'finished' => ($data["test_finished"] == 1) ? 1 : 0,
3079  'access' => $access,
3080  'maxpass' => $maxpass,
3081  'result' => $this->ctrl->getLinkTargetByClass('iltestevaluationgui', 'outParticipantsResultsOverview')
3082  ));
3083  }
3084  include_once "./Modules/Test/classes/tables/class.ilTestFixedParticipantsTableGUI.php";
3085  $table_gui = new ilTestFixedParticipantsTableGUI( $this, 'participants',
3086  $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken(),
3087  $this->object->getAnonymity(), count($rows)
3088  );
3089  $table_gui->setFilterCommand('fpSetFilter');
3090  $table_gui->setResetCommand('fpResetFiler');
3091  $rows = $this->applyFilterCriteria($rows);
3092  $table_gui->setData($rows);
3093  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
3094  }
3095  else
3096  {
3097  $participants =& $this->object->getTestParticipants();
3098  $rows = array();
3099  foreach ($participants as $data)
3100  {
3101  $maxpass = $this->object->_getMaxPass($data["active_id"]);
3102  if (!is_null($maxpass))
3103  {
3104  $maxpass += 1;
3105  }
3106  $access = "";
3107  if (strlen($data["active_id"]))
3108  {
3109  $last_access = $this->object->_getLastAccess($data["active_id"]);
3110  $access = $last_access;
3111  }
3112  $this->ctrl->setParameterByClass('iltestevaluationgui', 'active_id', $data['active_id']);
3113 
3114  include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
3115  $fullname = ilObjTestAccess::_getParticipantData($data['active_id']);
3116  array_push($rows, array(
3117  'usr_id' => $data["active_id"],
3118  'active_id' => $data['active_id'],
3119  'login' => $data["login"],
3120  'name' => $fullname,
3121  'firstname' => $data["firstname"],
3122  'lastname' => $data["lastname"],
3123  'started' => ($data["active_id"] > 0) ? 1 : 0,
3124  'finished' => ($data["test_finished"] == 1) ? 1 : 0,
3125  'access' => $access,
3126  'maxpass' => $maxpass,
3127  'result' => $this->ctrl->getLinkTargetByClass('iltestevaluationgui', 'outParticipantsResultsOverview')
3128  ));
3129  }
3130  include_once "./Modules/Test/classes/tables/class.ilTestParticipantsTableGUI.php";
3131  $table_gui = new ilTestParticipantsTableGUI( $this, 'participants',
3132  $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken(),
3133  $this->object->getAnonymity(), count($rows)
3134  );
3135  $table_gui->setFilterCommand('npSetFilter');
3136  $table_gui->setResetCommand('npResetFilter');
3137  $rows = $this->applyFilterCriteria($rows);
3138  $table_gui->setData($rows);
3139  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
3140  }
3141  }
setFilterCommand($a_val)
Set filter command.
applyFilterCriteria($in_rows)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
_getParticipantData($active_id)
Retrieves a participant name from active id.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array())
fill toolbar with
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateDeleteDynamicTestResultsButton()

ilObjTestGUI::populateDeleteDynamicTestResultsButton (   $testSession,
$big_button 
)
private
Parameters
$testSession
$big_button

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

References ilTestPassDeletionConfirmationGUI\CONTEXT_INFO_SCREEN.

Referenced by redirectToInfoScreenObject().

5559  {
5560  require_once 'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
5561 
5562  $this->ctrl->setParameterByClass(
5563  'iltestevaluationgui', 'context',
5565  );
5566 
5567  $this->ctrl->setParameterByClass('iltestevaluationgui', 'active_id', $testSession->getActiveId());
5568  $this->ctrl->setParameterByClass('iltestevaluationgui', 'pass', $testSession->getPass());
5569 
5570  $big_button[] = array(
5571  '',
5572  $this->lng->txt("tst_delete_dyn_test_results_btn"),
5573  false,
5574  $this->ctrl->getLinkTargetByClass('iltestevaluationgui', 'confirmDeletePass')
5575  );
5576  }
+ Here is the caller graph for this function:

◆ populateHiddenField()

ilObjTestGUI::populateHiddenField (   $value,
  $key,
  $path = '' 
)
Parameters
$value
$key
string$path

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

References $path.

Referenced by confirmScoringObject().

1094  {
1095  if (is_array( $value ))
1096  {
1097  foreach ($value as $k => $v)
1098  {
1099  if (is_array($v))
1100  {
1101  $this->populateHiddenField($v, $key, $path .'['.$k.']');
1102  }
1103  else
1104  {
1105  $this->tpl->setCurrentBlock( "hidden_variable" );
1106  $this->tpl->setVariable( "HIDDEN_KEY", $key . $path . "[" . $k . "]" );
1107  $this->tpl->setVariable( "HIDDEN_VALUE", $v );
1108  $this->tpl->parseCurrentBlock();
1109  }
1110  }
1111  }
1112  else
1113  {
1114  $this->tpl->setCurrentBlock( "hidden_variable" );
1115  $this->tpl->setVariable( "HIDDEN_KEY", $key );
1116  $this->tpl->setVariable( "HIDDEN_VALUE", $value );
1117  $this->tpl->parseCurrentBlock();
1118  }
1119  }
populateHiddenField($value, $key, $path='')
$path
Definition: index.php:22
+ 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 697 of file class.ilObjTestGUI.php.

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

Referenced by executeCommand().

698  {
699  global $ilUser;
700 
701  $this->tpl->getStandardTemplate();
702 
703  // set locator
704  $this->setLocator();
705 
706  // catch feedback message
708 
709  // set title and description and title icon
710  $this->setTitleAndDescription();
711 
712  // BEGIN WebDAV: Display Mount Webfolder icon.
713  require_once 'Services/WebDAV/classes/class.ilDAVServer.php';
714  if (ilDAVServer::_isActive() && $ilUser->getId() != ANONYMOUS_USER_ID)
715  {
716  $this->showMountWebfolderIcon();
717  }
718  // END WebDAV: Display Mount Webfolder icon.
719  }
static _isActive()
Static getter.
static infoPanel($a_keep=true)
setTitleAndDescription()
called by prepare output
global $ilUser
Definition: imgupload.php:15
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 3488 of file class.ilObjTestGUI.php.

References $_GET, ilObjectGUI\$ilias, $ilUser, ilTestPDFGenerator\generatePDF(), ilUtil\getHtmlPath(), ilUtil\getImagePath(), getQuestionsSubTabs(), ilUtil\getStyleSheetLocation(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, ilUtil\prepareFormOutput(), and ilUtil\sendInfo().

3489  {
3490  global $ilAccess, $ilias;
3491  if (!$ilAccess->checkAccess("write", "", $this->ref_id))
3492  {
3493  // allow only write access
3494  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
3495  $this->ctrl->redirect($this, "infoScreen");
3496  }
3497  $this->getQuestionsSubTabs();
3498  $template = new ilTemplate("tpl.il_as_tst_print_test_confirm.html", TRUE, TRUE, "Modules/Test");
3499 
3500  if(!array_key_exists("pdf", $_GET) || $_GET["pdf"] != 1) // #15243
3501  {
3502  $this->ctrl->setParameter($this, "pdf", "1");
3503  $template->setCurrentBlock("pdf_export");
3504  $template->setVariable("PDF_URL", $this->ctrl->getLinkTarget($this, "print"));
3505  $this->ctrl->setParameter($this, "pdf", "");
3506  $template->setVariable("PDF_TEXT", $this->lng->txt("pdf_export"));
3507  $template->setVariable("PDF_IMG_ALT", $this->lng->txt("pdf_export"));
3508  $template->setVariable("PDF_IMG_URL", ilUtil::getHtmlPath(ilUtil::getImagePath("application-pdf.png")));
3509  $template->parseCurrentBlock();
3510 
3511  $template->setCurrentBlock("navigation_buttons");
3512  $template->setVariable("BUTTON_PRINT", $this->lng->txt("print"));
3513  $template->parseCurrentBlock();
3514  }
3515 
3516  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
3517 
3518  global $ilUser;
3519  $print_date = mktime(date("H"), date("i"), date("s"), date("m") , date("d"), date("Y"));
3520  $max_points= 0;
3521  $counter = 1;
3522 
3523  foreach ($this->object->questions as $question)
3524  {
3525  $template->setCurrentBlock("question");
3526  $question_gui = $this->object->createQuestionGUI("", $question);
3527  $template->setVariable("COUNTER_QUESTION", $counter.".");
3528  $template->setVariable("TXT_QUESTION_ID", $this->lng->txt('question_id_short'));
3529  $template->setVariable("QUESTION_ID", $question_gui->object->getId());
3530  $template->setVariable("QUESTION_TITLE", ilUtil::prepareFormOutput($question_gui->object->getTitle()));
3531  if ($question_gui->object->getMaximumPoints() == 1)
3532  {
3533  $template->setVariable("QUESTION_POINTS", $question_gui->object->getMaximumPoints() . " " . $this->lng->txt("point"));
3534  }
3535  else
3536  {
3537  $template->setVariable("QUESTION_POINTS", $question_gui->object->getMaximumPoints() . " " . $this->lng->txt("points"));
3538  }
3539  $result_output = $question_gui->getSolutionOutput("", NULL, FALSE, TRUE, FALSE, $this->object->getShowSolutionFeedback());
3540  if (strlen($result_output) == 0) $result_output = $question_gui->getPreview(FALSE);
3541  $template->setVariable("SOLUTION_OUTPUT", $result_output);
3542  $template->parseCurrentBlock("question");
3543  $counter ++;
3544  $max_points += $question_gui->object->getMaximumPoints();
3545  }
3546 
3547  $template->setVariable("TITLE", ilUtil::prepareFormOutput($this->object->getTitle()));
3548  $template->setVariable("PRINT_TEST", ilUtil::prepareFormOutput($this->lng->txt("tst_print")));
3549  $template->setVariable("TXT_PRINT_DATE", ilUtil::prepareFormOutput($this->lng->txt("date")));
3550  $template->setVariable("VALUE_PRINT_DATE", ilUtil::prepareFormOutput(strftime("%c",$print_date)));
3551  $template->setVariable("TXT_MAXIMUM_POINTS", ilUtil::prepareFormOutput($this->lng->txt("tst_maximum_points")));
3552  $template->setVariable("VALUE_MAXIMUM_POINTS", ilUtil::prepareFormOutput($max_points));
3553 
3554  if (array_key_exists("pdf", $_GET) && ($_GET["pdf"] == 1))
3555  {
3556  //$this->object->deliverPDFfromHTML($template->get(), $this->object->getTitle());
3557  require_once 'class.ilTestPDFGenerator.php';
3558  ilTestPDFGenerator::generatePDF($template->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitle());
3559  }
3560  else
3561  {
3562  $this->tpl->setVariable("PRINT_CONTENT", $template->get());
3563  }
3564  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
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.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
static getHtmlPath($relative_path)
get url of path
global $ilUser
Definition: imgupload.php:15
static generatePDF($pdf_output, $output_mode, $filename=null)
+ Here is the call graph for this function:

◆ questionBrowser()

ilObjTestGUI::questionBrowser ( )

Creates a form to select questions from questionpools to insert the questions into the test.

public

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

References ilObjectGUI\$data.

Referenced by browseForQuestionsObject(), executeCommand(), filterObject(), and resetFilterObject().

2209  {
2210  global $ilAccess;
2211 
2212  $this->ctrl->setParameterByClass(get_class($this), "browse", "1");
2213 
2214  include_once "./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
2215  $table_gui = new ilTestQuestionBrowserTableGUI($this, 'browseForQuestions', (($ilAccess->checkAccess("write", "", $this->ref_id) ? true : false)));
2216  $arrFilter = array();
2217  foreach ($table_gui->getFilterItems() as $item)
2218  {
2219  if ($item->getValue() !== false)
2220  {
2221  $arrFilter[$item->getPostVar()] = $item->getValue();
2222  }
2223  }
2224  $data = $this->object->getAvailableQuestions($arrFilter, 1);
2225  $table_gui->setData($data);
2226  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
2227  }
+ Here is the caller graph for this function:

◆ questionsObject()

ilObjTestGUI::questionsObject ( )

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

References $_GET, $_SESSION, ilObjectGUI\$data, $ilCtrl, $ilUser, ilObjectGUI\$lng, $total, ilObjTestAccess\_lookupOnlineTestAccess(), getQuestionsSubTabs(), ilUtil\redirect(), and ilUtil\sendInfo().

Referenced by executeCommand().

2337  {
2338  global $ilAccess, $ilTabs;
2339 
2340  $ilTabs->activateTab('assQuestions');
2341 
2342  // #12590
2343  $this->ctrl->setParameter($this, 'test_express_mode', '');
2344 
2345  if (!$ilAccess->checkAccess("write", "", $this->ref_id))
2346  {
2347  // allow only write access
2348  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
2349  $this->ctrl->redirect($this, "infoScreen");
2350  }
2351 
2352  if ($_GET['browse'])
2353  {
2354  return $this->questionbrowser();
2355  }
2356 
2357  $this->getQuestionsSubTabs();
2358 
2359  // #11631, #12994
2360  $this->ctrl->setParameter($this, 'q_id', '');
2361 
2362  if ($_GET["eqid"] && $_GET["eqpl"])
2363  {
2364  ilUtil::redirect("ilias.php?baseClass=ilObjQuestionPoolGUI&ref_id=" . $_GET["eqpl"] . "&cmd=editQuestionForTest&calling_test=".$_GET["ref_id"]."&q_id=" . $_GET["eqid"]);
2365  }
2366 
2367  if ($_GET["up"] > 0)
2368  {
2369  $this->object->questionMoveUp($_GET["up"]);
2370  }
2371  if ($_GET["down"] > 0)
2372  {
2373  $this->object->questionMoveDown($_GET["down"]);
2374  }
2375 
2376  if ($_GET["add"])
2377  {
2378  $selected_array = array();
2379  array_push($selected_array, $_GET["add"]);
2380  $total = $this->object->evalTotalPersons();
2381  if ($total)
2382  {
2383  // the test was executed previously
2384  ilUtil::sendInfo(sprintf($this->lng->txt("tst_insert_questions_and_results"), $total));
2385  }
2386  else
2387  {
2388  ilUtil::sendInfo($this->lng->txt("tst_insert_questions"));
2389  }
2390  $this->insertQuestions($selected_array);
2391  return;
2392  }
2393 
2394  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_questions.html", "Modules/Test");
2395 
2396  $total = $this->object->evalTotalPersons();
2397  if ($ilAccess->checkAccess("write", "", $this->ref_id))
2398  {
2399  if($total != 0)
2400  {
2401  $link = $this->ctrl->getLinkTarget($this, "participants");
2402  $link = "<a href=\"".$link."\">".$this->lng->txt("test_has_datasets_warning_page_view_link")."</a>";
2403  ilUtil::sendInfo($this->lng->txt("test_has_datasets_warning_page_view")." ".$link);
2404  }
2405  else {
2406  global $ilToolbar;
2407 
2408  $ilToolbar->addButton($this->lng->txt("ass_create_question"), $this->ctrl->getLinkTarget($this, "addQuestion"));
2409 
2410  if ($this->object->getPoolUsage()) {
2411  $ilToolbar->addSeparator();
2412  $ilToolbar->addButton($this->lng->txt("tst_browse_for_questions"), $this->ctrl->getLinkTarget($this, 'browseForQuestions'));
2413  }
2414 
2415  $ilToolbar->addSeparator();
2416  $ilToolbar->addButton($this->lng->txt("random_selection"), $this->ctrl->getLinkTarget($this, "randomselect"));
2417 
2418 
2419  global $ilAccess, $ilUser, $lng, $ilCtrl;
2420  $online_access = false;
2421  if ($this->object->getFixedParticipants())
2422  {
2423  include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
2424  $online_access_result = ilObjTestAccess::_lookupOnlineTestAccess($this->object->getId(), $ilUser->getId());
2425  if ($online_access_result === true)
2426  {
2427  $online_access = true;
2428  }
2429  }
2430 
2431  if( $this->object->isOnline() && $this->object->isComplete( $this->testQuestionSetConfigFactory->getQuestionSetConfig() ) )
2432  {
2433  if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id))
2434  {
2435  $testSession = $this->testSessionFactory->getSession();
2436 
2437  $executable = $this->object->isExecutable($testSession, $ilUser->getId(), $allowPassIncrease = TRUE);
2438 
2439  if ($executable["executable"])
2440  {
2441  if ($testSession->getActiveId() > 0)
2442  {
2443  $ilToolbar->addSeparator();
2444  $ilToolbar->addButton($lng->txt('tst_resume_test'), $ilCtrl->getLinkTargetByClass('iltestoutputgui', 'resume'));
2445  }
2446  else
2447  {
2448  $ilToolbar->addSeparator();
2449  $ilToolbar->addButton($lng->txt('tst_start_test'), $ilCtrl->getLinkTargetByClass('iltestoutputgui', 'startTest'));
2450  }
2451  }
2452  }
2453  }
2454 
2455 
2456  }
2457  }
2458 
2459  $this->tpl->setCurrentBlock("adm_content");
2460  include_once "./Modules/Test/classes/tables/class.ilTestQuestionsTableGUI.php";
2461  $checked_move = is_array($_SESSION['tst_qst_move_' . $this->object->getTestId()]) && (count($_SESSION['tst_qst_move_' . $this->object->getTestId()]));
2462  $table_gui = new ilTestQuestionsTableGUI($this, 'questions', (($ilAccess->checkAccess("write", "", $this->ref_id) ? true : false)), $checked_move, $total);
2463  $data = $this->object->getTestQuestions();
2464  $table_gui->setData($data);
2465  $this->tpl->setVariable('QUESTIONBROWSER', $table_gui->getHTML());
2466  $this->tpl->setVariable("ACTION_QUESTION_FORM", $this->ctrl->getFormAction($this));
2467  $this->tpl->parseCurrentBlock();
2468  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
_lookupOnlineTestAccess($a_test_id, $a_user_id)
Checks if a user is allowd to run an online exam.
global $ilUser
Definition: imgupload.php:15
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ questionsTabGatewayObject()

ilObjTestGUI::questionsTabGatewayObject ( )
private

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

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

620  {
621  switch( $this->object->getQuestionSetType() )
622  {
624  $this->ctrl->redirectByClass('ilTestExpressPageObjectGUI', 'showPage');
625 
627  $this->ctrl->redirectByClass('ilTestRandomQuestionSetConfigGUI');
628 
630  $this->ctrl->redirectByClass('ilObjTestDynamicQuestionSetConfigGUI');
631  }
632  }
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 1579 of file class.ilObjTestGUI.php.

References $_POST, $ilUser, and getQuestionsSubTabs().

1580  {
1581  global $ilUser;
1582  $this->getQuestionsSubTabs();
1583  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_random_select.html", "Modules/Test");
1584  $questionpools =& $this->object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE);
1585  $this->tpl->setCurrentBlock("option");
1586  $this->tpl->setVariable("VALUE_OPTION", "0");
1587  $this->tpl->setVariable("TEXT_OPTION", $this->lng->txt("all_available_question_pools"));
1588  $this->tpl->parseCurrentBlock();
1589  foreach ($questionpools as $key => $value)
1590  {
1591  $this->tpl->setCurrentBlock("option");
1592  $this->tpl->setVariable("VALUE_OPTION", $key);
1593  $this->tpl->setVariable("TEXT_OPTION", $value["title"]);
1594  $this->tpl->parseCurrentBlock();
1595  }
1596  $this->tpl->setCurrentBlock("hidden");
1597  $this->tpl->setVariable("HIDDEN_NAME", "sel_question_types");
1598  $this->tpl->setVariable("HIDDEN_VALUE", $_POST["sel_question_types"]);
1599  $this->tpl->parseCurrentBlock();
1600  $this->tpl->setCurrentBlock("adm_content");
1601  $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
1602  $this->tpl->setVariable("TXT_QPL_SELECT", $this->lng->txt("tst_random_select_questionpool"));
1603  $this->tpl->setVariable("TXT_NR_OF_QUESTIONS", $this->lng->txt("tst_random_nr_of_questions"));
1604  $this->tpl->setVariable("BTN_SUBMIT", $this->lng->txt("submit"));
1605  $this->tpl->setVariable("BTN_CANCEL", $this->lng->txt("cancel"));
1606  $this->tpl->parseCurrentBlock();
1607  }
$_POST['username']
Definition: cron.php:12
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ redirectTo_ilObjTestSettingsGeneralGUI_showForm_Object()

ilObjTestGUI::redirectTo_ilObjTestSettingsGeneralGUI_showForm_Object ( )
private

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

References ilObjTestSettingsGeneralGUI\CMD_SHOW_FORM.

684  {
685  require_once 'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
686  $this->ctrl->redirectByClass('ilObjTestSettingsGeneralGUI', ilObjTestSettingsGeneralGUI::CMD_SHOW_FORM);
687  }

◆ redirectToInfoScreenObject()

ilObjTestGUI::redirectToInfoScreenObject ( )

◆ removeParticipantObject()

ilObjTestGUI::removeParticipantObject ( )

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

References $_POST, and ilUtil\sendInfo().

3450  {
3451  if (is_array($_POST["chbUser"]))
3452  {
3453  foreach ($_POST["chbUser"] as $user_id)
3454  {
3455  $this->object->disinviteUser($user_id);
3456  }
3457  }
3458  else
3459  {
3460  ilUtil::sendInfo($this->lng->txt("select_one_user"), true);
3461  }
3462  $this->ctrl->redirect($this, "participants");
3463  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ 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 1999 of file class.ilObjTestGUI.php.

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

Referenced by removeQuestionsObject().

2000  {
2001  $total = $this->object->evalTotalPersons();
2002  if ($total)
2003  {
2004  // the test was executed previously
2005  $question = sprintf($this->lng->txt("tst_remove_questions_and_results"), $total);
2006  }
2007  else
2008  {
2009  if (count($checked_questions) == 1)
2010  {
2011  $question = $this->lng->txt("tst_remove_question");
2012  }
2013  else
2014  {
2015  $question = $this->lng->txt("tst_remove_questions");
2016  }
2017  }
2018 
2019  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2020  $cgui = new ilConfirmationGUI();
2021  $cgui->setHeaderText($question);
2022 
2023  $this->ctrl->saveParameter($this, 'test_express_mode');
2024  $this->ctrl->saveParameter($this, 'q_id');
2025 
2026  $cgui->setFormAction($this->ctrl->getFormAction($this));
2027  $cgui->setCancel($this->lng->txt("cancel"), "cancelRemoveQuestions");
2028  $cgui->setConfirm($this->lng->txt("confirm"), "confirmRemoveQuestions");
2029 
2030  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
2031  $removablequestions =& $this->object->getTestQuestions();
2032  if (count($removablequestions))
2033  {
2034  foreach ($removablequestions as $data)
2035  {
2036  if (in_array($data["question_id"], $checked_questions))
2037  {
2038  $txt = $data["title"]." (".assQuestion::_getQuestionTypeName($data["type_tag"]).")";
2039  $txt .= ' ['. $this->lng->txt('question_id_short') . ': ' . $data['question_id'] . ']';
2040 
2041  if($data["description"])
2042  {
2043  $txt .= "<div class=\"small\">".$data["description"]."</div>";
2044  }
2045 
2046  $cgui->addItem("q_id[]", $data["question_id"], $txt);
2047  }
2048  }
2049  }
2050 
2051  $this->tpl->setContent($cgui->getHTML());
2052  }
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
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.

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

public

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

References $_REQUEST, getQuestionsSubTabs(), removeQuestionsForm(), and ilUtil\sendFailure().

2062  {
2063  $this->getQuestionsSubTabs();
2064  $checked_questions = $_REQUEST["q_id"];
2065  if (!is_array($checked_questions) && $checked_questions) {
2066  $checked_questions = array($checked_questions);
2067  }
2068  if (count($checked_questions) > 0)
2069  {
2070  $this->removeQuestionsForm($checked_questions);
2071  return;
2072  }
2073  elseif (count($checked_questions) == 0)
2074  {
2075  ilUtil::sendFailure($this->lng->txt("tst_no_question_selected_for_removal"), true);
2076  $this->ctrl->redirect($this, "questions");
2077  }
2078  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
removeQuestionsForm($checked_questions)
Displays a form to confirm the removal of questions from the test.
+ Here is the call graph for this function:

◆ resetfilterAvailableQuestionsObject()

ilObjTestGUI::resetfilterAvailableQuestionsObject ( )

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

2196  {
2197  include_once "./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
2198  $table_gui = new ilTestQuestionBrowserTableGUI($this, 'browseForQuestions');
2199  $table_gui->resetFilter();
2200  $this->ctrl->redirect($this, "browseForQuestions");
2201  }

◆ resetFilterObject()

ilObjTestGUI::resetFilterObject ( )

Resets the filter for the question browser.

Resets the filter for the question browser

public

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

References questionBrowser().

1534  {
1535  $this->questionBrowser();
1536  }
questionBrowser()
Creates a form to select questions from questionpools to insert the questions into the test...
+ Here is the call graph for this function:

◆ runObject()

ilObjTestGUI::runObject ( )

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

722  {
723  $this->ctrl->redirect($this, "infoScreen");
724  }

◆ saveClientIPObject()

ilObjTestGUI::saveClientIPObject ( )

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

References $_POST, and ilUtil\sendInfo().

3466  {
3467  if (is_array($_POST["chbUser"]))
3468  {
3469  foreach ($_POST["chbUser"] as $user_id)
3470  {
3471  $this->object->setClientIP($user_id, $_POST["clientip_".$user_id]);
3472  }
3473  }
3474  else
3475  {
3476  ilUtil::sendInfo($this->lng->txt("select_one_user"), true);
3477  }
3478  $this->ctrl->redirect($this, "participants");
3479  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ saveMarkSchemaFormData()

ilObjTestGUI::saveMarkSchemaFormData ( )

Save the mark schema POST data when the form was submitted.

Save the mark schema POST data when the form was submitted

public

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

References $_POST, and ilUtil\stripSlashes().

Referenced by addMarkStepObject(), deleteMarkStepsObject(), and saveMarksObject().

2495  {
2496  $this->object->mark_schema->flush();
2497  foreach ($_POST as $key => $value) {
2498  if (preg_match("/mark_short_(\d+)/", $key, $matches))
2499  {
2500  $this->object->mark_schema->addMarkStep(ilUtil::stripSlashes($_POST["mark_short_$matches[1]"]), ilUtil::stripSlashes($_POST["mark_official_$matches[1]"]), ilUtil::stripSlashes($_POST["mark_percentage_$matches[1]"]), ilUtil::stripSlashes($_POST["passed_$matches[1]"]));
2501  }
2502  }
2503  $this->object->ects_grades["A"] = $_POST["ects_grade_a"];
2504  $this->object->ects_grades["B"] = $_POST["ects_grade_b"];
2505  $this->object->ects_grades["C"] = $_POST["ects_grade_c"];
2506  $this->object->ects_grades["D"] = $_POST["ects_grade_d"];
2507  $this->object->ects_grades["E"] = $_POST["ects_grade_e"];
2508  if ($_POST["chbUseFX"])
2509  {
2510  $this->object->ects_fx = $_POST["percentFX"];
2511  }
2512  else
2513  {
2514  $this->object->ects_fx = "";
2515  }
2516  $this->object->ects_output = $_POST["chbECTS"];
2517  }
$_POST['username']
Definition: cron.php:12
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveMarksObject()

ilObjTestGUI::saveMarksObject ( )

Save the mark schema.

Save the mark schema

public

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

References $_POST, marksObject(), saveMarkSchemaFormData(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

2576  {
2577  try
2578  {
2579  $this->saveMarkSchemaFormData();
2580  $mark_check = $this->object->checkMarks();
2581  }
2582  catch (Exception $ex)
2583  {
2584  $mark_check = $this->lng->txt('mark_schema_invalid');
2585  }
2586 
2587  if ($mark_check !== true)
2588  {
2589  ilUtil::sendFailure($this->lng->txt($mark_check));
2590  }
2591  elseif ($_POST["chbECTS"] && ((strcmp($_POST["ects_grade_a"], "") == 0) or (strcmp($_POST["ects_grade_b"], "") == 0) or (strcmp($_POST["ects_grade_c"], "") == 0) or (strcmp($_POST["ects_grade_d"], "") == 0) or (strcmp($_POST["ects_grade_e"], "") == 0)))
2592  {
2593  ilUtil::sendInfo($this->lng->txt("ects_fill_out_all_values"), true);
2594  }
2595  elseif (($_POST["ects_grade_a"] > 100) or ($_POST["ects_grade_a"] < 0))
2596  {
2597  ilUtil::sendInfo($this->lng->txt("ects_range_error_a"), true);
2598  }
2599  elseif (($_POST["ects_grade_b"] > 100) or ($_POST["ects_grade_b"] < 0))
2600  {
2601  ilUtil::sendInfo($this->lng->txt("ects_range_error_b"), true);
2602  }
2603  elseif (($_POST["ects_grade_c"] > 100) or ($_POST["ects_grade_c"] < 0))
2604  {
2605  ilUtil::sendInfo($this->lng->txt("ects_range_error_c"), true);
2606  }
2607  elseif (($_POST["ects_grade_d"] > 100) or ($_POST["ects_grade_d"] < 0))
2608  {
2609  ilUtil::sendInfo($this->lng->txt("ects_range_error_d"), true);
2610  }
2611  elseif (($_POST["ects_grade_e"] > 100) or ($_POST["ects_grade_e"] < 0))
2612  {
2613  ilUtil::sendInfo($this->lng->txt("ects_range_error_e"), true);
2614  }
2615  else
2616  {
2617  $this->object->mark_schema->saveToDb($this->object->getTestId());
2618  $this->object->saveCompleteStatus( $this->testQuestionSetConfigFactory->getQuestionSetConfig() );
2619  if ($this->object->getReportingDate())
2620  {
2621  $fxpercent = "";
2622  if ($_POST["chbUseFX"])
2623  {
2624  $fxpercent = ilUtil::stripSlashes($_POST["percentFX"]);
2625  }
2626  $this->object->saveECTSStatus($_POST["chbECTS"], $fxpercent, ilUtil::stripSlashes($this->object->ects_grades["A"]), ilUtil::stripSlashes($this->object->ects_grades["B"]), ilUtil::stripSlashes($this->object->ects_grades["C"]), ilUtil::stripSlashes($this->object->ects_grades["D"]), ilUtil::stripSlashes($this->object->ects_grades["E"]));
2627  }
2628  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
2629  }
2630  $this->marksObject();
2631  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
saveMarkSchemaFormData()
Save the mark schema POST data when the form was submitted.
+ Here is the call graph for this function:

◆ saveOrderAndObligationsObject()

ilObjTestGUI::saveOrderAndObligationsObject ( )

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

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

5363  {
5364  global $ilAccess;
5365  if (!$ilAccess->checkAccess("write", "", $this->ref_id))
5366  {
5367  // allow only write access
5368  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
5369  $this->ctrl->redirect($this, "infoScreen");
5370  }
5371 
5372  global $ilCtrl;
5373 
5374  $orders = $obligations = array();
5375 
5376  foreach($_REQUEST['order'] as $qId => $order)
5377  {
5378  $id = (int)str_replace('q_', '', $qId);
5379 
5380  $orders[$id] = $order;
5381  }
5382 
5383  if( $this->object->areObligationsEnabled() && isset($_REQUEST['obligatory']) && is_array($_REQUEST['obligatory']) )
5384  {
5385  foreach($_REQUEST['obligatory'] as $qId => $obligation)
5386  {
5387  $id = (int)str_replace('q_', '', $qId);
5388 
5390  {
5391  $obligations[$id] = $obligation;
5392  }
5393  }
5394  }
5395 
5396  $this->object->setQuestionOrderAndObligations(
5397  $orders, $obligations
5398  );
5399 
5400  $ilCtrl->redirect($this, 'questions');
5401  }
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
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ saveScoringObject()

ilObjTestGUI::saveScoringObject ( )

Save the form input of the scoring form.

public

I introduced a single setter for instant_feedback options

Author
jposselt at databay . de

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

References $_POST, $total, REPORT_AFTER_DATE, scoringObject(), and ilUtil\sendSuccess().

1127  {
1128  if(isset($_POST['reporting_ts']))
1129  {
1130  $_POST['reporting_date']['date']['y'] = date('Y', $_POST['reporting_ts'] );
1131  $_POST['reporting_date']['date']['m'] = date('m', $_POST['reporting_ts'] );
1132  $_POST['reporting_date']['date']['d'] = date('d', $_POST['reporting_ts'] );
1133  $_POST['reporting_date']['time']['h'] = date('H', $_POST['reporting_ts'] );
1134  $_POST['reporting_date']['time']['m'] = date('i', $_POST['reporting_ts'] );
1135  }
1136 
1137  $hasErrors = $this->scoringObject(true);
1138  if (!$hasErrors)
1139  {
1140  $total = $this->object->evalTotalPersons();
1141 
1142  $this->object->setCountSystem($_POST["count_system"]);
1143  $this->object->setMCScoring($_POST["mc_scoring"]);
1144  $this->object->setScoreCutting($_POST["score_cutting"]);
1145  $this->object->setPassScoring($_POST["pass_scoring"]);
1146 
1147  if(!isset($_POST['disabled_field']))
1148  {
1149  if( isset($_POST['obligations_enabled']) && $_POST['obligations_enabled'] )
1150  {
1151  $this->object->setObligationsEnabled(true);
1152  }
1153  else
1154  {
1155  $this->object->setObligationsEnabled(false);
1156  }
1157 
1158  if( isset($_POST['offer_hints']) && $_POST['offer_hints'] )
1159  {
1160  $this->object->setOfferingQuestionHintsEnabled(true);
1161  }
1162  else
1163  {
1164  $this->object->setOfferingQuestionHintsEnabled(false);
1165  }
1166  }
1167  /*
1168  $this->object->setAnswerFeedback((is_array($_POST['instant_feedback']) && in_array('instant_feedback_answer', $_POST['instant_feedback'])) ? 1 : 0);
1169  $this->object->setAnswerFeedbackPoints((is_array($_POST['instant_feedback']) && in_array('instant_feedback_points', $_POST['instant_feedback'])) ? 1 : 0);
1170  $this->object->setInstantFeedbackSolution((is_array($_POST['instant_feedback']) && in_array('instant_feedback_solution', $_POST['instant_feedback'])) ? 1 : 0);
1171  */
1172 
1177  $this->object->setScoringFeedbackOptionsByArray($_POST['instant_feedback']);
1178 
1179 
1180  $this->object->setScoreReporting($_POST["results_access"]);
1181  if ($this->object->getScoreReporting() == REPORT_AFTER_DATE)
1182  {
1183  // The reporting date is given in database TIMESTAMP notation (yyyymmddhhmmss).
1184  $this->object->setReportingDate(str_replace(array(':', '-'), '', $_POST["reporting_date"]['date'].$_POST["reporting_date"]['time']));
1185  //$this->object->setReportingDate( date('YmdHis', $_POST['reporting_ts'] ));
1186  }
1187  else
1188  {
1189  $this->object->setReportingDate('');
1190  }
1191 
1192  $this->object->setShowPassDetails((is_array($_POST['results_presentation']) && in_array('pass_details', $_POST['results_presentation'])) ? 1 : 0);
1193  $this->object->setShowSolutionDetails((is_array($_POST['results_presentation']) && in_array('solution_details', $_POST['results_presentation'])) ? 1 : 0);
1194  $this->object->setShowSolutionPrintview((is_array($_POST['results_presentation']) && in_array('solution_printview', $_POST['results_presentation'])) ? 1 : 0);
1195  $this->object->setShowSolutionFeedback((is_array($_POST['results_presentation']) && in_array('solution_feedback', $_POST['results_presentation'])) ? 1 : 0);
1196  $this->object->setShowSolutionAnswersOnly((is_array($_POST['results_presentation']) && in_array('solution_answers_only', $_POST['results_presentation'])) ? 1 : 0);
1197  $this->object->setShowSolutionSignature((is_array($_POST['results_presentation']) && in_array('solution_signature', $_POST['results_presentation'])) ? 1 : 0);
1198  $this->object->setShowSolutionSuggested((is_array($_POST['results_presentation']) && in_array('solution_suggested', $_POST['results_presentation'])) ? 1 : 0);
1199  $this->object->setShowSolutionListComparison(isset($_POST['solution_compare']) && $_POST['solution_compare']);
1200  $this->object->setExportSettingsSingleChoiceShort((is_array($_POST['export_settings']) && in_array('exp_sc_short', $_POST['export_settings'])) ? 1 : 0);
1201 
1202  $this->object->setShowExamIdInTestResultsEnabled(isset($_POST['examid_in_test_res']) && $_POST['examid_in_test_res']);
1203 
1204  $this->object->setPrintBestSolutionWithResult((int) $_POST['print_bs_with_res'] ? true : false);
1205 
1206  $this->object->setPassDeletionAllowed((bool)$_POST['pass_deletion_allowed']);
1207 
1208  $this->object->saveToDb(true);
1209  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), TRUE);
1210 
1211  if ($total != 0)
1212  {
1213  $this->object->recalculateScores(true);
1214  }
1215 
1216  $this->ctrl->redirect($this, "scoring");
1217  }
1218  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
const REPORT_AFTER_DATE
$_POST['username']
Definition: cron.php:12
scoringObject($checkonly=FALSE)
Display and fill the scoring settings form of the test.
+ Here is the call graph for this function:

◆ scoringObject()

ilObjTestGUI::scoringObject (   $checkonly = FALSE)

Display and fill the scoring settings form of the test.

public

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

References $_GET, $errors, $total, ilRadioGroupInputGUI\addOption(), ilCheckboxGroupInputGUI\addOption(), ilObjAssessmentFolderGUI\getSettingsTemplateConfig(), IL_CAL_TIMESTAMP, IL_CAL_UNIX, ilUtil\sendInfo(), ilCheckboxInputGUI\setChecked(), ilFormPropertyGUI\setInfo(), and ilRadioOption\setValue().

Referenced by saveScoringObject().

1226  {
1227  global $ilAccess;
1228  if (!$ilAccess->checkAccess("write", "", $this->ref_id))
1229  {
1230  // allow only write access
1231  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
1232  $this->ctrl->redirect($this, "infoScreen");
1233  }
1234 
1235 
1236  // using template?
1237  $template_settings = null;
1238  $template = $this->object->getTemplate();
1239 
1240  if($template)
1241  {
1242  include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
1243  include_once "Modules/Test/classes/class.ilObjAssessmentFolderGUI.php";
1244 
1246 
1247  $template_settings = $template->getSettings();
1248  }
1249 
1250  $save = (strcmp($this->ctrl->getCmd(), "saveScoring") == 0) ? TRUE : FALSE;
1251  $total = $this->object->evalTotalPersons();
1252  $this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
1253 
1254  // Determine settings availability
1255  $setting_available = true; // In general, the scoring settings are available.
1256 
1257  if ($total != 0)
1258  {
1259  $setting_available = false; // Unless there are results from users.
1260  }
1261  if ($this->object->getScoreReporting() == 4)
1262  {
1263  $setting_available = true; // But if the results are not public since they will never be
1264  }
1265  if ($this->object->getScoreReporting() == 3 && $this->object->getReportingDate() > time())
1266  {
1267  $setting_available = true;// or the presentation date is not reached, then we can still edit them.
1268  }
1269 
1270  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1271  $form = new ilPropertyFormGUI();
1272  $form->setFormAction($this->ctrl->getFormAction($this));
1273  $form->setTableWidth("100%");
1274  $form->setId("test_properties_scoring");
1275 
1276  // scoring properties
1277  $header = new ilFormSectionHeaderGUI();
1278  $header->setTitle($this->lng->txt("test_scoring"));
1279  $form->addItem($header);
1280 
1281  // scoring system
1282  $count_system = new ilRadioGroupInputGUI($this->lng->txt("tst_text_count_system"), "count_system");
1283  $count_system->addOption(new ilRadioOption($this->lng->txt("tst_count_partial_solutions"), 0, ''));
1284  $count_system->addOption(new ilRadioOption($this->lng->txt("tst_count_correct_solutions"), 1, ''));
1285  $count_system->setValue($this->object->getCountSystem());
1286  $count_system->setInfo($this->lng->txt("tst_count_system_description"));
1287  $count_system->setDisabled(!$setting_available);
1288  $form->addItem($count_system);
1289 
1290  // mc questions
1291  $mc_scoring = new ilRadioGroupInputGUI($this->lng->txt("tst_score_mcmr_questions"), "mc_scoring");
1292  $mc_scoring->addOption(new ilRadioOption($this->lng->txt("tst_score_mcmr_zero_points_when_unanswered"), 0, ''));
1293  $mc_scoring->addOption(new ilRadioOption($this->lng->txt("tst_score_mcmr_use_scoring_system"), 1, ''));
1294  $mc_scoring->setValue($this->object->getMCScoring());
1295  $mc_scoring->setInfo($this->lng->txt("tst_score_mcmr_questions_description"));
1296  $mc_scoring->setDisabled(!$setting_available);
1297  $form->addItem($mc_scoring);
1298 
1299  // score cutting
1300  $score_cutting = new ilRadioGroupInputGUI($this->lng->txt("tst_score_cutting"), "score_cutting");
1301  $score_cutting->addOption(new ilRadioOption($this->lng->txt("tst_score_cut_question"), 0, ''));
1302  $score_cutting->addOption(new ilRadioOption($this->lng->txt("tst_score_cut_test"), 1, ''));
1303  $score_cutting->setValue($this->object->getScoreCutting());
1304  $score_cutting->setInfo($this->lng->txt("tst_score_cutting_description"));
1305  $score_cutting->setDisabled(!$setting_available);
1306  $form->addItem($score_cutting);
1307 
1308  // pass scoring
1309  $pass_scoring = new ilRadioGroupInputGUI($this->lng->txt("tst_pass_scoring"), "pass_scoring");
1310  $pass_scoring->addOption(new ilRadioOption($this->lng->txt("tst_pass_last_pass"), 0, ''));
1311  $pass_scoring->addOption(new ilRadioOption($this->lng->txt("tst_pass_best_pass"), 1, ''));
1312  $pass_scoring->setValue($this->object->getPassScoring());
1313  $pass_scoring->setInfo($this->lng->txt("tst_pass_scoring_description"));
1314  $pass_scoring->setDisabled(!$setting_available);
1315  $form->addItem($pass_scoring);
1316 
1317  // test presentation
1318  $header_tp = new ilFormSectionHeaderGUI();
1319  $header_tp->setTitle($this->lng->txt("test_presentation"));
1320  $form->addItem($header_tp);
1321 
1322  // enable obligations
1323  $checkBoxEnableObligations = new ilCheckboxInputGUI($this->lng->txt("tst_setting_enable_obligations_label"), "obligations_enabled");
1324  $checkBoxEnableObligations->setChecked($this->object->areObligationsEnabled());
1325  $checkBoxEnableObligations->setInfo($this->lng->txt("tst_setting_enable_obligations_info"));
1326  if( $total )
1327  {
1328  $checkBoxEnableObligations->setDisabled(true);
1329  $checkBoxEnableObligations->setPostVar("disabled_field");
1330  }
1331  $form->addItem($checkBoxEnableObligations);
1332 
1333 
1334  // offer hints
1335  $checkBoxOfferHints = new ilCheckboxInputGUI($this->lng->txt("tst_setting_offer_hints_label"), "offer_hints");
1336  $checkBoxOfferHints->setChecked($this->object->isOfferingQuestionHintsEnabled());
1337  $checkBoxOfferHints->setInfo($this->lng->txt("tst_setting_offer_hints_info"));
1338  if( $total )
1339  {
1340  $checkBoxOfferHints->setDisabled(true);
1341  $checkBoxOfferHints->setPostVar("disabled_field");
1342  }
1343  $form->addItem($checkBoxOfferHints);
1344 
1345  // instant feedback
1346  $instant_feedback = new ilCheckboxGroupInputGUI($this->lng->txt("tst_instant_feedback"), "instant_feedback");
1347  $instant_feedback->addOption(new ilCheckboxOption($this->lng->txt("tst_instant_feedback_answer_specific"), 'instant_feedback_specific', ''));
1348  $instant_feedback->addOption(new ilCheckboxOption($this->lng->txt("tst_instant_feedback_answer_generic"), 'instant_feedback_generic', ''));
1349  $instant_feedback->addOption(new ilCheckboxOption($this->lng->txt("tst_instant_feedback_results"), 'instant_feedback_points', ''));
1350  $instant_feedback->addOption(new ilCheckboxOption($this->lng->txt("tst_instant_feedback_solution"), 'instant_feedback_solution', ''));
1351  $values = array();
1352  if ($this->object->getSpecificAnswerFeedback()) array_push($values, 'instant_feedback_specific');
1353  if ($this->object->getGenericAnswerFeedback()) array_push($values, 'instant_feedback_generic');
1354  if ($this->object->getAnswerFeedbackPoints()) array_push($values, 'instant_feedback_points');
1355  if ($this->object->getInstantFeedbackSolution()) array_push($values, 'instant_feedback_solution');
1356  $instant_feedback->setValue($values);
1357  $instant_feedback->setInfo($this->lng->txt("tst_instant_feedback_description"));
1358  $form->addItem($instant_feedback);
1359 
1360  // scoring properties
1361  $header_tr = new ilFormSectionHeaderGUI();
1362  $header_tr->setTitle($this->lng->txt("test_results"));
1363  $form->addItem($header_tr);
1364 
1365  // access to test results
1366  $results_access = new ilRadioGroupInputGUI($this->lng->txt("tst_results_access"), "results_access");
1367  $results_access->addOption(new ilRadioOption($this->lng->txt("tst_results_access_always"), 2, ''));
1368  $results_access->addOption(new ilRadioOption($this->lng->txt("tst_results_access_finished"), 1, ''));
1369  $results_access_date_limitation = new ilRadioOption($this->lng->txt("tst_results_access_date"), 3, '');
1370  $results_access->addOption($results_access_date_limitation);
1371  $results_access->addOption(new ilRadioOption($this->lng->txt("tst_results_access_never"), 4, ''));
1372  $results_access->setValue($this->object->getScoreReporting());
1373  $results_access->setInfo($this->lng->txt("tst_results_access_description"));
1374 
1375  // access date
1376  $reporting_date = new ilDateTimeInputGUI('', 'reporting_date');
1377  $reporting_date->setShowDate(true);
1378  $reporting_date->setShowTime(true);
1379  if (strlen($this->object->getReportingDate()))
1380  {
1381  $reporting_date->setDate(new ilDateTime($this->object->getReportingDate(), IL_CAL_TIMESTAMP));
1382  }
1383  else
1384  {
1385  $reporting_date->setDate(new ilDateTime(time(), IL_CAL_UNIX));
1386  }
1387  $results_access_date_limitation->addSubItem($reporting_date);
1388  $form->addItem($results_access);
1389 
1390  $results_print_best_solution = new ilCheckboxInputGUI($this->lng->txt("tst_results_print_best_solution"), "print_bs_with_res");
1391  $results_print_best_solution->setInfo($this->lng->txt('tst_results_print_best_solution_info'));
1392  $results_print_best_solution->setValue(1);
1393  $results_print_best_solution->setChecked((bool) $this->object->isBestSolutionPrintedWithResult());
1394  $form->addItem($results_print_best_solution);
1395 
1396  // results presentation
1397  $results_presentation = new ilCheckboxGroupInputGUI($this->lng->txt("tst_results_presentation"), "results_presentation");
1398  $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_pass_details"), 'pass_details', $this->lng->txt("tst_show_pass_details_desc")));
1399  $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_details"), 'solution_details', $this->lng->txt("tst_show_solution_details_desc")));
1400  $results_presentation->addOption($showSolutionPrintViewOption = new ilCheckboxOption($this->lng->txt("tst_show_solution_printview"), 'solution_printview', $this->lng->txt("tst_show_solution_printview_desc")));
1401  $solutionCompareInput = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_compare'), 'solution_compare');
1402  $solutionCompareInput->setChecked($this->object->getShowSolutionListComparison());
1403  $showSolutionPrintViewOption->addSubItem($solutionCompareInput);
1404  $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_feedback"), 'solution_feedback', $this->lng->txt("tst_show_solution_feedback_desc")));
1405  $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_answers_only"), 'solution_answers_only', $this->lng->txt("tst_show_solution_answers_only_desc")));
1406  $signatureOption = new ilCheckboxOption($this->lng->txt("tst_show_solution_signature"), 'solution_signature', $this->lng->txt("tst_show_solution_signature_desc"));
1407  $results_presentation->addOption($signatureOption);
1408  $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_suggested"), 'solution_suggested', $this->lng->txt("tst_show_solution_suggested_desc")));
1409  $values = array();
1410  if ($this->object->getShowPassDetails()) array_push($values, 'pass_details');
1411  if ($this->object->getShowSolutionDetails()) array_push($values, 'solution_details');
1412  if ($this->object->getShowSolutionPrintview()) array_push($values, 'solution_printview');
1413  if ($this->object->getShowSolutionFeedback()) array_push($values, 'solution_feedback');
1414  if ($this->object->getShowSolutionAnswersOnly()) array_push($values, 'solution_answers_only');
1415  if ($this->object->getShowSolutionSignature()) array_push($values, 'solution_signature');
1416  if ($this->object->getShowSolutionSuggested()) array_push($values, 'solution_suggested');
1417  if ($this->object->getShowSolutionListComparison()) array_push($values, 'solution_compare');
1418  $results_presentation->setValue($values);
1419  if ($this->object->getAnonymity())
1420  {
1421  $signatureOption->setDisabled(true);
1422  }
1423  $form->addItem($results_presentation);
1424 
1425  // show signature placeholder
1426  $showExamId = new ilCheckboxInputGUI($this->lng->txt('examid_in_test_res'), 'examid_in_test_res');
1427  $showExamId->setInfo($this->lng->txt('examid_in_test_res_desc'));
1428  $showExamId->setChecked($this->object->isShowExamIdInTestResultsEnabled());
1429  $form->addItem($showExamId);
1430 
1431  // misc properties
1432  $header_misc = new ilFormSectionHeaderGUI();
1433  $header_misc->setTitle($this->lng->txt("misc"));
1434  $form->addItem($header_misc);
1435 
1436  // deletion of test results
1437  $passDeletion = new ilRadioGroupInputGUI($this->lng->txt("tst_pass_deletion"), "pass_deletion_allowed");
1438  $passDeletion->addOption(new ilRadioOption($this->lng->txt("tst_pass_deletion_not_allowed"), 0, ''));
1439  $passDeletion->addOption(new ilRadioOption($this->lng->txt("tst_pass_deletion_allowed"), 1, ''));
1440  $passDeletion->setValue($this->object->isPassDeletionAllowed());
1441  $form->addItem($passDeletion);
1442 
1443  // export settings
1444  $export_settings = new ilCheckboxGroupInputGUI($this->lng->txt("tst_export_settings"), "export_settings");
1445  $export_settings->addOption(new ilCheckboxOption($this->lng->txt("tst_exp_sc_short"), 'exp_sc_short', ''));
1446  $values = array();
1447  if ($this->object->getExportSettingsSingleChoiceShort()) array_push($values, 'exp_sc_short');
1448  $export_settings->setValue($values);
1449  $form->addItem($export_settings);
1450 
1451 
1452  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]) && $total == 0) $form->addCommandButton("saveScoring", $this->lng->txt("save"));
1453  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]) && $total != 0) $form->addCommandButton("confirmScoring", $this->lng->txt("save"));
1454 
1455  // remove items when using template
1456  if($template_settings)
1457  {
1458  foreach($template_settings as $id => $item)
1459  {
1460  if($item["hide"])
1461  {
1462  $form->removeItemByPostVar($id);
1463  }
1464  }
1465  }
1466 
1467  $errors = false;
1468 
1469  if ($save)
1470  {
1471  $errors = !$form->checkInput();
1472  $form->setValuesByPost();
1473  if ($errors) $checkonly = false;
1474  }
1475 
1476  if (!$checkonly) $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
1477  return $errors;
1478  }
static getSettingsTemplateConfig()
Get settings template configuration object.
This class represents an option in a radio group.
This class represents an option in a checkbox group.
This class represents a property form user interface.
$_GET["client_id"]
This class represents a section header in a property form.
$errors
This class represents a checkbox property in a property form.
const IL_CAL_UNIX
This class represents a date/time property in a property form.
setInfo($a_info)
Set Information Text.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setChecked($a_checked)
Set Checked.
This class represents a property in a property form.
addOption($a_option)
Add Option.
setValue($a_value)
Set Value.
Date and time handling
This class represents a property in a property form.
const IL_CAL_TIMESTAMP
Settings template application class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showDetailedResultsObject()

ilObjTestGUI::showDetailedResultsObject ( )

Shows the pass overview and the answers of one ore more users for the scored pass.

public

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

References $_POST, $_SESSION, and showUserResults().

3387  {
3388  if (count($_POST))
3389  {
3390  $_SESSION["show_user_results"] = $_POST["chbUser"];
3391  }
3392  $this->showUserResults($show_pass_details = TRUE, $show_answers = TRUE, $show_reached_points = TRUE);
3393  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
showUserResults($show_pass_details, $show_answers, $show_reached_points=FALSE)
Shows the pass overview of the scored pass for one ore more users.
+ Here is the call graph for this function:

◆ showPageObject()

ilObjTestGUI::showPageObject ( )

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

References $_REQUEST, and $ilCtrl.

Referenced by movePageObject().

5462  {
5463  global $ilCtrl;
5464 
5465  $ilCtrl->setParameterByClass('iltestexpresspageobjectgui', 'q_id', $_REQUEST['q_id']);
5466  $ilCtrl->redirectByClass('iltestexpresspageobjectgui', 'showPage');
5467  }
global $ilCtrl
Definition: ilias.php:18
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the caller graph for this function:

◆ showPassOverviewObject()

ilObjTestGUI::showPassOverviewObject ( )

Shows the pass overview of the scored pass for one ore more users.

public

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

References $_POST, $_SESSION, and showUserResults().

3415  {
3416  if (count($_POST))
3417  {
3418  $_SESSION["show_user_results"] = $_POST["chbUser"];
3419  }
3420  $this->showUserResults($show_pass_details = TRUE, $show_answers = FALSE);
3421  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
showUserResults($show_pass_details, $show_answers, $show_reached_points=FALSE)
Shows the pass overview of the scored pass for one ore more users.
+ Here is the call graph for this function:

◆ showTimingFormObject()

ilObjTestGUI::showTimingFormObject ( )

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

References formTimingObject().

3288  {
3289  $form = $this->formTimingObject();
3290  $this->tpl->setContent($form->getHTML());
3291  }
+ Here is the call graph for this function:

◆ showUserAnswersObject()

ilObjTestGUI::showUserAnswersObject ( )

Shows the answers of one ore more users for the scored pass.

public

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

References $_POST, $_SESSION, and showUserResults().

3401  {
3402  if (count($_POST))
3403  {
3404  $_SESSION["show_user_results"] = $_POST["chbUser"];
3405  }
3406  $this->showUserResults($show_pass_details = FALSE, $show_answers = TRUE);
3407  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
showUserResults($show_pass_details, $show_answers, $show_reached_points=FALSE)
Shows the pass overview of the scored pass for one ore more users.
+ Here is the call graph for this function:

◆ showUserResults()

ilObjTestGUI::showUserResults (   $show_pass_details,
  $show_answers,
  $show_reached_points = FALSE 
)

Shows the pass overview of the scored pass for one ore more users.

public

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

References $_SESSION, createUserResults(), ilUtil\getStyleSheetLocation(), and ilUtil\sendInfo().

Referenced by showDetailedResultsObject(), showPassOverviewObject(), and showUserAnswersObject().

3429  {
3430  $show_user_results = $_SESSION["show_user_results"];
3431 
3432  if (count($show_user_results) == 0)
3433  {
3434  ilUtil::sendInfo($this->lng->txt("select_one_user"), TRUE);
3435  $this->ctrl->redirect($this, "participants");
3436  }
3437 
3438 
3439  $template = $this->createUserResults( $show_pass_details, $show_answers, $show_reached_points, $show_user_results);
3440 
3441  $this->tpl->setVariable("ADM_CONTENT", $template->get());
3442  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
3443  if ($this->object->getShowSolutionAnswersOnly())
3444  {
3445  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print_hide_content.css", "Modules/Test"), "print");
3446  }
3447  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
createUserResults($show_pass_details, $show_answers, $show_reached_points, $show_user_results)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ statisticsObject()

ilObjTestGUI::statisticsObject ( )

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

4326  {
4327  }

◆ takenObject()

ilObjTestGUI::takenObject ( )

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

2470  {
2471  }

◆ timingObject()

ilObjTestGUI::timingObject ( )

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

References $_POST, $res, formTimingObject(), getParticipantsSubTabs(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

3193  {
3194  $this->getParticipantsSubTabs();
3195 
3196  global $ilAccess;
3197 
3198  if (!$ilAccess->checkAccess("write", "", $this->ref_id))
3199  {
3200  // allow only write access
3201  ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
3202  $this->ctrl->redirect($this, "infoScreen");
3203  }
3204 
3205  if ($this->object->getProcessingTimeInSeconds() > 0 && $this->object->getNrOfTries() == 1)
3206  {
3207  $form = $this->formTimingObject();
3208  if (count($_POST) && $form->checkInput())
3209  {
3210  $res = $this->object->addExtraTime($form->getInput('participant'), $form->getInput('extratime'));
3211  ilUtil::sendSuccess(sprintf($this->lng->txt('tst_extratime_added'), $form->getInput('extratime')), true);
3212  $this->ctrl->redirect($this, 'timingOverview');
3213  }
3214  else
3215  {
3216  return $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
3217  }
3218  }
3219  else
3220  {
3221  ilUtil::sendInfo($this->lng->txt("tst_extratime_notavailable"));
3222  }
3223  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ timingOverviewObject()

ilObjTestGUI::timingOverviewObject ( )

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

References ilDatePresentation\formatDate(), getParticipantsSubTabs(), and IL_CAL_DATETIME.

3144  {
3145  $this->getParticipantsSubTabs();
3146 
3147  include_once "./Modules/Test/classes/tables/class.ilTimingOverviewTableGUI.php";
3148  $table_gui = new ilTimingOverviewTableGUI($this, 'timingOverview');
3149 
3150  $participants =& $this->object->getTestParticipants();#
3151  $times = $this->object->getStartingTimeOfParticipants();
3152  $addons = $this->object->getTimeExtensionsOfParticipants();
3153 
3154  $tbl_data = array();
3155  $i = 0;
3156  foreach ($participants as $participant)
3157  {
3158  $started = "";
3159  if ($times[$participant['active_id']])
3160  {
3161  $started = $this->lng->txt('tst_started').': '.ilDatePresentation::formatDate(new ilDateTime($times[$participant['active_id']], IL_CAL_DATETIME));
3162  $tbl_data[$i]['started'] = $started;
3163  }
3164  else
3165  {
3166  $tbl_data[$i]['started'] = '';
3167  }
3168 
3169  if ($addons[$participant['active_id']] > 0)
3170  {
3171  $tbl_data[$i]['extratime'] = $addons[$participant['active_id']];
3172  }
3173 
3174  $tbl_data[$i]['login'] = $participant['login'];
3175 
3176  if ($this->object->getAnonymity())
3177  {
3178  $name = $this->lng->txt("anonymous");
3179  }
3180  else
3181  {
3182  $name = $participant['lastname'] . ', ' . $participant['firstname'];
3183  }
3184 
3185  $tbl_data[$i]['name'] = $name;
3186  }
3187  $table_gui->setData($tbl_data);
3188 
3189  $this->tpl->setContent($table_gui->getHTML());
3190  }
const IL_CAL_DATETIME
Class ilTimingOverviewTableGUI.
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
+ Here is the call graph for this function:

◆ uploadObject()

ilObjTestGUI::uploadObject (   $redirect = true)

display status information or report errors messages in case of error

public

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

References uploadTstObject().

1054  {
1055  $this->uploadTstObject();
1056  }
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 822 of file class.ilObjTestGUI.php.

References $_POST, $_SESSION, $file, $result, ilObjTest\_createImportDirectory(), ilObjTest\_getImportDirectory(), ilObjTest\_setImportDirectory(), ilObjectGUI\createObject(), ilUtil\delDir(), ilUtil\getImagePath(), IL_MO_VERIFY_QTI, ilUtil\moveUploadedFile(), QT_CLOZE, QT_IMAGEMAP, QT_JAVAAPPLET, QT_MATCHING, QT_MULTIPLE_CHOICE_MR, QT_MULTIPLE_CHOICE_SR, QT_NUMERIC, QT_ORDERING, QT_TEXT, QT_TEXTSUBSET, ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\unzip().

Referenced by importFileObject(), and uploadObject().

823  {
824  if ($_FILES["xmldoc"]["error"] > UPLOAD_ERR_OK)
825  {
826  ilUtil::sendFailure($this->lng->txt("error_upload"));
827  $this->createObject();
828  return;
829  }
830  include_once("./Modules/Test/classes/class.ilObjTest.php");
831  // create import directory
833 
834  // copy uploaded file to import directory
835  $file = pathinfo($_FILES["xmldoc"]["name"]);
836  $full_path = $basedir."/".$_FILES["xmldoc"]["name"];
837  ilUtil::moveUploadedFile($_FILES["xmldoc"]["tmp_name"], $_FILES["xmldoc"]["name"], $full_path);
838 
839  // unzip file
840  ilUtil::unzip($full_path);
841 
842  // determine filenames of xml files
843  $subdir = basename($file["basename"],".".$file["extension"]);
845  $xml_file = ilObjTest::_getImportDirectory().'/'.$subdir.'/'.$subdir.".xml";
846  $qti_file = ilObjTest::_getImportDirectory().'/'.$subdir.'/'. preg_replace("/test|tst/", "qti", $subdir).".xml";
847  $results_file = ilObjTest::_getImportDirectory().'/'.$subdir.'/'. preg_replace("/test|tst/", "results", $subdir).".xml";
848 
849  if(!is_file($qti_file))
850  {
851  ilUtil::delDir($basedir);
852  ilUtil::sendFailure($this->lng->txt("tst_import_non_ilias_zip"));
853  $this->createObject();
854  return;
855  }
856 
857  // start verification of QTI files
858  include_once "./Services/QTI/classes/class.ilQTIParser.php";
859  $qtiParser = new ilQTIParser($qti_file, IL_MO_VERIFY_QTI, 0, "");
860  $result = $qtiParser->startParsing();
861  $founditems =& $qtiParser->getFoundItems();
862 
863  if (count($founditems) == 0)
864  {
865  // nothing found
866 
867  // delete import directory
868  ilUtil::delDir($basedir);
869 
870  ilUtil::sendInfo($this->lng->txt("tst_import_no_items"));
871  $this->createObject();
872  return;
873  }
874 
875  $complete = 0;
876  $incomplete = 0;
877  foreach ($founditems as $item)
878  {
879  if (strlen($item["type"]))
880  {
881  $complete++;
882  }
883  else
884  {
885  $incomplete++;
886  }
887  }
888 
889  if ($complete == 0)
890  {
891  // delete import directory
892  ilUtil::delDir($basedir);
893 
894  ilUtil::sendInfo($this->lng->txt("qpl_import_non_ilias_files"));
895  $this->createObject();
896  return;
897  }
898 
899  $_SESSION["tst_import_results_file"] = $results_file;
900  $_SESSION["tst_import_xml_file"] = $xml_file;
901  $_SESSION["tst_import_qti_file"] = $qti_file;
902  $_SESSION["tst_import_subdir"] = $subdir;
903  // display of found questions
904  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.tst_import_verification.html", "Modules/Test");
905  $row_class = array("tblrow1", "tblrow2");
906  $counter = 0;
907  foreach ($founditems as $item)
908  {
909  $this->tpl->setCurrentBlock("verification_row");
910  $this->tpl->setVariable("ROW_CLASS", $row_class[$counter++ % 2]);
911  $this->tpl->setVariable("QUESTION_TITLE", $item["title"]);
912  $this->tpl->setVariable("QUESTION_IDENT", $item["ident"]);
913  include_once "./Services/QTI/classes/class.ilQTIItem.php";
914  switch ($item["type"])
915  {
916  case "MULTIPLE CHOICE QUESTION":
918  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("qt_multiple_choice"));
919  break;
920  case "SINGLE CHOICE QUESTION":
922  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assSingleChoice"));
923  break;
924  case "NUMERIC QUESTION":
925  case QT_NUMERIC:
926  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assNumeric"));
927  break;
928  case "TEXTSUBSET QUESTION":
929  case QT_TEXTSUBSET:
930  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assTextSubset"));
931  break;
932  case "CLOZE QUESTION":
933  case QT_CLOZE:
934  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assClozeTest"));
935  break;
936  case "IMAGE MAP QUESTION":
937  case QT_IMAGEMAP:
938  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assImagemapQuestion"));
939  break;
940  case "JAVA APPLET QUESTION":
941  case QT_JAVAAPPLET:
942  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assJavaApplet"));
943  break;
944  case "MATCHING QUESTION":
945  case QT_MATCHING:
946  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assMatchingQuestion"));
947  break;
948  case "ORDERING QUESTION":
949  case QT_ORDERING:
950  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assOrderingQuestion"));
951  break;
952  case "TEXT QUESTION":
953  case QT_TEXT:
954  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("assTextQuestion"));
955  break;
956  }
957  $this->tpl->parseCurrentBlock();
958  }
959 
960  // on import creation screen the pool was chosen (-1 for no pool)
961  // BUT when no pool is available the input on creation screen is missing, so the field value -1 for no pool is not submitted.
962  $QplOrTstID = isset($_POST["qpl"]) && (int)$_POST["qpl"] != 0 ? $_POST["qpl"] : -1;
963 
964  $this->tpl->setCurrentBlock("adm_content");
965  $this->tpl->setVariable("TEXT_TYPE", $this->lng->txt("question_type"));
966  $this->tpl->setVariable("TEXT_TITLE", $this->lng->txt("question_title"));
967  $this->tpl->setVariable("FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt("tst_import_verify_found_questions"));
968  $this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_tst"));
969  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
970  $this->tpl->setVariable("ARROW", ilUtil::getImagePath("arrow_downright.png"));
971  $this->tpl->setVariable("QUESTIONPOOL_ID", $QplOrTstID);
972  $this->tpl->setVariable("VALUE_IMPORT", $this->lng->txt("import"));
973  $this->tpl->setVariable("VALUE_CANCEL", $this->lng->txt("cancel"));
974  $this->tpl->parseCurrentBlock();
975  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
const QT_MATCHING
print $file
$_POST['username']
Definition: cron.php:12
$result
_getImportDirectory()
Get the import directory location of the test.
const QT_TEXT
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
createObject()
create new object form
const QT_IMAGEMAP
const QT_MULTIPLE_CHOICE_SR
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
_createImportDirectory()
creates data directory for import files (data_dir/tst_data/tst_<id>/import, depending on data directo...
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
_setImportDirectory($a_import_dir=null)
set import directory
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const QT_JAVAAPPLET
const QT_NUMERIC
const QT_TEXTSUBSET
const QT_CLOZE
const QT_MULTIPLE_CHOICE_MR
const IL_MO_VERIFY_QTI
const QT_ORDERING
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $object

ilObjTestGUI::$object = null

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

Referenced by applyTemplate(), and executeCommand().

◆ $testPlayerFactory

ilObjTestGUI::$testPlayerFactory = null
private

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

◆ $testQuestionSetConfigFactory

ilObjTestGUI::$testQuestionSetConfigFactory = null
private

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

◆ $testSequenceFactory

ilObjTestGUI::$testSequenceFactory = null
private

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

◆ $testSessionFactory

ilObjTestGUI::$testSessionFactory = null
private

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


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