4include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
 
    5require_once 
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
 
    6require_once 
'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
 
   39            $this->
setId(
"qpl_confirm_del_" . $a_parent_obj->object->getRefId());
 
   41            $this->
setId(
"qpl_qst_brows_" . $a_parent_obj->object->getRefId());
 
   44        parent::__construct($a_parent_obj, $a_parent_cmd);
 
   58        $this->
setStyle(
'table', 
'fullwidth');
 
   61            $this->
addColumn($this->lng->txt(
"title"), 
'title', 
'');
 
   63                if (strcmp($c, 
'description') == 0) {
 
   64                    $this->
addColumn($this->lng->txt(
"description"), 
'description', 
'');
 
   66                if (strcmp($c, 
'type') == 0) {
 
   67                    $this->
addColumn($this->lng->txt(
"question_type"), 
'ttype', 
'');
 
   70                if (strcmp($c, 
'points') == 0) {
 
   71                    $this->
addColumn($this->lng->txt(
"points"), 
'points', 
'', 
false, 
'ilCenterForced');
 
   73                if (strcmp($c, 
'statistics') == 0) {
 
   74                    $this->
addColumn($this->lng->txt(
'statistics'), 
'', 
'');
 
   76                if (strcmp($c, 
'author') == 0) {
 
   77                    $this->
addColumn($this->lng->txt(
"author"), 
'author', 
'');
 
   79                if (strcmp($c, 
'created') == 0) {
 
   80                    $this->
addColumn($this->lng->txt(
"create_date"), 
'created', 
'');
 
   82                if (strcmp($c, 
'tstamp') == 0) {
 
   83                    $this->
addColumn($this->lng->txt(
"last_update"), 
'tstamp', 
'');
 
   85                if (strcmp($c, 
'working_time') == 0) {
 
   86                    $this->
addColumn($this->lng->txt(
"working_time"), 
'working_time', 
'');
 
   89            $this->
addColumn($this->lng->txt(
'actions'), 
'');
 
   92            $this->
addColumn($this->lng->txt(
"title"), 
'title', 
'');
 
   94                if (strcmp($c, 
'description') == 0) {
 
   95                    $this->
addColumn($this->lng->txt(
"description"), 
'description', 
'');
 
   97                if (strcmp($c, 
'type') == 0) {
 
   98                    $this->
addColumn($this->lng->txt(
"question_type"), 
'ttype', 
'');
 
  105                $this->
addCommandButton(
'confirmDeleteQuestions', $this->lng->txt(
'confirm'));
 
  106                $this->
addCommandButton(
'cancelDeleteQuestions', $this->lng->txt(
'cancel'));
 
  115        $this->
setRowTemplate(
"tpl.il_as_qpl_questionbrowser_row.html", 
"Modules/TestQuestionPool");
 
  117        $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
 
  129            $this->
enable(
'select_all');
 
  139        $cols[
"description"] = array(
 
  140            "txt" => 
$lng->txt(
"description"),
 
  143        $cols[
"type"] = array(
 
  144            "txt" => 
$lng->txt(
"question_type"),
 
  147        if (!$this->confirmdelete) {
 
  148            $cols[
"points"] = array(
 
  149                "txt" => 
$lng->txt(
"points"),
 
  152            $cols[
"statistics"] = array(
 
  153                "txt" => 
$lng->txt(
"statistics"),
 
  156            $cols[
"author"] = array(
 
  157                "txt" => 
$lng->txt(
"author"),
 
  160            $cols[
"created"] = array(
 
  161                "txt" => 
$lng->txt(
"create_date"),
 
  164            $cols[
"tstamp"] = array(
 
  165                "txt" => 
$lng->txt(
"last_update"),
 
  168            $cols[
"working_time"] = array(
 
  169                "txt" => 
$lng->txt(
"working_time"),
 
  184        include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
 
  186        $ti->setMaxLength(64);
 
  187        $ti->setValidationRegexp(
'/^[^%]+$/is');
 
  190        $ti->readFromSession();
 
  191        $this->filter[
"title"] = $ti->getValue();
 
  195        $ti->setMaxLength(64);
 
  197        $ti->setValidationRegexp(
'/^[^%]+$/is');
 
  199        $ti->readFromSession();
 
  200        $this->filter[
"description"] = $ti->getValue();
 
  202        if (!$this->confirmdelete) {
 
  205            $ti->setMaxLength(64);
 
  207            $ti->setValidationRegexp(
'/^[^%]+$/is');
 
  209            $ti->readFromSession();
 
  210            $this->filter[
"author"] = $ti->getValue();
 
  213        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
  214        include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
 
  218        foreach ($types as $translation => 
$row) {
 
  225        $si->readFromSession();
 
  226        $this->filter[
"type"] = 
$si->getValue();
 
  228        if ($this->parent_obj->object->getShowTaxonomies()) {
 
  229            require_once 
'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
 
  231            foreach ($this->taxIds as $taxId) {
 
  232                if ($taxId == $this->parent_obj->object->getNavTaxonomyId()) {
 
  236                $postvar = 
"tax_$taxId";
 
  240                $inp->readFromSession();
 
  241                $this->filter[$postvar] = $inp->getValue();
 
  249            if (strcmp(
$column[
'text'], $this->lng->txt(
"points")) == 0) {
 
  250                $this->column[
$key][
'text'] = $this->lng->txt(
"points") . 
" (" . $this->totalPoints . 
")";
 
  251            } elseif (strcmp(
$column[
'text'], $this->lng->txt(
"working_time")) == 0) {
 
  252                $this->column[
$key][
'text'] = $this->lng->txt(
"working_time") . 
" (" . $this->totalWorkingTime . 
")";
 
  255        parent::fillHeader();
 
  268        include_once 
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
 
  269        include_once 
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
 
  271        $this->ctrl->setParameterByClass(
"ilAssQuestionPageGUI", 
"q_id", 
$data[
"question_id"]);
 
  272        $this->ctrl->setParameterByClass(
"ilAssQuestionPreviewGUI", 
"q_id", 
$data[
"question_id"]);
 
  273        $this->ctrl->setParameterByClass($class, 
"q_id", 
$data[
"question_id"]);
 
  277        $actions->setId(
'qst' . 
$data[
"question_id"]);
 
  278        $actions->setListTitle($this->lng->txt(
'actions'));
 
  280        if (!$this->confirmdelete) {
 
  281            $this->tpl->setCurrentBlock(
'checkbox');
 
  282            $this->tpl->setVariable(
'CB_QUESTION_ID', 
$data[
"question_id"]);
 
  283            $this->tpl->parseCurrentBlock();
 
  285            if (
$data[
"complete"] == 0) {
 
  286                $this->tpl->setCurrentBlock(
"qpl_warning");
 
  288                $this->tpl->setVariable(
"ALT_WARNING", $this->lng->txt(
"warning_question_not_complete"));
 
  289                $this->tpl->setVariable(
"TITLE_WARNING", $this->lng->txt(
"warning_question_not_complete"));
 
  290                $this->tpl->parseCurrentBlock();
 
  292                $points = 
$data[
"points"];
 
  295            $this->totalPoints += $points;
 
  298                if (strcmp($c, 
'points') == 0) {
 
  299                    $this->tpl->setCurrentBlock(
'points');
 
  300                    $this->tpl->setVariable(
"QUESTION_POINTS", $points);
 
  301                    $this->tpl->parseCurrentBlock();
 
  303                if (strcmp($c, 
'statistics') == 0) {
 
  304                    $this->tpl->setCurrentBlock(
'statistics');
 
  305                    $this->tpl->setVariable(
"LINK_ASSESSMENT", $this->ctrl->getLinkTargetByClass($class, 
"assessment"));
 
  306                    $this->tpl->setVariable(
"TXT_ASSESSMENT", $this->lng->txt(
"statistics"));
 
  307                    include_once 
"./Services/Utilities/classes/class.ilUtil.php";
 
  308                    $this->tpl->setVariable(
"IMG_ASSESSMENT", 
ilUtil::getImagePath(
"assessment.gif", 
"Modules/TestQuestionPool"));
 
  309                    $this->tpl->parseCurrentBlock();
 
  311                if (strcmp($c, 
'author') == 0) {
 
  312                    $this->tpl->setCurrentBlock(
'author');
 
  313                    $this->tpl->setVariable(
"QUESTION_AUTHOR", 
$data[
"author"]);
 
  314                    $this->tpl->parseCurrentBlock();
 
  316                if (strcmp($c, 
'created') == 0) {
 
  317                    $this->tpl->setCurrentBlock(
'created');
 
  319                    $this->tpl->parseCurrentBlock();
 
  321                if (strcmp($c, 
'tstamp') == 0) {
 
  322                    $this->tpl->setCurrentBlock(
'updated');
 
  324                    $this->tpl->parseCurrentBlock();
 
  326                if (strcmp($c, 
'working_time') == 0) {
 
  327                    $this->tpl->setCurrentBlock(
'working_time');
 
  328                    $this->tpl->setVariable(
'WORKING_TIME', 
$data[
"working_time"]);
 
  329                    $this->tpl->parseCurrentBlock();
 
  335                $editHref = $this->ctrl->getLinkTargetByClass(
$data[
'type_tag'] . 
'GUI', 
'editQuestion');
 
  336                $actions->addItem($this->lng->txt(
'edit_question'), 
'', $editHref);
 
  338                $editPageHref = $this->ctrl->getLinkTargetByClass(
'ilAssQuestionPageGUI', 
'edit');
 
  339                $actions->addItem($this->lng->txt(
'edit_page'), 
'', $editPageHref);
 
  343                $this->ctrl->setParameter($this->parent_obj, 
'q_id', 
$data[
'question_id']);
 
  344                $moveHref = $this->ctrl->getLinkTarget($this->parent_obj, 
'move');
 
  345                $this->ctrl->setParameter($this->parent_obj, 
'q_id', 
null);
 
  346                $actions->addItem($this->lng->txt(
'move'), 
'', $moveHref);
 
  348                $this->ctrl->setParameter($this->parent_obj, 
'q_id', 
$data[
'question_id']);
 
  349                $copyHref = $this->ctrl->getLinkTarget($this->parent_obj, 
'copy');
 
  350                $this->ctrl->setParameter($this->parent_obj, 
'q_id', 
null);
 
  351                $actions->addItem($this->lng->txt(
'copy'), 
'', $copyHref);
 
  353                $this->ctrl->setParameter($this->parent_obj, 
'q_id', 
$data[
'question_id']);
 
  354                $deleteHref = $this->ctrl->getLinkTarget($this->parent_obj, 
'deleteQuestions');
 
  355                $this->ctrl->setParameter($this->parent_obj, 
'q_id', 
null);
 
  356                $actions->addItem($this->lng->txt(
'delete'), 
'', $deleteHref);
 
  360                require_once 
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
 
  361                $this->ctrl->setParameterByClass(
'ilAssQuestionFeedbackEditingGUI', 
'q_id', 
$data[
'question_id']);
 
  363                $this->ctrl->setParameterByClass(
'ilAssQuestionFeedbackEditingGUI', 
'q_id', 
null);
 
  364                $actions->addItem($this->lng->txt(
'tst_feedback'), 
'', $feedbackHref);
 
  366                $this->ctrl->setParameterByClass(
'ilAssQuestionHintsGUI', 
'q_id', 
$data[
'question_id']);
 
  368                $this->ctrl->setParameterByClass(
'ilAssQuestionHintsGUI', 
'q_id', 
null);
 
  369                $actions->addItem($this->lng->txt(
'tst_question_hints_tab'), 
'', $hintsHref);
 
  372            $this->tpl->setCurrentBlock(
'hidden');
 
  373            $this->tpl->setVariable(
'HIDDEN_QUESTION_ID', 
$data[
"question_id"]);
 
  374            $this->tpl->parseCurrentBlock();
 
  378            if (strcmp($c, 
'description') == 0) {
 
  379                $this->tpl->setCurrentBlock(
'description');
 
  380                $this->tpl->setVariable(
"QUESTION_COMMENT", (strlen(
$data[
"description"])) ? 
$data[
"description"] : 
" ");
 
  381                $this->tpl->parseCurrentBlock();
 
  383            if (strcmp($c, 
'type') == 0) {
 
  384                $this->tpl->setCurrentBlock(
'type');
 
  386                $this->tpl->parseCurrentBlock();
 
  389        $this->tpl->setVariable(
'QUESTION_ID', 
$data[
"question_id"]);
 
  390        if (!$this->confirmdelete) {
 
  392            $this->tpl->setVariable(
'QUESTION_TITLE_LINKED', 
$data[
'title']);
 
  393            $this->tpl->setVariable(
'ACTIONS', $actions->getHTML());
 
  395            $this->tpl->setVariable(
'QUESTION_ID_UNLINKED', 
$data[
'question_id']);
 
  396            $this->tpl->setVariable(
'QUESTION_TITLE_UNLINKED', 
$data[
'title']);
 
  402        $this->editable = $value;
 
  412        $this->writeAccess = $value;
 
  426        if (in_array(
$column, array(
'points', 
'created', 
'tstamp'))) {
 
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
An exception for terminatinating execution or to throw for unit testing.
static _getGUIClassNameForId($a_q_id)
static sumTimesInISO8601FormatH_i_s_Extended($time1, $time2)
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
User interface class for advanced drop-down selection lists.
const CMD_SHOW
command constants
const CMD_SHOW_LIST
command constants
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
@classDescription Date and time handling
static _getQuestionTypes($all_tags=false, $fixOrder=false)
getSelectableColumns()
Get selectable columns.
__construct($a_parent_obj, $a_parent_cmd, $a_write_access=false, $confirmdelete=false, $taxIds=array())
Constructor.
getSelectedColumns()
Get selected columns.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
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.
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.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
disable($a_module_name)
diesables particular modules of table
setStyle($a_element, $a_style)
enable($a_module_name)
enables particular modules of table
This class represents a text property in a property form.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)