ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjQuestionPoolGUI Class Reference

Class ilObjQuestionPoolGUI. More...

+ Inheritance diagram for ilObjQuestionPoolGUI:
+ Collaboration diagram for ilObjQuestionPoolGUI:

Public Member Functions

 ilObjQuestionPoolGUI ()
 Constructor public.
 executeCommand ()
 execute command
 propertiesObject ()
 Questionpool properties.
 savePropertiesObject ()
 Save questionpool properties.
 downloadFileObject ()
 download file
 fullscreenObject ()
 show fullscreen view
 filterObject ()
 set question list filter
 resetFilterObject ()
 resets filter
 download_paragraphObject ()
 download source code paragraph
 uploadQplObject ($questions_only=false)
 imports question(s) into the questionpool
 importVerifiedFileObject ()
 imports question(s) into the questionpool (after verification)
 cancelImportObject ()
 uploadObject ()
 imports question(s) into the questionpool
 importQuestionsObject ()
 display the import form to import questions into the questionpool
createQuestionObject ()
 create new question
createQuestionForTestObject ()
 create new question
 afterSave (ilObject $a_new_object)
 save object public
 assessmentObject ()
 show assessment data of object
 questionObject ()
 deleteQuestionsObject ()
 delete questions confirmation screen
 confirmDeleteQuestionsObject ()
 delete questions
 cancelDeleteQuestionsObject ()
 Cancel question deletion.
 exportQuestionObject ()
 export question
 filterQuestionBrowserObject ()
 resetQuestionBrowserObject ()
 questionsObject ($arrFilter=null)
 list questions of question pool
 updateObject ()
 updates object entry in object_data
 pasteObject ()
 paste questios from the clipboard into the question pool
 copyObject ()
 copy one or more question objects to the clipboard
 moveObject ()
 mark one or more question objects for moving
 createExportQTI ()
 create export file
 createExportExcel ()
editQuestionForTestObject ()
 edit question
 importFileObject ()
 form for new questionpool object import
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 setTitleAndDescription ()
 called by prepare output
 getTabs (&$tabs_gui)
 adds tabs to tab gui object
 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
 infoScreenForward ()
 show information screen
 _goto ($a_target)
 Redirect script to call a test with the question pool reference id.
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 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
 getCreationMode ()
 get creation mode
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 createObject ()
 create new object form
 cancelCreation ()
 cancel create action and go back to repository parent
 saveObject ()
 save object
 editObject ()
 edit object
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.

Data Fields

 $object
- 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

 initImportForm ($a_new_type)
 Init object import form.
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu.
 insertHeaderAction ($a_list_gui)
 Insert header action into main template.
 addHeaderAction ()
 Add header action menu.
 redrawHeaderActionObject ()
 Ajax call: redraw action header only.
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 initCreationForms ($a_new_type)
 Init creation froms.
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion)
 initCreateForm ($a_new_type)
 Init object creation form.
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types.
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates.
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen.
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position.
 initEditForm ()
 Init object edit form.
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormValues ()
 Get values for edit form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 afterUpdate ()
 Post (successful) object update hook.
 importFileObject ($parent_id=null)
 Import.
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 __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
 __showClipboardTable ($a_result_set, $a_from="")
 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
 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.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error.
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission.

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root.
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root.

Detailed Description

Member Function Documentation

ilObjQuestionPoolGUI::_goto (   $a_target)

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

Redirect script to call a test with the question pool reference id

Parameters
integer$a_targetThe reference id of the question pool public

Definition at line 1348 of file class.ilObjQuestionPoolGUI.php.

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

