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';
 
   46            $this->
setId(
"qpl_confirm_del_" . $a_parent_obj->object->getRefId());
 
   48            $this->
setId(
"qpl_qst_brows_" . $a_parent_obj->object->getRefId());
 
   51        parent::__construct($a_parent_obj, $a_parent_cmd);
 
   67        $this->
setStyle(
'table', 
'fullwidth');
 
   70            $this->
addColumn($this->lng->txt(
"title"), 
'title', 
'');
 
   72                if (strcmp(
$c, 
'description') == 0) {
 
   73                    $this->
addColumn($this->lng->txt(
"description"), 
'description', 
'');
 
   75                if (strcmp(
$c, 
'type') == 0) {
 
   76                    $this->
addColumn($this->lng->txt(
"question_type"), 
'ttype', 
'');
 
   79                if (strcmp(
$c, 
'points') == 0) {
 
   80                    $this->
addColumn($this->lng->txt(
"points"), 
'points', 
'', 
false, 
'ilCenterForced');
 
   82                if (strcmp(
$c, 
'statistics') == 0) {
 
   83                    $this->
addColumn($this->lng->txt(
'statistics'), 
'', 
'');
 
   85                if (strcmp(
$c, 
'author') == 0) {
 
   86                    $this->
addColumn($this->lng->txt(
"author"), 
'author', 
'');
 
   89                    $this->
addColumn($this->lng->txt(
"ass_comments"), 
'comments', 
'');
 
   91                if (strcmp(
$c, 
'created') == 0) {
 
   92                    $this->
addColumn($this->lng->txt(
"create_date"), 
'created', 
'');
 
   94                if (strcmp(
$c, 
'tstamp') == 0) {
 
   95                    $this->
addColumn($this->lng->txt(
"last_update"), 
'tstamp', 
'');
 
   97                if (strcmp(
$c, 
'working_time') == 0) {
 
   98                    $this->
addColumn($this->lng->txt(
"working_time"), 
'working_time', 
'');
 
  101            $this->
addColumn($this->lng->txt(
'actions'), 
'');
 
  104            $this->
addColumn($this->lng->txt(
"title"), 
'title', 
'');
 
  106                if (strcmp(
$c, 
'description') == 0) {
 
  107                    $this->
addColumn($this->lng->txt(
"description"), 
'description', 
'');
 
  109                if (strcmp(
$c, 
'type') == 0) {
 
  110                    $this->
addColumn($this->lng->txt(
"question_type"), 
'ttype', 
'');
 
  117                $this->
addCommandButton(
'confirmDeleteQuestions', $this->lng->txt(
'confirm'));
 
  118                $this->
addCommandButton(
'cancelDeleteQuestions', $this->lng->txt(
'cancel'));
 
  127        $this->
setRowTemplate(
"tpl.il_as_qpl_questionbrowser_row.html", 
"Modules/TestQuestionPool");
 
  129        $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
 
  141            $this->
enable(
'select_all');
 
  150            $notesUrl = $this->ctrl->getLinkTargetByClass(
 
  151                array(
"ilcommonactiondispatchergui", 
"ilnotegui"),
 
  186            foreach ($questionData as 
$key => 
$data) {
 
  188                    $this->parent_obj->object->getId(),
 
  189                    $data[
'question_id'],
 
  194                if ($this->filter[
'commented'] && !$numComments) {
 
  195                    unset($questionData[
$key]);
 
  199                $questionData[
$key][
'comments'] = $numComments;
 
  210        $cols[
"description"] = array(
 
  211            "txt" => 
$lng->txt(
"description"),
 
  214        $cols[
"type"] = array(
 
  215            "txt" => 
$lng->txt(
"question_type"),
 
  218        if (!$this->confirmdelete) {
 
  219            $cols[
"points"] = array(
 
  220                "txt" => 
$lng->txt(
"points"),
 
  223            $cols[
"statistics"] = array(
 
  224                "txt" => 
$lng->txt(
"statistics"),
 
  227            $cols[
"author"] = array(
 
  228                "txt" => 
$lng->txt(
"author"),
 
  232                $cols[
"comments"] = array(
 
  233                    "txt" => 
$lng->txt(
"comments"),
 
  237            $cols[
"created"] = array(
 
  238                "txt" => 
$lng->txt(
"create_date"),
 
  241            $cols[
"tstamp"] = array(
 
  242                "txt" => 
$lng->txt(
"last_update"),
 
  245            $cols[
"working_time"] = array(
 
  246                "txt" => 
$lng->txt(
"working_time"),
 
  260        $rbacreview = 
$DIC[
'rbacreview'];
 
  264        include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
 
  266        $ti->setMaxLength(64);
 
  267        $ti->setValidationRegexp(
'/^[^%]+$/is');
 
  270        $ti->readFromSession();
 
  271        $this->filter[
"title"] = $ti->getValue();
 
  275        $ti->setMaxLength(64);
 
  277        $ti->setValidationRegexp(
'/^[^%]+$/is');
 
  279        $ti->readFromSession();
 
  280        $this->filter[
"description"] = $ti->getValue();
 
  282        if (!$this->confirmdelete) {
 
  285            $ti->setMaxLength(64);
 
  287            $ti->setValidationRegexp(
'/^[^%]+$/is');
 
  289            $ti->readFromSession();
 
  290            $this->filter[
"author"] = $ti->getValue();
 
  293        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
  294        include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
 
  298        foreach ($types as $translation => 
$row) {
 
  305        $si->readFromSession();
 
  306        $this->filter[
"type"] = 
$si->getValue();
 
  308        if ($this->parent_obj->object->getShowTaxonomies()) {
 
  309            require_once 
'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
 
  311            foreach ($this->taxIds as $taxId) {
 
  312                if ($taxId == $this->parent_obj->object->getNavTaxonomyId()) {
 
  316                $postvar = 
"tax_$taxId";
 
  320                $inp->readFromSession();
 
  321                $this->filter[$postvar] = $inp->getValue();
 
  329            $comments->readFromSession();
 
  330            $this->filter[
'commented'] = $comments->getChecked();
 
  336        foreach ($this->column as 
$key => $column) {
 
  337            if (strcmp($column[
'text'], $this->lng->txt(
"points")) == 0) {
 
  338                $this->column[
$key][
'text'] = $this->lng->txt(
"points") . 
" (" . $this->totalPoints . 
")";
 
  339            } elseif (strcmp($column[
'text'], $this->lng->txt(
"working_time")) == 0) {
 
  340                $this->column[
$key][
'text'] = $this->lng->txt(
"working_time") . 
" (" . $this->totalWorkingTime . 
")";
 
  343        parent::fillHeader();
 
  357        $ilAccess = 
$DIC[
'ilAccess'];
 
  358        include_once 
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
 
  359        include_once 
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
 
  361        $this->ctrl->setParameterByClass(
"ilAssQuestionPageGUI", 
"q_id", 
$data[
"question_id"]);
 
  362        $this->ctrl->setParameterByClass(
"ilAssQuestionPreviewGUI", 
"q_id", 
$data[
"question_id"]);
 
  363        $this->ctrl->setParameterByClass($class, 
"q_id", 
$data[
"question_id"]);
 
  367        $actions->setId(
'qst' . 
$data[
"question_id"]);
 
  368        $actions->setListTitle($this->lng->txt(
'actions'));
 
  370        if (!$this->confirmdelete) {
 
  371            $this->tpl->setCurrentBlock(
'checkbox');
 
  372            $this->tpl->setVariable(
'CB_QUESTION_ID', 
$data[
"question_id"]);
 
  373            $this->tpl->parseCurrentBlock();
 
  375            if (
$data[
"complete"] == 0) {
 
  376                $this->tpl->setCurrentBlock(
"qpl_warning");
 
  378                $this->tpl->setVariable(
"ALT_WARNING", $this->lng->txt(
"warning_question_not_complete"));
 
  379                $this->tpl->setVariable(
"TITLE_WARNING", $this->lng->txt(
"warning_question_not_complete"));
 
  380                $this->tpl->parseCurrentBlock();
 
  382                $points = 
$data[
"points"];
 
  385            $this->totalPoints += $points;
 
  388                if (strcmp(
$c, 
'points') == 0) {
 
  389                    $this->tpl->setCurrentBlock(
'points');
 
  390                    $this->tpl->setVariable(
"QUESTION_POINTS", $points);
 
  391                    $this->tpl->parseCurrentBlock();
 
  393                if (strcmp(
$c, 
'statistics') == 0) {
 
  394                    $this->tpl->setCurrentBlock(
'statistics');
 
  395                    $this->tpl->setVariable(
"LINK_ASSESSMENT", $this->ctrl->getLinkTargetByClass($class, 
"assessment"));
 
  396                    $this->tpl->setVariable(
"TXT_ASSESSMENT", $this->lng->txt(
"statistics"));
 
  397                    include_once 
"./Services/Utilities/classes/class.ilUtil.php";
 
  398                    $this->tpl->setVariable(
"IMG_ASSESSMENT", 
ilUtil::getImagePath(
"assessment.gif", 
"Modules/TestQuestionPool"));
 
  399                    $this->tpl->parseCurrentBlock();
 
  401                if (strcmp(
$c, 
'author') == 0) {
 
  402                    $this->tpl->setCurrentBlock(
'author');
 
  403                    $this->tpl->setVariable(
"QUESTION_AUTHOR", 
$data[
"author"]);
 
  404                    $this->tpl->parseCurrentBlock();
 
  407                    $this->tpl->setCurrentBlock(
'comments');
 
  409                    $this->tpl->parseCurrentBlock();
 
  411                if (strcmp(
$c, 
'created') == 0) {
 
  412                    $this->tpl->setCurrentBlock(
'created');
 
  414                    $this->tpl->parseCurrentBlock();
 
  416                if (strcmp(
$c, 
'tstamp') == 0) {
 
  417                    $this->tpl->setCurrentBlock(
'updated');
 
  419                    $this->tpl->parseCurrentBlock();
 
  421                if (strcmp(
$c, 
'working_time') == 0) {
 
  422                    $this->tpl->setCurrentBlock(
'working_time');
 
  423                    $this->tpl->setVariable(
'WORKING_TIME', 
$data[
"working_time"]);
 
  424                    $this->tpl->parseCurrentBlock();
 
  430                $editHref = $this->ctrl->getLinkTargetByClass(
$data[
'type_tag'] . 
'GUI', 
'editQuestion');
 
  431                $actions->addItem($this->lng->txt(
'edit_question'), 
'', $editHref);
 
  433                $editPageHref = $this->ctrl->getLinkTargetByClass(
'ilAssQuestionPageGUI', 
'edit');
 
  434                $actions->addItem($this->lng->txt(
'edit_page'), 
'', $editPageHref);
 
  438                $this->ctrl->setParameter($this->parent_obj, 
'q_id', 
$data[
'question_id']);
 
  439                $moveHref = $this->ctrl->getLinkTarget($this->parent_obj, 
'move');
 
  440                $this->ctrl->setParameter($this->parent_obj, 
'q_id', 
null);
 
  441                $actions->addItem($this->lng->txt(
'move'), 
'', $moveHref);
 
  443                $this->ctrl->setParameter($this->parent_obj, 
'q_id', 
$data[
'question_id']);
 
  444                $copyHref = $this->ctrl->getLinkTarget($this->parent_obj, 
'copy');
 
  445                $this->ctrl->setParameter($this->parent_obj, 
'q_id', 
null);
 
  446                $actions->addItem($this->lng->txt(
'copy'), 
'', $copyHref);
 
  448                $this->ctrl->setParameter($this->parent_obj, 
'q_id', 
$data[
'question_id']);
 
  449                $deleteHref = $this->ctrl->getLinkTarget($this->parent_obj, 
'deleteQuestions');
 
  450                $this->ctrl->setParameter($this->parent_obj, 
'q_id', 
null);
 
  451                $actions->addItem($this->lng->txt(
'delete'), 
'', $deleteHref);
 
  455                require_once 
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
 
  456                $this->ctrl->setParameterByClass(
'ilAssQuestionFeedbackEditingGUI', 
'q_id', 
$data[
'question_id']);
 
  458                $this->ctrl->setParameterByClass(
'ilAssQuestionFeedbackEditingGUI', 
'q_id', 
null);
 
  459                $actions->addItem($this->lng->txt(
'tst_feedback'), 
'', $feedbackHref);
 
  461                $this->ctrl->setParameterByClass(
'ilAssQuestionHintsGUI', 
'q_id', 
$data[
'question_id']);
 
  463                $this->ctrl->setParameterByClass(
'ilAssQuestionHintsGUI', 
'q_id', 
null);
 
  464                $actions->addItem($this->lng->txt(
'tst_question_hints_tab'), 
'', $hintsHref);
 
  469                    $this->lng->txt(
'ass_comments'),
 
  477                    $this->getCommentsAjaxLink(
$data[
'question_id'])
 
  481            $this->tpl->setCurrentBlock(
'hidden');
 
  482            $this->tpl->setVariable(
'HIDDEN_QUESTION_ID', 
$data[
"question_id"]);
 
  483            $this->tpl->parseCurrentBlock();
 
  487            if (strcmp(
$c, 
'description') == 0) {
 
  488                $this->tpl->setCurrentBlock(
'description');
 
  489                $this->tpl->setVariable(
"QUESTION_COMMENT", (strlen(
$data[
"description"])) ? 
$data[
"description"] : 
" ");
 
  490                $this->tpl->parseCurrentBlock();
 
  492            if (strcmp(
$c, 
'type') == 0) {
 
  493                $this->tpl->setCurrentBlock(
'type');
 
  495                $this->tpl->parseCurrentBlock();
 
  498        $this->tpl->setVariable(
'QUESTION_ID', 
$data[
"question_id"]);
 
  499        if (!$this->confirmdelete) {
 
  501            $this->tpl->setVariable(
'QUESTION_TITLE_LINKED', 
$data[
'title']);
 
  502            $this->tpl->setVariable(
'ACTIONS', $actions->getHTML());
 
  504            $this->tpl->setVariable(
'QUESTION_ID_UNLINKED', 
$data[
'question_id']);
 
  505            $this->tpl->setVariable(
'QUESTION_TITLE_UNLINKED', 
$data[
'title']);
 
  511        $this->editable = $value;
 
  521        $this->writeAccess = $value;
 
  535        if (in_array($column, array(
'points', 
'created', 
'tstamp', 
'comments'))) {
 
  544        if (!$qData[
'comments']) {
 
  550        return "<a class='comment' href='#' onclick=\"return " . $ajaxLink . 
"\"> 
  552            . 
"' alt='{$qData['comments']}'><span class='ilHActProp'>{$qData['comments']}</span></a>";
 
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 buildAjaxHash( $a_node_type, $a_node_id, $a_obj_type, $a_obj_id, $a_sub_type=null, $a_sub_id=null, $a_news_id=0)
Build ajax hash.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
static getListCommentsJSCall($a_hash, $a_update_code=null)
Get list comments js call.
static initJavascript($a_ajax_url, $a_type=IL_NOTE_PRIVATE, ilTemplate $a_main_tpl=null)
Init javascript.
static _getNotesOfObject( $a_rep_obj_id, $a_obj_id, $a_obj_type, $a_type=IL_NOTE_PRIVATE, $a_incl_sub=false, $a_filter="", $a_all_public="y", $a_repository_mode=true, $a_sort_ascending=false, $a_news_id=0)
get all notes related to a specific object
static _getQuestionTypes($all_tags=false, $fixOrder=false, $withDeprecatedTypes=true)
setQuestionCommentingEnabled(bool $questionCommentingEnabled)
isCommentsColumnSelected()
$questionCommentingEnabled
isQuestionCommentingEnabled()
__construct($a_parent_obj, $a_parent_cmd, $a_write_access=false, $confirmdelete=false, $taxIds=array(), $enableCommenting=false)
Constructor.
getSelectableColumns()
Get selectable columns.
getCommentsAjaxLink($questionId)
setQuestionData($questionData)
getSelectedColumns()
Get selected columns.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
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.
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)