4require_once 
'./Services/Table/classes/class.ilTable2GUI.php';
 
    5require_once 
'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
 
  115        $this->
setId(
'qpl_brows_tabl_' . $this->testOBJ->getId());
 
  117        parent::__construct($this, self::CMD_BROWSE_QUESTIONS);
 
  122        $this->
setStyle(
'table', 
'fullwidth');
 
  124        $this->
addColumn($this->lng->txt(
"tst_question_title"), 
'title', 
'');
 
  125        $this->
addColumn($this->lng->txt(
"description"), 
'description', 
'');
 
  126        $this->
addColumn($this->lng->txt(
"tst_question_type"), 
'ttype', 
'');
 
  127        $this->
addColumn($this->lng->txt(
"author"), 
'author', 
'');
 
  128        $this->
addColumn($this->lng->txt(
"create_date"), 
'created', 
'');
 
  129        $this->
addColumn($this->lng->txt(
"last_update"), 
'tstamp', 
'');  
 
  131        $this->
addColumn($this->lng->txt(
"working_time"), 
'working_time', 
'');
 
  133        $this->
setRowTemplate(
"tpl.il_as_tst_question_browser_row.html", 
"Modules/Test");
 
  135        $this->
setFormAction($this->ctrl->getFormAction($this->getParentObject(), $this->getParentCmd()));
 
  141        $this->
enable(
'select_all');
 
  148        $this->writeAccess = $value;
 
  159            $this->