{
global $ilAccess, $ilErr, $lng;
if ($ilAccess->checkAccess("write", "", $a_target))
{
$_GET["baseClass"] = "ilObjQuestionPoolGUI";
$_GET["cmd"] = "questions";
$_GET["ref_id"] = $a_target;
include_once("ilias.php");
}
else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
{
ilUtil::sendInfo(sprintf($lng->txt("msg_no_perm_read_item"),
}
$ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::addLocatorItems ( )

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

Definition at line 1112 of file class.ilObjQuestionPoolGUI.php.

References $_GET, $title, assQuestionGUI\_getQuestionGUI(), and assQuestion\_getQuestionTypeName().

{
global $ilLocator;
switch ($this->ctrl->getCmd())
{
case "create":
case "importFile":
case "cancel":
break;
default:
$ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
break;
}
if ($_GET["q_id"] > 0)
{
include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
$q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
if($q_gui->object instanceof assQuestion)
{
$q_gui->object->setObjId($this->object->getId());
$title = $q_gui->object->getTitle();
if(!$title)
{
$title = $this->lng->txt('new').': '.assQuestion::_getQuestionTypeName($q_gui->object->getQuestionType());
}
$ilLocator->addItem($title, $this->ctrl->getLinkTargetByClass(get_class($q_gui), "editQuestion"));
}
else
{
// Workaround for context issues: If no object was found, redirect without q_id parameter
$this->ctrl->setParameter($this, 'q_id', '');
$this->ctrl->redirect($this);
}
}
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::afterSave ( ilObject  $a_new_object)

save object public

Reimplemented from ilObjectGUI.

Definition at line 715 of file class.ilObjQuestionPoolGUI.php.

References ilObject\getRefId(), ilUtil\redirect(), and ilUtil\sendSuccess().

{
// always send a message
ilUtil::sendSuccess($this->lng->txt("object_added"),true);
ilUtil::redirect("ilias.php?ref_id=".$a_new_object->getRefId().
"&baseClass=ilObjQuestionPoolGUI");
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::assessmentObject ( )

show assessment data of object

Definition at line 727 of file class.ilObjQuestionPoolGUI.php.

References $_GET, $title, assQuestion\_getTitle(), assQuestion\_getTotalAnswers(), assQuestion\_getTotalRightAnswers(), and ilUtil\sendInfo().

{
$this->tpl->addBlockFile("CONTENT", "content", "tpl.il_as_qpl_content.html", "Modules/TestQuestionPool");
$this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
// catch feedback message
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$question_title = assQuestion::_getTitle($_GET["q_id"]);
$title = $this->lng->txt("statistics") . " - $question_title";
if (!empty($title))
{
$this->tpl->setVariable("HEADER", $title);
}
include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
$total_of_answers = assQuestion::_getTotalAnswers($_GET["q_id"]);
$counter = 0;
$color_class = array("tblrow1", "tblrow2");
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_qpl_assessment_of_questions.html", "Modules/TestQuestionPool");
if (!$total_of_answers)
{
$this->tpl->setCurrentBlock("emptyrow");
$this->tpl->setVariable("TXT_NO_ASSESSMENT", $this->lng->txt("qpl_assessment_no_assessment_of_questions"));
$this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
$this->tpl->parseCurrentBlock();
}
else
{
$this->tpl->setCurrentBlock("row");
$this->tpl->setVariable("TXT_RESULT", $this->lng->txt("qpl_assessment_total_of_answers"));
$this->tpl->setVariable("TXT_VALUE", $total_of_answers);
$this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
$counter++;
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("row");
$this->tpl->setVariable("TXT_RESULT", $this->lng->txt("qpl_assessment_total_of_right_answers"));
$this->tpl->setVariable("TXT_VALUE", sprintf("%2.2f", assQuestion::_getTotalRightAnswers($_GET["edit"]) * 100.0) . " %");
$this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("TXT_QUESTION_TITLE", $question_title);
$this->tpl->setVariable("TXT_RESULT", $this->lng->txt("result"));
$this->tpl->setVariable("TXT_VALUE", $this->lng->txt("value"));
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::cancelDeleteQuestionsObject ( )

Cancel question deletion.

Definition at line 826 of file class.ilObjQuestionPoolGUI.php.

{
$this->ctrl->redirect($this, "questions");
}
ilObjQuestionPoolGUI::cancelImportObject ( )

Definition at line 639 of file class.ilObjQuestionPoolGUI.php.

References $_POST.

{
if ($_POST["questions_only"] == 1)
{
$this->ctrl->redirect($this, "questions");
}
else
{
$this->ctrl->redirect($this, "cancel");
}
}
ilObjQuestionPoolGUI::confirmDeleteQuestionsObject ( )

delete questions

Definition at line 808 of file class.ilObjQuestionPoolGUI.php.

References $_POST, and ilUtil\sendSuccess().

{
// delete questions after confirmation
foreach ($_POST["q_id"] as $key => $value)
{
$this->object->deleteQuestion($value);
$this->object->cleanupClipboard($value);
}
if (count($_POST["q_id"])) ilUtil::sendSuccess($this->lng->txt("qpl_questions_deleted"), true);
$this->ctrl->setParameter($this, 'q_id', '');
$this->ctrl->redirect($this, "questions");
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::copyObject ( )

copy one or more question objects to the clipboard

Definition at line 1001 of file class.ilObjQuestionPoolGUI.php.

References $_POST, and ilUtil\sendInfo().

{
if (count($_POST["q_id"]) > 0)
{
foreach ($_POST["q_id"] as $key => $value)
{
$this->object->copyToClipboard($value);
}
ilUtil::sendInfo($this->lng->txt("qpl_copy_insert_clipboard"), true);
}
else
{
ilUtil::sendInfo($this->lng->txt("qpl_copy_select_none"), true);
}
$this->ctrl->redirect($this, "questions");
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::createExportExcel ( )

Definition at line 1054 of file class.ilObjQuestionPoolGUI.php.

References $_GET.

{
global $rbacsystem;
if ($rbacsystem->checkAccess("write", $_GET['ref_id']))
{
include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
$question_ids =& $this->object->getAllQuestionIds();
$qpl_exp = new ilQuestionpoolExport($this->object, 'xls', $question_ids);
$qpl_exp->buildExportFile();
$this->ctrl->redirectByClass("ilexportgui", "");
}
}
ilObjQuestionPoolGUI::createExportQTI ( )

create export file

Definition at line 1041 of file class.ilObjQuestionPoolGUI.php.

References $_GET.

{
global $rbacsystem;
if ($rbacsystem->checkAccess("write", $_GET['ref_id']))
{
include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
$question_ids =& $this->object->getAllQuestionIds();
$qpl_exp = new ilQuestionpoolExport($this->object, 'xml', $question_ids);
$qpl_exp->buildExportFile();
$this->ctrl->redirectByClass("ilexportgui", "");
}
}
& ilObjQuestionPoolGUI::createQuestionForTestObject ( )

create new question

Definition at line 690 of file class.ilObjQuestionPoolGUI.php.

References $_GET, $_REQUEST, and assQuestionGUI\_getQuestionGUI().

{
if (!$_REQUEST['q_id']) {
include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
$q_gui =& assQuestionGUI::_getQuestionGUI($_GET["sel_question_types"]);
$q_gui->object->setObjId($this->object->getId());
$q_gui->object->createNewQuestion();
$this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
$this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_REQUEST["sel_question_types"]);
$this->ctrl->setParameterByClass(get_class($q_gui), "prev_qid", $_REQUEST["prev_qid"]);
$this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
}
else {
$class = $_GET["sel_question_types"] . 'gui';
$this->ctrl->setParameterByClass($class, "q_id", $_REQUEST['q_id']);
$this->ctrl->setParameterByClass($class, "sel_question_types", $_REQUEST["sel_question_types"]);
$this->ctrl->setParameterByClass($class, "prev_qid", $_REQUEST["prev_qid"]);
$this->ctrl->redirectByClass($class, "editQuestion");
}
}

+ Here is the call graph for this function:

& ilObjQuestionPoolGUI::createQuestionObject ( )

create new question

Definition at line 676 of file class.ilObjQuestionPoolGUI.php.

References $_POST, and assQuestionGUI\_getQuestionGUI().

{
include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
$q_gui =& assQuestionGUI::_getQuestionGUI($_POST["sel_question_types"]);
$q_gui->object->setObjId($this->object->getId());
$q_gui->object->createNewQuestion();
$this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
$this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_POST["sel_question_types"]);
$this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::deleteQuestionsObject ( )

delete questions confirmation screen

Definition at line 785 of file class.ilObjQuestionPoolGUI.php.

References $_GET, $_POST, ilUtil\sendInfo(), ilUtil\sendQuestion(), and ilQuestionBrowserTableGUI\setEditable().

{
global $rbacsystem;
if (count($_POST["q_id"]) < 1)
{
ilUtil::sendInfo($this->lng->txt("qpl_delete_select_none"), true);
$this->ctrl->redirect($this, "questions");
}
ilUtil::sendQuestion($this->lng->txt("qpl_confirm_delete_questions"));
$deleteable_questions =& $this->object->getDeleteableQuestionDetails($_POST["q_id"]);
include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
$table_gui = new ilQuestionBrowserTableGUI($this, 'questions', (($rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false)), true);
$table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id']));
$table_gui->setData($deleteable_questions);
$this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::download_paragraphObject ( )

download source code paragraph

Definition at line 368 of file class.ilObjQuestionPoolGUI.php.

References $_GET, and exit.

{
include_once("./Services/COPage/classes/class.ilPageObject.php");
$pg_obj =& new ilPageObject("qpl", $_GET["pg_id"]);
$pg_obj->send_paragraph ($_GET["par_id"], $_GET["downloadtitle"]);
}
ilObjQuestionPoolGUI::downloadFileObject ( )

download file

Definition at line 324 of file class.ilObjQuestionPoolGUI.php.

References $_GET, $file, and exit.

{
$file = explode("_", $_GET["file_id"]);
include_once("./Modules/File/classes/class.ilObjFile.php");
$fileObj =& new ilObjFile($file[count($file) - 1], false);
$fileObj->sendFile();
}
& ilObjQuestionPoolGUI::editQuestionForTestObject ( )

edit question

Definition at line 1070 of file class.ilObjQuestionPoolGUI.php.

References $_GET, and assQuestionGUI\_getQuestionGUI().

{
include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
$q_gui =& assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
$this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::executeCommand ( )

execute command

ilLocatorGUI $ilLocator ilAccessHandler $ilAccess ilNavigationHistory $ilNavigationHistory ilTemplate $tpl ilCtrl $ilCtrl ILIAS $ilias

Reimplemented from ilObjectGUI.

Definition at line 83 of file class.ilObjQuestionPoolGUI.php.

References $_GET, $_POST, $cmd, $ilCtrl, $ilErr, ilObjectGUI\$ilias, ilObjectGUI\$ref_id, $ret, ilObjectGUI\$tpl, assQuestionGUI\_getQuestionGUI(), ilMDEditorGUI\addObserver(), ilObjStyleSheet\getContentStylePath(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilUtil\getStyleSheetLocation(), ilObjStyleSheet\getSyntaxStylePath(), infoScreenForward(), and ilObjectGUI\prepareOutput().

{
global $ilLocator, $ilAccess, $ilNavigationHistory, $tpl, $ilCtrl, $ilErr;
if ((!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) && (!$ilAccess->checkAccess("visible", "", $_GET["ref_id"])))
{
global $ilias;
$ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
}
// add entry to navigation history
if (!$this->getCreationMode() &&
$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
{
if('qpl' == $this->object->getType())
{
$ilNavigationHistory->addItem($_GET["ref_id"],
"ilias.php?baseClass=ilObjQuestionPoolGUI&cmd=questions&ref_id=" . $_GET["ref_id"], "qpl");
}
}
$cmd = $this->ctrl->getCmd("questions");
$next_class = $this->ctrl->getNextClass($this);
if( in_array($next_class, array('', 'ilobjquestionpoolgui')) && $cmd == 'questions' )
{
$_GET['q_id'] = '';
}
$this->prepareOutput();
$this->ctrl->setReturn($this, "questions");
$this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
$this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "ta.css", "Modules/Test"), "screen");
if ($_GET["q_id"] < 1)
{
$q_type = ($_POST["sel_question_types"] != "")
? $_POST["sel_question_types"]
: $_GET["sel_question_types"];
}
if ($cmd != "createQuestion" && $cmd != "createQuestionForTest"
&& $next_class != "ilpageobjectgui")
{
if (($_GET["test_ref_id"] != "") or ($_GET["calling_test"]))
{
$ref_id = $_GET["test_ref_id"];
if (!$ref_id)
{
$ref_id = $_GET["calling_test"];
}
}
}
switch($next_class)
{
case "ilcommonactiondispatchergui":
include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
$this->ctrl->forwardCommand($gui);
break;
case 'ilmdeditorgui':
if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
{
$ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
}
include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
$md_gui = new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
$md_gui->addObserver($this->object,'MDUpdateListener','General');
$this->ctrl->forwardCommand($md_gui);
break;
case "ilpageobjectgui":
include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
$this->tpl->setCurrentBlock("ContentStyle");
$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
$this->tpl->parseCurrentBlock();
// syntax style
$this->tpl->setCurrentBlock("SyntaxStyle");
$this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
$this->tpl->parseCurrentBlock();
include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
$q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
$q_gui->setQuestionTabs();
$q_gui->outAdditionalOutput();
$q_gui->object->setObjId($this->object->getId());
$question = $q_gui->object;
$this->ctrl->saveParameter($this, "q_id");
include_once("./Services/COPage/classes/class.ilPageObject.php");
include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
$this->lng->loadLanguageModule("content");
$this->ctrl->setReturnByClass("ilPageObjectGUI", "view");
$this->ctrl->setReturn($this, "questions");
//$page =& new ilPageObject("qpl", $_GET["q_id"]);
$page_gui = new ilPageObjectGUI("qpl", $_GET["q_id"]);
$page_gui->setEditPreview(true);
$page_gui->setEnabledTabs(false);
$page_gui->setEnabledInternalLinks(false);
if (strlen($this->ctrl->getCmd()) == 0 && !isset($_POST["editImagemapForward_x"])) // workaround for page edit imagemaps, keep in mind
{
$this->ctrl->setCmdClass(get_class($page_gui));
$this->ctrl->setCmd("preview");
}
//$page_gui->setQuestionXML($question->toXML(false, false, true));
$page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
$page_gui->setTemplateTargetVar("ADM_CONTENT");
$page_gui->setOutputMode("edit");
$page_gui->setHeader($question->getTitle());
$page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile"));
$page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "fullscreen"));
$page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
$page_gui->setPresentationTitle($question->getTitle());
$ret = $this->ctrl->forwardCommand($page_gui);
$tpl->setContent($ret);
break;
case 'ilpermissiongui':
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui = new ilPermissionGUI($this);
$ret = $this->ctrl->forwardCommand($perm_gui);
break;
case 'ilobjectcopygui':
include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
$cp = new ilObjectCopyGUI($this);
$cp->setType('qpl');
$this->ctrl->forwardCommand($cp);
break;
case "ilexportgui":
include_once("./Services/Export/classes/class.ilExportGUI.php");
$exp_gui = new ilExportGUI($this);
$exp_gui->addFormat("zip", $this->lng->txt('qpl_export_xml'), $this, "createExportQTI");
$exp_gui->addFormat("xls", $this->lng->txt('qpl_export_excel'), $this, "createExportExcel");
// $exp_gui->addCustomColumn($lng->txt("cont_public_access"), $this, "getPublicAccessColValue");
// $exp_gui->addCustomMultiCommand($lng->txt("cont_public_access"), $this, "publishExportFile");
$ret = $this->ctrl->forwardCommand($exp_gui);
break;
case "ilinfoscreengui":
break;
case 'ilassquestionhintsgui':
// set return target
$this->ctrl->setReturn($this, "questions");
// set context tabs
require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
$questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
$questionGUI->object->setObjId($this->object->getId());
$questionGUI->setQuestionTabs();
// forward to ilAssQuestionHintsGUI
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
$gui = new ilAssQuestionHintsGUI($questionGUI);
$ilCtrl->forwardCommand($gui);
break;
case "ilobjquestionpoolgui":
case "":
if( $cmd == 'questions' )
{
$this->ctrl->setParameter($this, 'q_id', '');
}
$cmd.= "Object";
$ret = $this->$cmd();
break;
default:
$this->ctrl->setReturn($this, "questions");
include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
$q_gui = assQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]);
$q_gui->object->setObjId($this->object->getId());
$q_gui->setQuestionTabs();
$ret = $this->ctrl->forwardCommand($q_gui);
break;
}
if (strtolower($_GET["baseClass"]) != "iladministrationgui" &&
$this->getCreationMode() != true)
{
$this->tpl->show();
}
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::exportQuestionObject ( )

export question

Definition at line 834 of file class.ilObjQuestionPoolGUI.php.

References $_POST, $filename, ilUtil\deliverFile(), exit, and ilUtil\sendInfo().

{
// export button was pressed
if (count($_POST["q_id"]) > 0)
{
include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
$qpl_exp = new ilQuestionpoolExport($this->object, "xml", $_POST["q_id"]);
$export_file = $qpl_exp->buildExportFile();
$filename = $export_file;
$filename = preg_replace("/.*\//", "", $filename);
include_once "./Services/Utilities/classes/class.ilUtil.php";
exit();
}
else
{
ilUtil::sendInfo($this->lng->txt("qpl_export_select_none"), true);
}
$this->ctrl->redirect($this, "questions");
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::filterObject ( )

set question list filter

Definition at line 350 of file class.ilObjQuestionPoolGUI.php.

References questionsObject().

{
$this->questionsObject();
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::filterQuestionBrowserObject ( )

Definition at line 855 of file class.ilObjQuestionPoolGUI.php.

References questionsObject().

{
include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
$table_gui = new ilQuestionBrowserTableGUI($this, 'questions');
$table_gui->resetOffset();
$table_gui->writeFilterToSession();
$this->questionsObject();
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::fullscreenObject ( )

show fullscreen view

Definition at line 336 of file class.ilObjQuestionPoolGUI.php.

References $_GET.

{
include_once("./Services/COPage/classes/class.ilPageObject.php");
include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
//$page =& new ilPageObject("qpl", $_GET["pg_id"]);
$page_gui =& new ilPageObjectGUI("qpl", $_GET["pg_id"]);
$page_gui->showMediaFullscreen();
}
ilObjQuestionPoolGUI::getTabs ( $tabs_gui)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Reimplemented from ilObjectGUI.

Definition at line 1194 of file class.ilObjQuestionPoolGUI.php.

References $_GET, and $_POST.

{
global $ilAccess, $ilHelp;
$ilHelp->setScreenIdComponent("qpl");
$next_class = strtolower($this->ctrl->getNextClass());
switch ($next_class)
{
case "":
case "ilpermissiongui":
case "ilmdeditorgui":
case "ilexportgui":
break;
default:
return;
break;
}
// questions
$force_active = false;
$commands = $_POST["cmd"];
if (is_array($commands))
{
foreach ($commands as $key => $value)
{
if (preg_match("/^delete_.*/", $key, $matches) ||
preg_match("/^addSelectGap_.*/", $key, $matches) ||
preg_match("/^addTextGap_.*/", $key, $matches) ||
preg_match("/^deleteImage_.*/", $key, $matches) ||
preg_match("/^upload_.*/", $key, $matches) ||
preg_match("/^addSuggestedSolution_.*/", $key, $matches)
)
{
$force_active = true;
}
}
}
if (array_key_exists("imagemap_x", $_POST))
{
$force_active = true;
}
if (!$force_active)
{
$force_active = ((strtolower($this->ctrl->getCmdClass()) == strtolower(get_class($this)) || strlen($this->ctrl->getCmdClass()) == 0) &&
$this->ctrl->getCmd() == "")
? true
: false;
}
$tabs_gui->addTarget("assQuestions",
$this->ctrl->getLinkTarget($this, "questions"),
array("questions", "filter", "resetFilter", "createQuestion",
"importQuestions", "deleteQuestions", "filterQuestionBrowser",
"view", "preview", "editQuestion", "exec_pg",
"addItem", "upload", "save", "cancel", "addSuggestedSolution",
"cancelExplorer", "linkChilds", "removeSuggestedSolution",
"add", "addYesNo", "addTrueFalse", "createGaps", "saveEdit",
"setMediaMode", "uploadingImage", "uploadingImagemap", "addArea",
"deletearea", "saveShape", "back", "addPair", "uploadingJavaapplet",
"addParameter", "assessment", "addGIT", "addST", "addPG", "delete",
"toggleGraphicalAnswers", "deleteAnswer", "deleteImage", "removeJavaapplet"),
"", "", $force_active);
if ($ilAccess->checkAccess("visible", "", $this->ref_id))
{
$tabs_gui->addTarget("info_short",
$this->ctrl->getLinkTarget($this, "infoScreen"),
array("infoScreen", "showSummary"));
}
if ($ilAccess->checkAccess("write", "", $_GET['ref_id']))
{
// properties
$tabs_gui->addTarget("settings",
$this->ctrl->getLinkTarget($this,'properties'),
"properties", "",
"");
}
// print view
$tabs_gui->addTarget("print_view",
$this->ctrl->getLinkTarget($this,'print'),
array("print"),
"", "");
if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
// meta data
$tabs_gui->addTarget("meta_data",
$this->ctrl->getLinkTargetByClass('ilmdeditorgui','listSection'),
"", "ilmdeditorgui");
// $tabs_gui->addTarget("export",
// $this->ctrl->getLinkTarget($this,'export'),
// array("export", "createExportFile", "confirmDeleteExportFile", "downloadExportFile"),
// "", "");
}
if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$tabs_gui->addTarget("export",
$this->ctrl->getLinkTargetByClass("ilexportgui", ""),
"", "ilexportgui");
}
if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId()))
{
$tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
}
}
ilObjQuestionPoolGUI::ilObjQuestionPoolGUI ( )

Constructor public.

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

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

{
global $lng, $ilCtrl, $rbacsystem;
$lng->loadLanguageModule("assessment");
$this->type = "qpl";
$this->ctrl =& $ilCtrl;
$this->ctrl->saveParameter($this, array("ref_id", "test_ref_id", "calling_test", "test_express_mode", "q_id"));
$this->ilObjectGUI("",$_GET["ref_id"], true, false);
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::importFileObject ( )

form for new questionpool object import

Definition at line 1100 of file class.ilObjQuestionPoolGUI.php.

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

{
$form = $this->initImportForm($_REQUEST["new_type"]);
if($form->checkInput())
{
$this->uploadQplObject();
}
// display form to correct errors
$this->tpl->setContent($form->getHTML());
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::importQuestionsObject ( )

display the import form to import questions into the questionpool

Definition at line 662 of file class.ilObjQuestionPoolGUI.php.

{
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_import_question.html", "Modules/TestQuestionPool");
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("TEXT_IMPORT_QUESTION", $this->lng->txt("import_question"));
$this->tpl->setVariable("TEXT_SELECT_FILE", $this->lng->txt("select_file"));
$this->tpl->setVariable("TEXT_UPLOAD", $this->lng->txt("upload"));
$this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
$this->tpl->parseCurrentBlock();
}
ilObjQuestionPoolGUI::importVerifiedFileObject ( )

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

Definition at line 572 of file class.ilObjQuestionPoolGUI.php.

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

{
if ($_POST["questions_only"] == 1)
{
$newObj =& $this->object;
}
else
{
include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
// create new questionpool object
$newObj = new ilObjQuestionPool(0, true);
// set type of questionpool object
$newObj->setType($_GET["new_type"]);
// set title of questionpool object to "dummy"
$newObj->setTitle("dummy");
// set description of questionpool object
$newObj->setDescription("questionpool import");
// create the questionpool class in the ILIAS database (object_data table)
$newObj->create(true);
// create a reference for the questionpool object in the ILIAS database (object_reference table)
$newObj->createReference();
// put the questionpool object in the administration tree
$newObj->putInTree($_GET["ref_id"]);
// get default permissions and set the permissions for the questionpool object
$newObj->setPermissions($_GET["ref_id"]);
// notify the questionpool object and all its parent objects that a "new" object was created
$newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());
}
// start parsing of QTI files
include_once "./Services/QTI/classes/class.ilQTIParser.php";
$qtiParser = new ilQTIParser($_SESSION["qpl_import_qti_file"], IL_MO_PARSE_QTI, $newObj->getId(), $_POST["ident"]);
$result = $qtiParser->startParsing();
// import page data
if (strlen($_SESSION["qpl_import_xml_file"]))
{
include_once ("./Modules/LearningModule/classes/class.ilContObjParser.php");
$contParser = new ilContObjParser($newObj, $_SESSION["qpl_import_xml_file"], $_SESSION["qpl_import_subdir"]);
$contParser->setQuestionMapping($qtiParser->getImportMapping());
$contParser->startParsing();
}
// set another question pool name (if possible)
$qpl_name = $_POST["qpl_new"];
if ((strcmp($qpl_name, $newObj->getTitle()) != 0) && (strlen($qpl_name) > 0))
{
$newObj->setTitle($qpl_name);
$newObj->update();
}
// delete import directory
include_once "./Services/Utilities/classes/class.ilUtil.php";
if ($_POST["questions_only"] == 1)
{
$this->ctrl->redirect($this, "questions");
}
else
{
ilUtil::sendSuccess($this->lng->txt("object_imported"),true);
ilUtil::redirect("ilias.php?ref_id=".$newObj->getRefId().
"&baseClass=ilObjQuestionPoolGUI");
}
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::infoScreenForward ( )

show information screen

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

References $ilErr.

Referenced by executeCommand(), and infoScreenObject().

{
global $ilErr, $ilAccess;
if(!$ilAccess->checkAccess("visible", "", $this->ref_id))
{
$ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
}
include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
$info = new ilInfoScreenGUI($this);
$info->enablePrivateNotes();
// standard meta data
$info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
$this->ctrl->forwardCommand($info);
}

+ Here is the caller graph for this function:

ilObjQuestionPoolGUI::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 1311 of file class.ilObjQuestionPoolGUI.php.

References infoScreenForward().

{
$this->ctrl->setCmd("showSummary");
$this->ctrl->setCmdClass("ilinfoscreengui");
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::initImportForm (   $a_new_type)
protected

Init object import form.

Parameters
stringnew type
Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

Definition at line 1077 of file class.ilObjQuestionPoolGUI.php.

References ilFileInputGUI\setSuffixes().

Referenced by importFileObject().

{
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setTarget("_top");
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt("import_qpl"));
include_once("./Services/Form/classes/class.ilFileInputGUI.php");
$fi = new ilFileInputGUI($this->lng->txt("import_file"), "xmldoc");
$fi->setSuffixes(array("zip"));
$fi->setRequired(true);
$form->addItem($fi);
$form->addCommandButton("importFile", $this->lng->txt("import"));
$form->addCommandButton("cancel", $this->lng->txt("cancel"));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjQuestionPoolGUI::moveObject ( )

mark one or more question objects for moving

Definition at line 1021 of file class.ilObjQuestionPoolGUI.php.

References $_POST, and ilUtil\sendInfo().

{
if (count($_POST["q_id"]) > 0)
{
foreach ($_POST["q_id"] as $key => $value)
{
$this->object->moveToClipboard($value);
}
ilUtil::sendInfo($this->lng->txt("qpl_move_insert_clipboard"), true);
}
else
{
ilUtil::sendInfo($this->lng->txt("qpl_move_select_none"), true);
}
$this->ctrl->redirect($this, "questions");
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::pasteObject ( )

paste questios from the clipboard into the question pool

Definition at line 984 of file class.ilObjQuestionPoolGUI.php.

References $_SESSION, ilUtil\sendInfo(), and ilUtil\sendSuccess().

{
if (array_key_exists("qpl_clipboard", $_SESSION))
{
$this->object->pasteFromClipboard();
ilUtil::sendSuccess($this->lng->txt("qpl_paste_success"), true);
}
else
{
ilUtil::sendInfo($this->lng->txt("qpl_paste_no_objects"), true);
}
$this->ctrl->redirect($this, "questions");
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::propertiesObject ( )

Questionpool properties.

Definition at line 281 of file class.ilObjQuestionPoolGUI.php.

References ilFormPropertyGUI\setInfo().

{
$save = ((strcmp($this->ctrl->getCmd(), "save") == 0)) ? true : false;
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, 'properties'));
$form->setTitle($this->lng->txt("properties"));
$form->setMultipart(false);
// $form->setTableWidth("100%");
$form->setId("properties");
// online
$online = new ilCheckboxInputGUI($this->lng->txt("qpl_online_property"), "online");
$online->setInfo($this->lng->txt("qpl_online_property_description"));
$online->setChecked($this->object->getOnline());
$form->addItem($online);
$form->addCommandButton("saveProperties", $this->lng->txt("save"));
if ($save)
{
$form->checkInput();
}
$this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::questionObject ( )

Definition at line 775 of file class.ilObjQuestionPoolGUI.php.

References $_GET.

{
//echo "<br>ilObjQuestionPoolGUI->questionObject()";
$type = $_GET["sel_question_types"];
$this->editQuestionForm($type);
}
ilObjQuestionPoolGUI::questionsObject (   $arrFilter = null)

list questions of question pool

Definition at line 876 of file class.ilObjQuestionPoolGUI.php.

References $_GET, $_REQUEST, $_SESSION, ilObjectGUI\$data, $ilUser, ilObjectGUI\$ref_id, ilUtil\redirect(), and ilQuestionBrowserTableGUI\setEditable().

Referenced by filterObject(), filterQuestionBrowserObject(), resetFilterObject(), and resetQuestionBrowserObject().

{
global $rbacsystem;
global $ilUser;
if(get_class($this->object) == "ilObjTest")
{
if ($_GET["calling_test"] > 0)
{
$ref_id = $_GET["calling_test"];
$q_id = $_GET["q_id"];
if ($_REQUEST['test_express_mode']) {
if ($q_id)
ilUtil::redirect("ilias.php?ref_id=".$ref_id."&q_id=".$q_id."&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
else
ilUtil::redirect("ilias.php?ref_id=".$ref_id."&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
}
else
ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&ref_id=".$ref_id."&cmd=questions");
}
}
if($this->object instanceof ilObjQuestionPool)
{
$this->object->purgeQuestions();
}
// reset test_id SESSION variable
$_SESSION["test_id"] = "";
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_qpl_questionbrowser.html", "Modules/TestQuestionPool");
include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
$table_gui = new ilQuestionBrowserTableGUI($this, 'questions', (($rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false)));
$table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id']));
$arrFilter = array();
foreach ($table_gui->getFilterItems() as $item)
{
if ($item->getValue() !== false)
{
$arrFilter[$item->getPostVar()] = $item->getValue();
}
}
$data = $this->object->getQuestionBrowserData($arrFilter);
$table_gui->setData($data);
$this->tpl->setVariable('TABLE', $table_gui->getHTML());
if ($rbacsystem->checkAccess('write', $_GET['ref_id']))
{
$this->tpl->setCurrentBlock("QTypes");
$types =& $this->object->getQuestionTypes(false, true);
//$lastquestiontype = $ilUser->getPref("tst_lastquestiontype");
foreach ($types as $translation => $data)
{
/*if ($data["type_tag"] == $lastquestiontype)
{
$this->tpl->setVariable("QUESTION_TYPE_SELECTED", " selected=\"selected\"");
}*/
$this->tpl->setVariable("QUESTION_TYPE_ID", $data["type_tag"]);
$this->tpl->setVariable("QUESTION_TYPE", $translation);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setVariable("QUESTION_ADD", $this->lng->txt("create"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, 'questions'));
$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjQuestionPoolGUI::resetFilterObject ( )

resets filter

Definition at line 358 of file class.ilObjQuestionPoolGUI.php.

References $_POST, and questionsObject().

{
$_POST["filter_text"] = "";
$_POST["sel_filter_type"] = "";
$this->questionsObject();
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::resetQuestionBrowserObject ( )

Definition at line 864 of file class.ilObjQuestionPoolGUI.php.

References questionsObject().

{
include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
$table_gui = new ilQuestionBrowserTableGUI($this, 'questions');
$table_gui->resetOffset();
$table_gui->resetFilter();
$this->questionsObject();
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::savePropertiesObject ( )

Save questionpool properties.

Definition at line 311 of file class.ilObjQuestionPoolGUI.php.

References $_POST, and ilUtil\sendSuccess().

{
$qpl_online = $_POST["online"];
if (strlen($qpl_online) == 0) $qpl_online = "0";
$this->object->setOnline($qpl_online);
$this->object->saveToDb();
ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true);
$this->ctrl->redirect($this, "properties");
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::setTitleAndDescription ( )

called by prepare output

Reimplemented from ilObjectGUI.

Definition at line 1151 of file class.ilObjQuestionPoolGUI.php.

References $_GET, $title, assQuestionGUI\_getQuestionGUI(), assQuestion\_getQuestionTypeName(), and ilUtil\getImagePath().

{
if ($_GET["q_id"] > 0)
{
include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
$q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
if($q_gui->object instanceof assQuestion)
{
$q_gui->object->setObjId($this->object->getId());
$title = $q_gui->object->getTitle();
if (strcmp($this->ctrl->getCmd(), "assessment") == 0)
{
$title .= " - " . $this->lng->txt("statistics");
}
if(!$title)
{
$title = $this->lng->txt('new').': '.assQuestion::_getQuestionTypeName($q_gui->object->getQuestionType());
}
$this->tpl->setTitle($title);
$this->tpl->setDescription($q_gui->object->getComment());
$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_".$this->object->getType()."_b.png"), $this->lng->txt("obj_qpl"));
}
else
{
// Workaround for context issues: If no object was found, redirect without q_id parameter
$this->ctrl->setParameter($this, 'q_id', '');
$this->ctrl->redirect($this);
}
}
else
{
$this->tpl->setTitle($this->object->getTitle());
$this->tpl->setDescription($this->object->getLongDescription());
$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_".$this->object->getType()."_b.png"), $this->lng->txt("obj_qpl"));
}
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::updateObject ( )

updates object entry in object_data

Reimplemented from ilObjectGUI.

Definition at line 974 of file class.ilObjQuestionPoolGUI.php.

References ilUtil\sendSuccess().

{
// $this->update = $this->object->updateMetaData();
$this->update = $this->object->update();
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::uploadObject ( )

imports question(s) into the questionpool

Definition at line 654 of file class.ilObjQuestionPoolGUI.php.

References uploadQplObject().

{
$this->uploadQplObject(true);
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::uploadQplObject (   $questions_only = false)

imports question(s) into the questionpool

Definition at line 379 of file class.ilObjQuestionPoolGUI.php.

References $_REQUEST, $_SESSION, $file, $GLOBALS, $result, ilObjQuestionPool\_createImportDirectory(), ilObjQuestionPool\_getImportDirectory(), ilObjQuestionPool\_setImportDirectory(), ilObjTest\_setImportDirectory(), CLOZE_TEST_IDENTIFIER, ilUtil\delDir(), ilUtil\getImagePath(), ilPlugin\getPluginObject(), IL_COMP_MODULE, IL_MO_VERIFY_QTI, IMAGEMAP_QUESTION_IDENTIFIER, JAVAAPPLET_QUESTION_IDENTIFIER, MATCHING_QUESTION_IDENTIFIER, ilUtil\moveUploadedFile(), MULTIPLE_CHOICE_QUESTION_IDENTIFIER, NUMERIC_QUESTION_IDENTIFIER, ORDERING_QUESTION_IDENTIFIER, ilUtil\sendFailure(), SINGLE_CHOICE_QUESTION_IDENTIFIER, TEXT_QUESTION_IDENTIFIER, TEXTSUBSET_QUESTION_IDENTIFIER, and ilUtil\unzip().

Referenced by importFileObject(), and uploadObject().

{
$this->ctrl->setParameter($this, 'new_type', $_REQUEST['new_type']);
if ($_FILES["xmldoc"]["error"] > UPLOAD_ERR_OK)
{
ilUtil::sendFailure($this->lng->txt("error_upload"), true);
$this->ctrl->redirect($this, 'create');
return;
}
// create import directory
include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
// copy uploaded file to import directory
$file = pathinfo($_FILES["xmldoc"]["name"]);
$full_path = $basedir."/".$_FILES["xmldoc"]["name"];
$GLOBALS['ilLog']->write(__METHOD__.": full path " . $full_path);
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::moveUploadedFile($_FILES["xmldoc"]["tmp_name"], $_FILES["xmldoc"]["name"], $full_path);
$GLOBALS['ilLog']->write(__METHOD__.": full path " . $full_path);
if (strcmp($_FILES["xmldoc"]["type"], "text/xml") == 0)
{
$qti_file = $full_path;
}
else
{
// unzip file
ilUtil::unzip($full_path);
// determine filenames of xml files
$subdir = basename($file["basename"],".".$file["extension"]);
$xml_file = ilObjQuestionPool::_getImportDirectory().'/'.$subdir.'/'.$subdir.".xml";
$qti_file = ilObjQuestionPool::_getImportDirectory().'/'.$subdir.'/'. str_replace("qpl", "qti", $subdir).".xml";
}
// start verification of QTI files
include_once "./Services/QTI/classes/class.ilQTIParser.php";
$qtiParser = new ilQTIParser($qti_file, IL_MO_VERIFY_QTI, 0, "");
$result = $qtiParser->startParsing();
$founditems =& $qtiParser->getFoundItems();
if (count($founditems) == 0)
{
// nothing found
// delete import directory
ilUtil::delDir($basedir);
ilUtil::sendFailure($this->lng->txt("qpl_import_no_items"), true);
$this->ctrl->redirect($this, 'create');
return;
}
$complete = 0;
$incomplete = 0;
foreach ($founditems as $item)
{
if (strlen($item["type"]))
{
$complete++;
}
else
{
$incomplete++;
}
}
if ($complete == 0)
{
// delete import directory
ilUtil::delDir($basedir);
ilUtil::sendFailure($this->lng->txt("qpl_import_non_ilias_files"), true);
$this->ctrl->redirect($this, 'create');
return;
}
$_SESSION["qpl_import_xml_file"] = $xml_file;
$_SESSION["qpl_import_qti_file"] = $qti_file;
$_SESSION["qpl_import_subdir"] = $subdir;
// display of found questions
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.qpl_import_verification.html",
"Modules/TestQuestionPool");
$row_class = array("tblrow1", "tblrow2");
$counter = 0;
foreach ($founditems as $item)
{
$this->tpl->setCurrentBlock("verification_row");
$this->tpl->setVariable("ROW_CLASS", $row_class[$counter++ % 2]);
$this->tpl->setVariable("QUESTION_TITLE", $item["title"]);
$this->tpl->setVariable("QUESTION_IDENT", $item["ident"]);
include_once "./Services/QTI/classes/class.ilQTIItem.php";
switch ($item["type"])
{
$type = $this->lng->txt("assClozeTest");
break;
$type = $this->lng->txt("assImagemapQuestion");
break;
$type = $this->lng->txt("assJavaApplet");
break;
$type = $this->lng->txt("assMatchingQuestion");
break;
$type = $this->lng->txt("assMultipleChoice");
break;
$type = $this->lng->txt("assSingleChoice");
break;
$type = $this->lng->txt("assOrderingQuestion");
break;
$type = $this->lng->txt("assTextQuestion");
break;
$type = $this->lng->txt("assNumeric");
break;
$type = $this->lng->txt("assTextSubset");
break;
default:
$type = $this->lng->txt($item["type"]);
break;
}
if (strcmp($type, "-" . $item["type"] . "-") == 0)
{
global $ilPluginAdmin;
$pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, "TestQuestionPool", "qst");
foreach ($pl_names as $pl_name)
{
$pl = ilPlugin::getPluginObject(IL_COMP_MODULE, "TestQuestionPool", "qst", $pl_name);
if (strcmp($pl->getQuestionType(), $item["type"]) == 0)
{
$type = $pl->getQuestionTypeTranslation();
}
}
}
$this->tpl->setVariable("QUESTION_TYPE", $type);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("import_qpl");
if (is_file($xml_file))
{
// read file into a string
$fh = @fopen($xml_file, "r") or die("");
$xml = @fread($fh, filesize($xml_file));
@fclose($fh);
if (preg_match("/<ContentObject.*?MetaData.*?General.*?Title[^>]*?>([^<]*?)</", $xml, $matches))
{
$this->tpl->setVariable("VALUE_NEW_QUESTIONPOOL", $matches[1]);
}
}
$this->tpl->setVariable("TEXT_CREATE_NEW_QUESTIONPOOL", $this->lng->txt("qpl_import_create_new_qpl"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("TEXT_TYPE", $this->lng->txt("question_type"));
$this->tpl->setVariable("TEXT_TITLE", $this->lng->txt("question_title"));
$this->tpl->setVariable("FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt("qpl_import_verify_found_questions"));
if ($questions_only)
{
$this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_questions_into_qpl"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
}
else
{
$this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_qpl"));
$this->ctrl->setParameter($this, "new_type", $this->type);
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
//$this->tpl->setVariable("FORMACTION", $this->getFormAction("save","adm_object.php?cmd=gateway&ref_id=".$_GET["ref_id"]."&new_type=".$this->type));
}
$this->tpl->setVariable("ARROW", ilUtil::getImagePath("arrow_downright.png"));
$this->tpl->setVariable("VALUE_IMPORT", $this->lng->txt("import"));
$this->tpl->setVariable("VALUE_CANCEL", $this->lng->txt("cancel"));
$value_questions_only = 0;
if ($questions_only) $value_questions_only = 1;
$this->tpl->setVariable("VALUE_QUESTIONS_ONLY", $value_questions_only);
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilObjQuestionPoolGUI::$object

Definition at line 56 of file class.ilObjQuestionPoolGUI.php.

Referenced by importVerifiedFileObject().


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