ILIAS  Release_4_1_x_branch Revision 61804
 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.
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 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
 importObject ()
 display dialogue for importing questionpools
createQuestionObject ()
 create new question
createQuestionForTestObject ()
 create new question
 saveObject ()
 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
 printObject ()
 Creates a print view for a 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
 exportObject ()
 createExportFileObject ()
 create export file
 downloadExportFileObject ()
 download export file
 confirmDeleteExportFileObject ()
 confirmation screen for export file deletion
 cancelDeleteExportFileObject ()
 cancel deletion of export files
 deleteExportFileObject ()
 delete export files
editQuestionForTestObject ()
 edit question
 createObject ()
 form for new content object creation
 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
 _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 ()
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 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.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

Additional Inherited Members

- 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
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 showUpperIcon ()
 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)
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 afterUpdate ()
 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)
 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="")

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

References $_GET, $ilErr, ilObjectGUI\$lng, 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))
{
$_GET["cmd"] = "frameset";
$_GET["target"] = "";
$_GET["ref_id"] = ROOT_FOLDER_ID;
ilUtil::sendInfo(sprintf($lng->txt("msg_no_perm_read_item"),
include("repository.php");
}
$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 1274 of file class.ilObjQuestionPoolGUI.php.

References $_GET, and assQuestionGUI\_getQuestionGUI().

{
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"]);
$q_gui->object->setObjId($this->object->getId());
if ($_GET["q_id"] > 0)
{
$ilLocator->addItem($q_gui->object->getTitle(), $this->ctrl->getLinkTargetByClass(get_class($q_gui), "editQuestion"));
}
}
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::assessmentObject ( )

show assessment data of object

Definition at line 698 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::cancelDeleteExportFileObject ( )

cancel deletion of export files

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

{
session_unregister("ilExportFiles");
$this->ctrl->redirect($this, "export");
}
ilObjQuestionPoolGUI::cancelDeleteQuestionsObject ( )

Cancel question deletion.

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

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

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

References $_POST.

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

cancel action and go back to previous page public

Reimplemented from ilObjectGUI.

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

References $_GET, and ilUtil\redirect().

{
ilUtil::redirect("repository.php?cmd=frameset&ref_id=".$_GET["ref_id"]);
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::confirmDeleteExportFileObject ( )

confirmation screen for export file deletion

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

References $_POST, ilObjectGUI\$data, ilDatePresentation\formatDate(), IL_CAL_UNIX, ilUtil\sendInfo(), and ilUtil\sendQuestion().

{
if(!isset($_POST["file"]))
{
ilUtil::sendInfo($this->lng->txt("no_checkbox"),true);
$this->ctrl->redirect($this, "export");
}
ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionPoolExportTableGUI.php";
$table_gui = new ilQuestionPoolExportTableGUI($this, 'export', true);
$export_dir = $this->object->getExportDirectory();
$data = array();
foreach ($_POST['file'] as $exp_file)
{
$file_arr = explode("__", $exp_file);
array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir."/".$exp_file)));
}
$table_gui->setData($data);
$this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::confirmDeleteQuestionsObject ( )

delete questions

Definition at line 779 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);
}
if (count($_POST["q_id"])) ilUtil::sendSuccess($this->lng->txt("qpl_questions_deleted"), true);
$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 1027 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::createExportFileObject ( )

create export file

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

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

{
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, $_POST["exporttype"], $question_ids);
$qpl_exp->buildExportFile();
$this->ctrl->redirect($this, "export");
}
else
{
ilUtil::sendInfo("cannot_export_qpl", TRUE);
$this->ctrl->redirect($this, "export");
}
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::createObject ( )

form for new content object creation

Reimplemented from ilObjectGUI.

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

References $_GET, $_POST, $_SESSION, ilObjectGUI\$data, ilFrameTargetInfo\_getFrame(), ilObjectGUI\fillCloneTemplate(), ilUtil\getImagePath(), ilObjectGUI\getTemplateFile(), and ilUtil\prepareFormOutput().

Referenced by importFileObject().