addMultiCommand(self::CMD_INSERT_QUESTIONS, $this->lng->txt(
'insert'));
 
  168        switch ($this->ctrl->getNextClass($this)) {
 
  169            case strtolower(__CLASS__):
 
  172                $cmd = $this->ctrl->getCmd() . 
'Cmd';
 
  173                return $this->$cmd();
 
  177                $this->ctrl->setReturn($this, self::CMD_BROWSE_QUESTIONS);
 
  178                return parent::executeCommand();
 
  186        $this->mainTpl->setContent($this->ctrl->getHTML($this));
 
  192        $this->ctrl->redirect($this, self::CMD_BROWSE_QUESTIONS);
 
  198        $this->ctrl->redirect($this, self::CMD_BROWSE_QUESTIONS);
 
  203        $selected_array = (is_array(
$_POST[
'q_id'])) ? 
$_POST[
'q_id'] : array();
 
  204        if (!count($selected_array)) {
 
  206            $this->ctrl->redirect($this, self::CMD_BROWSE_QUESTIONS);
 
  209        include_once 
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
 
  215        foreach ($selected_array as 
$key => $value) {
 
  216            $last_question_id = $this->testOBJ->insertQuestion($testQuestionSetConfig, $value);
 
  223        $this->testOBJ->saveCompleteStatus($testQuestionSetConfig);
 
  238        $this->ctrl->saveParameter($this, self::CONTEXT_PARAMETER);
 
  239        if (isset(
$_GET[self::CONTEXT_PARAMETER])) {
 
  241        } elseif (isset(
$_POST[self::CONTEXT_PARAMETER])) {
 
  245        $this->ctrl->saveParameter($this, self::MODE_PARAMETER);
 
  246        if (isset(
$_GET[self::MODE_PARAMETER])) {
 
  248        } elseif (isset(
$_POST[self::MODE_PARAMETER])) {
 
  255        if (isset(
$_POST[self::CONTEXT_PARAMETER])) {
 
  259        if (isset(
$_GET[self::CONTEXT_PARAMETER])) {
 
  268        if (isset(
$_POST[self::MODE_PARAMETER])) {
 
  272        if (isset(
$_GET[self::MODE_PARAMETER])) {
 
  281        $this->tabs->clearTargets();
 
  282        $this->tabs->clearSubTabs();
 
  284        $this->tabs->setBackTarget(
 
  298        return $this->lng->txt(
'backtocallingtest');
 
  303        return $this->ctrl->getLinkTargetByClass(
 
  314                return 'ilObjTestGUI';
 
  318                return 'ilTestExpressPageObjectGUI';
 
  344                return $this->lng->txt(
'tst_browse_for_qpl_questions');
 
  348                return $this->lng->txt(
'tst_browse_for_tst_questions');
 
  356        return $this->ctrl->getLinkTarget($this, self::CMD_BROWSE_QUESTIONS);
 
  362        include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
 
  363        $ti = 
new ilTextInputGUI($this->lng->txt(
"tst_qbt_filter_question_title"), 
"title");
 
  364        $ti->setMaxLength(64);
 
  366        $ti->setValidationRegexp(
'/(^[^%]+$)|(^$)/is');
 
  368        $ti->readFromSession();
 
  369        $this->filter[
"title"] = $ti->getValue();
 
  372        $ti = 
new ilTextInputGUI($this->lng->txt(
"description"), 
"description");
 
  373        $ti->setMaxLength(64);
 
  375        $ti->setValidationRegexp(
'/(^[^%]+$)|(^$)/is');
 
  377        $ti->readFromSession();
 
  378        $this->filter[
"description"] = $ti->getValue();
 
  381        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
  382        include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
 
  385        $options[
""] = $this->lng->txt(
'filter_all_question_types');
 
  386        foreach ($types as $translation => 
$row) {
 
  393        $si->readFromSession();
 
  394        $this->filter[
"type"] = 
$si->getValue();
 
  398        $ti->setMaxLength(64);
 
  401        $ti->setValidationRegexp(
'/(^[^%]+$)|(^$)/is');
 
  402        $ti->readFromSession();
 
  403        $this->filter[
"author"] = $ti->getValue();
 
  407        $ti->setMaxLength(64);
 
  409        $ti->setValidationRegexp(
'/(^[^%]+$)|(^$)/is');
 
  411        $ti->readFromSession();
 
  412        $this->filter[
'parent_title'] = $ti->getValue();
 
  415        require_once 
'Services/Form/classes/class.ilRepositorySelectorInputGUI.php';
 
  417        $ri->setHeaderMessage($this->lng->txt(
'question_browse_area_info'));
 
  419        $ri->readFromSession();
 
  420        $this->filter[
'repository_root_node'] = $ri->getValue();
 
  428                return $this->lng->txt(
'qpl');
 
  432                return $this->lng->txt(
'tst');
 
  440        $this->tpl->setVariable(
"QUESTION_ID", 
$data[
"question_id"]);
 
  441        $this->tpl->setVariable(
"QUESTION_TITLE", 
$data[
"title"]);
 
  442        $this->tpl->setVariable(
"QUESTION_COMMENT", 
$data[
"description"]);
 
  443        include_once 
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
 
  445        $this->tpl->setVariable(
"QUESTION_AUTHOR", 
$data[
"author"]);
 
  448        $this->tpl->setVariable(
"QUESTION_POOL", 
$data[
'parent_title']);
 
  449        $this->tpl->setVariable(
"WORKING_TIME", 
$data[
'working_time']);
 
  457        require_once 
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
 
  466        return $testQuestionSetConfigFactory->getQuestionSetConfig();
 
  474        $questionList = 
new ilAssQuestionList($this->db, $this->lng, $this->pluginAdmin);
 
  477        $questionList->setExcludeQuestionIdsFilter($this->testOBJ->getExistingQuestions());
 
  482            if ($item->getValue() !== 
false) {
 
  483                switch ($item->getPostVar()) {
 
  490                        $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
 
  493                    case 'repository_root_node':
 
  495                        $repositoryRootNode = $item->getValue();
 
  502        if (!count($parentObjectIds)) {
 
  506        $questionList->setParentObjIdsFilter($parentObjectIds);
 
  508        $questionList->load();
 
  510        return $questionList->getQuestionDataArray();
 
  524        $parents = $this->tree->getSubTree(
 
  525            $this->tree->getNodeData($repositoryRootNode),
 
  527            $this->getQuestionParentObjectType()
 
  530        $parentIds = array();
 
  532        foreach ($parents as $nodeData) {
 
  533            if ($nodeData[
'obj_id'] == $this->testOBJ->getId()) {
 
  537            $parentIds[ $nodeData[
'obj_id'] ] = $nodeData[
'obj_id'];
 
  540        $parentIds = array_map(
'intval', array_values($parentIds));
 
  544            return array_intersect($parentIds, $available_pools);
 
  547            return array_filter($parentIds, 
function ($obj_id) {
 
  549                $refId  = current($refIds);
 
  550                return $this->access->checkAccess(
'write', 
'', $refId);
 
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
An exception for terminatinating execution or to throw for unit testing.
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
static _needsManualScoring($question_id)
const QUESTION_INSTANCE_TYPE_ORIGINALS
const QUESTION_INSTANCE_TYPE_DUPLICATES
This class provides processing control methods.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
static _getQuestionTypes($all_tags=false, $fixOrder=false)
static _getAvailableQuestionpools($use_object_id=false, $equal_points=false, $could_be_offline=false, $showPath=false, $with_questioncount=false, $permission="read", $usr_id="")
Returns the available question pools for the active user.
static _getAllReferences($a_id)
get all reference ids of object
Administration class for plugins.
addHiddenInput($a_name, $a_value)
Add Hidden Input field.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
getFilterItems($a_optionals=false)
Get filter items.
setData($a_data)
set table data @access public
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
resetFilter()
Reset filter.
writeFilterToSession()
Write filter values to session.
setFormName($a_formname="")
Set Form name.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setFilterCommand($a_val, $a_caption=null)
Set filter command.
setStyle($a_element, $a_style)
enable($a_module_name)
enables particular modules of table
special template class to simplify handling of ITX/PEAR
buildTestQuestionSetConfig()
const REPOSITORY_ROOT_NODE_ID
const CMD_BROWSE_QUESTIONS
fillRow($data)
Standard Version of Fill Row.
getQuestionParentObjIds($repositoryRootNode)
getBrowseQuestionsTabUrl()
const CMD_INSERT_QUESTIONS
getQuestionInstanceTypeFilter()
getBrowseQuestionsTabLabel()
__construct(ilCtrl $ctrl, ilTemplate $mainTpl, ilTabsGUI $tabs, ilLanguage $lng, ilTree $tree, ilDBInterface $db, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ, ilAccessHandler $access)
ilTestQuestionBrowserTableGUI constructor.
getQuestionParentObjectType()
executeCommand()
Execute command.
This class represents a text property in a property form.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Interface ilAccessHandler.