{
global $rbacsystem;
$new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
else
{
$this->getTemplateFile("create", $new_type);
$this->fillCloneTemplate('DUPLICATE','qpl');
$this->tpl->setCurrentBlock("adm_content");
// fill in saved values in case of error
$data = array();
$data["fields"] = array();
include_once "./Services/Utilities/classes/class.ilUtil.php";
$data["fields"]["title"] = ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["title"],true);
$data["fields"]["desc"] = ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["desc"]);
foreach ($data["fields"] as $key => $val)
{
$this->tpl->setVariable("TXT_".strtoupper($key), $this->lng->txt($key));
$this->tpl->setVariable(strtoupper($key), $val);
if ($this->prepare_output)
{
$this->tpl->parseCurrentBlock();
}
}
$this->ctrl->setParameter($this, "new_type", $this->type);
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_HEADER", $this->lng->txt($new_type."_new"));
$this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
$this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt($new_type."_add"));
$this->tpl->setVariable("CMD_SUBMIT", "save");
$this->tpl->setVariable("TARGET", ' target="'.
ilFrameTargetInfo::_getFrame("MainContent").'" ');
$this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
$this->tpl->setVariable("TXT_IMPORT_QPL", $this->lng->txt("import_qpl"));
$this->tpl->setVariable("TXT_QPL_FILE", $this->lng->txt("qpl_upload_file"));
$this->tpl->setVariable("NEW_TYPE", $this->type);
$this->tpl->setVariable("TXT_IMPORT", $this->lng->txt("import"));
$this->tpl->setVariable("TYPE_IMG", ilUtil::getImagePath('icon_qpl.gif'));
$this->tpl->setVariable("ALT_IMG",$this->lng->txt("obj_qpl"));
$this->tpl->setVariable("TYPE_IMG2", ilUtil::getImagePath('icon_qpl.gif'));
$this->tpl->setVariable("ALT_IMG2",$this->lng->txt("obj_qpl"));
$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilObjQuestionPoolGUI::createQuestionForTestObject ( )

create new question

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

References $_GET, and assQuestionGUI\_getQuestionGUI().

{
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", $_GET["sel_question_types"]);
$this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
}

+ Here is the call graph for this function:

& ilObjQuestionPoolGUI::createQuestionObject ( )

create new question

Definition at line 635 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::deleteExportFileObject ( )

delete export files

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

References $_POST, $file, ilUtil\delDir(), ilStr\strLen(), and ilStr\subStr().

{
include_once "./Services/Utilities/classes/class.ilUtil.php";
$export_dir = $this->object->getExportDirectory();
foreach($_POST['file'] as $file)
{
$exp_file = $export_dir."/".$file;
include_once "./Services/Utilities/classes/class.ilStr.php";
$exp_dir = $export_dir."/".ilStr::subStr($file, 0, ilStr::strLen($file) - 4);
if (@is_file($exp_file))
{
unlink($exp_file);
}
if (@is_dir($exp_dir))
{
ilUtil::delDir($exp_dir);
}
}
$this->ctrl->redirect($this, "export");
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::deleteQuestionsObject ( )

delete questions confirmation screen

Definition at line 756 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 308 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::downloadExportFileObject ( )

download export file

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

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

{
if(!isset($_POST["file"]))
{
ilUtil::sendInfo($this->lng->txt("no_checkbox"), true);
$this->ctrl->redirect($this, "export");
}
if (count($_POST["file"]) > 1)
{
ilUtil::sendInfo($this->lng->txt("cont_select_max_one_item"), true);
$this->ctrl->redirect($this, "export");
}
$export_dir = $this->object->getExportDirectory();
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::deliverFile($export_dir."/".$_POST["file"][0],
$_POST["file"][0]);
$this->ctrl->redirect($this, "export");
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::downloadFileObject ( )

download file

Definition at line 264 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 1192 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

Reimplemented from ilObjectGUI.

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

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

{
global $ilLocator, $ilAccess, $ilNavigationHistory, $tpl;
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"]))
{
$ilNavigationHistory->addItem($_GET["ref_id"],
"ilias.php?baseClass=ilObjQuestionPoolGUI&cmd=questions&ref_id=".$_GET["ref_id"], "qpl");
}
$this->prepareOutput();
$cmd = $this->ctrl->getCmd("questions");
$next_class = $this->ctrl->getNextClass($this);
$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 'ilmdeditorgui':
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)
{
$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 "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::exportObject ( )

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

References ilObjectGUI\$data, ilDatePresentation\formatDate(), and IL_CAL_UNIX.

{
include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionPoolExportTableGUI.php";
$table_gui = new ilQuestionPoolExportTableGUI($this, 'export');
$export_dir = $this->object->getExportDirectory();
$export_files = $this->object->getExportFiles($export_dir);
$data = array();
foreach ($export_files as $exp_file)
{
$file_arr = explode("__", $exp_file);
array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir."/".$exp_file)));
}
$table_gui->setData($data);
$this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::exportQuestionObject ( )

export question

Definition at line 801 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 290 of file class.ilObjQuestionPoolGUI.php.

References questionsObject().

{
$this->questionsObject();
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::filterQuestionBrowserObject ( )

Definition at line 822 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 276 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 1331 of file class.ilObjQuestionPoolGUI.php.

References $_GET, and $_POST.

{
global $ilAccess;
$next_class = $this->ctrl->getNextClass($this);
switch ($next_class)
{
case "":
case "ilpermissiongui":
case "ilmdeditorgui":
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("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", "", $_GET['ref_id']))
{
// meta data
$tabs_gui->addTarget("meta_data",
$this->ctrl->getLinkTargetByClass('ilmdeditorgui','listSection'),
"", "ilmdeditorgui");
// export
$tabs_gui->addTarget("export",
$this->ctrl->getLinkTarget($this,'export'),
array("export", "createExportFile", "confirmDeleteExportFile", "downloadExportFile"),
"", "");
}
if ($ilAccess->checkAccess("edit_permission", "", $_GET['ref_id']))
{
$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 54 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"));
$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 1263 of file class.ilObjQuestionPoolGUI.php.

References createObject(), ilUtil\sendInfo(), and uploadQplObject().

{
if (strcmp($_FILES["xmldoc"]["tmp_name"], "") == 0)
{
ilUtil::sendInfo($this->lng->txt("qpl_select_file_for_import"));
$this->createObject();
return;
}
$this->uploadQplObject();
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::importObject ( )

display dialogue for importing questionpools

public

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

References $_GET, and ilObjectGUI\getTemplateFile().

Referenced by uploadQplObject().

{
global $rbacsystem;
if (!$rbacsystem->checkAccess("create", $_GET["ref_id"]))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
$this->getTemplateFile("import", "qpl");
$this->ctrl->setParameter($this, "new_type", $this->type);
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
//$this->tpl->setVariable("FORMACTION", "adm_object.php?&ref_id=".$_GET["ref_id"]."&cmd=gateway&new_type=".$this->type);
$this->tpl->setVariable("BTN_NAME", "uploadQpl");
$this->tpl->setVariable("TXT_UPLOAD", $this->lng->txt("import"));
$this->tpl->setVariable("NEW_TYPE", $this->type);
$this->tpl->setVariable("TXT_IMPORT_QPL", $this->lng->txt("import_qpl"));
$this->tpl->setVariable("TXT_SELECT_MODE", $this->lng->txt("select_mode"));
$this->tpl->setVariable("TXT_SELECT_FILE", $this->lng->txt("select_file"));
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjQuestionPoolGUI::importQuestionsObject ( )

display the import form to import questions into the questionpool

Definition at line 596 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 506 of file class.ilObjQuestionPoolGUI.php.

References $_GET, $_POST, $_SESSION, ilObjectGUI\$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::moveObject ( )

mark one or more question objects for moving

Definition at line 1047 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 1010 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::printObject ( )

Creates a print view for a question pool.

public

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

References $_POST, ilObjectGUI\$data, $pass, $row, ilObjQuestionPool\_getFullPathToQpl(), assQuestion\_getQuestionTypeName(), assQuestion\_instanciateQuestionGUI(), ilDatePresentation\formatDate(), ilUtil\getStyleSheetLocation(), IL_CAL_UNIX, and ilUtil\prepareFormOutput().

{
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_qpl_printview.html", "Modules/TestQuestionPool");
switch ($_POST["output"])
{
case 'detailed':
$this->tpl->setVariable("SELECTED_DETAILED", " selected=\"selected\"");
break;
case 'detailed_printview':
$this->tpl->setVariable("SELECTED_DETAILED_PRINTVIEW", " selected=\"selected\"");
break;
default:
break;
}
$this->tpl->setVariable("TEXT_DETAILED", $this->lng->txt("detailed_output_solutions"));
$this->tpl->setVariable("TEXT_DETAILED_PRINTVIEW", $this->lng->txt("detailed_output_printview"));
$this->tpl->setVariable("TEXT_OVERVIEW", $this->lng->txt("overview"));
$this->tpl->setVariable("TEXT_SUBMIT", $this->lng->txt("submit"));
$this->tpl->setVariable("OUTPUT_MODE", $this->lng->txt("output_mode"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, 'print'));
include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionPoolPrintViewTableGUI.php";
$table_gui = new ilQuestionPoolPrintViewTableGUI($this, 'print', $_POST['output']);
$data =& $this->object->getPrintviewQuestions();
$table_gui->setData($data);
$this->tpl->setVariable('TABLE', $table_gui->getHTML());
return;
$sortorder = array(
"title" => $this->lng->txt("title"),
"description" => $this->lng->txt("description"),
"type" => $this->lng->txt("question_type"),
"author" => $this->lng->txt("author"),
"created" => $this->lng->txt("create_date"),
"updated" => $this->lng->txt("last_update")
);
foreach ($sortorder as $value => $text)
{
$this->tpl->setCurrentBlock("sortorder");
$this->tpl->setVariable("VALUE_SORTORDER", $value);
$this->tpl->setVariable("TEXT_SORTORDER", $text);
if (strcmp($sort, $value) == 0)
{
$this->tpl->setVariable("SELECTED_SORTORDER", " selected=\"selected\"");
}
$this->tpl->parseCurrentBlock();
}
$table =& $this->object->getPrintviewQuestions($sort);
$colors = array("tblrow1top", "tblrow2top");
$counter = 1;
include_once "./classes/class.ilFormat.php";
foreach ($table as $row)
{
if ((strcmp($_POST["output"], "detailed") == 0) || (strcmp($_POST["output"], "detailed_printview") == 0))
{
$this->tpl->setCurrentBlock("overview_row_detail");
$this->tpl->setVariable("ROW_CLASS", $colors[$counter % 2]);
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$question_gui = assQuestion::_instanciateQuestionGUI($row["question_id"]);
if (strcmp($_POST["output"], "detailed") == 0)
{
$solutionoutput = $question_gui->getSolutionOutput($active_id = "", $pass = NULL, $graphicalOutput = FALSE, $result_output = FALSE, $show_question_only = FALSE, $show_feedback = FALSE, $show_correct_solution = true, $show_manual_scoring = false);
if (strlen($solutionoutput) == 0) $solutionoutput = $question_gui->getPreview();
$this->tpl->setVariable("PREVIEW", $solutionoutput);
}
else
{
$this->tpl->setVariable("PREVIEW", $question_gui->getPreview());
}
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("overview_row_detail");
$this->tpl->setVariable("ROW_CLASS", $colors[$counter % 2]);
$this->tpl->parseCurrentBlock();
}
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$this->tpl->setCurrentBlock("overview_row");
$this->tpl->setVariable("ROW_CLASS", $colors[$counter % 2]);
$this->tpl->setVariable("TEXT_COUNTER", $counter);
$this->tpl->setVariable("TEXT_TITLE", ilUtil::prepareFormOutput($row["title"]));
$this->tpl->setVariable("TEXT_DESCRIPTION", ilUtil::prepareFormOutput($row["description"]));
$this->tpl->setVariable("TEXT_QUESTIONTYPE", assQuestion::_getQuestionTypeName($row["type_tag"]));
$this->tpl->setVariable("TEXT_AUTHOR", $row["author"]);
$this->tpl->setVariable("TEXT_CREATED", ilDatePresentation::formatDate(new ilDate($row["created"],IL_CAL_UNIX)));
$this->tpl->setVariable("TEXT_UPDATED", ilDatePresentation::formatDate(new ilDate($row["tstamp"],IL_CAL_UNIX)));
$this->tpl->parseCurrentBlock();
$counter++;
}
$this->tpl->setCurrentBlock("overview");
$this->tpl->setVariable("TEXT_TITLE", $this->lng->txt("title"));
$this->tpl->setVariable("TEXT_DESCRIPTION", $this->lng->txt("description"));
$this->tpl->setVariable("TEXT_QUESTIONTYPE", $this->lng->txt("question_type"));
$this->tpl->setVariable("TEXT_AUTHOR", $this->lng->txt("author"));
$this->tpl->setVariable("TEXT_CREATED", $this->lng->txt("create_date"));
$this->tpl->setVariable("TEXT_UPDATED", $this->lng->txt("last_update"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("SORT_TEXT", $this->lng->txt("sort_by_this_column"));
$this->tpl->setVariable("TEXT_SUBMIT", $this->lng->txt("submit"));
$this->tpl->setVariable("PRINT", $this->lng->txt("print"));
$this->tpl->parseCurrentBlock();
$this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
$this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "ta.css", "Modules/Test"), "screen");
$this->tpl->setVariable("PAGETITLE", " - " . ilUtil::prepareFormOutput(ilObjQuestionPool::_getFullPathToQpl($this->object->getRefId()) . " > " . $this->object->getTitle()));
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::propertiesObject ( )

Questionpool properties.

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

References ilFormPropertyGUI\setInfo().

{
$save = ((strcmp($this->ctrl->getCmd(), "save") == 0)) ? true : false;
// $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_qpl_properties.html", "Modules/TestQuestionPool");
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 746 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 843 of file class.ilObjQuestionPoolGUI.php.

References $_GET, $_SESSION, ilObjectGUI\$data, and ilQuestionBrowserTableGUI\setEditable().

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

{
global $rbacsystem;
global $ilUser;
$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();
$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 298 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 831 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::saveObject ( )

save object public

Reimplemented from ilObjectGUI.

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

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

{
global $rbacadmin;
if (!strlen($_POST['Fobject']['title']))
{
ilUtil::sendFailure($this->lng->txt('title_required'), true);
$this->ctrl->setParameter($this, 'new_type', $_GET['new_type']);
$this->ctrl->redirect($this, 'create');
}
// create and insert forum in objecttree
$newObj = parent::saveObject();
// always send a message
ilUtil::sendSuccess($this->lng->txt("object_added"),true);
ilUtil::redirect("ilias.php?ref_id=".$newObj->getRefId().
"&baseClass=ilObjQuestionPoolGUI");
/* if (strlen($this->ctrl->getModuleDir()) == 0)
{
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::redirect($this->getReturnLocation("save","adm_object.php?ref_id=".$_GET["ref_id"]));
}
else
{
$this->ctrl->redirect($this, "questions");
}*/
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::savePropertiesObject ( )

Save questionpool properties.

Definition at line 251 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 1302 of file class.ilObjQuestionPoolGUI.php.

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

{
if ($_GET["q_id"] > 0)
{
include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
$q_gui =& assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
$q_gui->object->setObjId($this->object->getId());
$title = $q_gui->object->getTitle();
if (strcmp($this->ctrl->getCmd(), "assessment") == 0)
{
$title .= " - " . $this->lng->txt("statistics");
}
$this->tpl->setTitle($title);
$this->tpl->setDescription($q_gui->object->getComment());
$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_".$this->object->getType()."_b.gif"), $this->lng->txt("obj_qpl"));
}
else
{
$this->tpl->setTitle($this->object->getTitle());
$this->tpl->setDescription($this->object->getLongDescription());
$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_".$this->object->getType()."_b.gif"), $this->lng->txt("obj_qpl"));
}
}

+ Here is the call graph for this function:

ilObjQuestionPoolGUI::updateObject ( )

updates object entry in object_data

public

Reimplemented from ilObjectGUI.

Definition at line 1000 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 588 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 319 of file class.ilObjQuestionPoolGUI.php.

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

Referenced by importFileObject(), and uploadObject().

{
if ($_FILES["xmldoc"]["error"] > UPLOAD_ERR_OK)
{
ilUtil::sendFailure($this->lng->txt("error_upload"));
$this->importObject();
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 = ilObjQuestionPool::_getImportDirectory()."/".$_FILES["xmldoc"]["name"];
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::moveUploadedFile($_FILES["xmldoc"]["tmp_name"], $_FILES["xmldoc"]["name"], $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::sendInfo($this->lng->txt("qpl_import_no_items"));
$this->importObject();
return;
}
$complete = 0;
$incomplete = 0;
foreach ($founditems as $item)
{
if (strlen($item["type"]))
{
$complete++;
}
else
{
$incomplete++;
}
}
if ($complete == 0)
{
// delete import directory
ilUtil::sendInfo($this->lng->txt("qpl_import_non_ilias_files"));
$this->importObject();
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");
$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.gif"));
$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:


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