19 declare(strict_types=1);
    38     protected \ILIAS\Notes\Service 
$notes;
    57         $a_write_access = 
false,
    60         $enableCommenting = 
false    66             $this->
setId(
"qpl_confirm_del_" . $a_parent_obj->getObject()->getRefId());
    68             $this->
setId(
"qpl_qst_brows_" . $a_parent_obj->getObject()->getRefId());
    74         $this->
lng = $DIC[
'lng'];
    75         $this->
ctrl = $DIC[
'ilCtrl'];
    76         $this->renderer = $DIC->ui()->renderer();
    77         $this->ui_factory = $DIC->ui()->factory();
    79         $local_dic = QuestionPoolDIC::dic();
    80         $this->request = $local_dic[
'request_data_collector'];
    81         $this->questionrepository = $local_dic[
'question.general_properties.repository'];
    90         $this->
setStyle(
'table', 
'fullwidth');
    95                 if (strcmp(
$c, 
'description') == 0) {
    96                     $this->
addColumn($this->
lng->txt(
"description"), 
'description', 
'');
    98                 if (strcmp(
$c, 
'type') == 0) {
    99                     $this->
addColumn($this->
lng->txt(
"question_type"), 
'ttype', 
'');
   102                 if (strcmp(
$c, 
'points') == 0) {
   103                     $this->
addColumn($this->
lng->txt(
"points"), 
'points', 
'', 
false, 
'ilCenterForced');
   105                 if (strcmp(
$c, 
'statistics') == 0) {
   106                     $this->
addColumn($this->
lng->txt(
'statistics'), 
'', 
'');
   108                 if (strcmp(
$c, 
'author') == 0) {
   109                     $this->
addColumn($this->
lng->txt(
"author"), 
'author', 
'');
   111                 if (
$c == 
'lifecycle') {
   112                     $this->
addColumn($this->
lng->txt(
'qst_lifecycle'), 
'lifecycle', 
'');
   115                     $this->
addColumn($this->
lng->txt(
"ass_comments"), 
'comments', 
'');
   117                 if (strcmp(
$c, 
'created') == 0) {
   118                     $this->
addColumn($this->
lng->txt(
"create_date"), 
'created', 
'');
   120                 if (strcmp(
$c, 
'tstamp') == 0) {
   121                     $this->
addColumn($this->
lng->txt(
"last_update"), 
'tstamp', 
'');
   127             $this->
addColumn($this->
lng->txt(
"title"), 
'title', 
'');
   129                 if (strcmp(
$c, 
'description') == 0) {
   130                     $this->
addColumn($this->
lng->txt(
"description"), 
'description', 
'');
   132                 if (strcmp(
$c, 
'type') == 0) {
   133                     $this->
addColumn($this->
lng->txt(
"question_type"), 
'ttype', 
'');
   150         $this->
setRowTemplate(
"tpl.il_as_qpl_questionbrowser_row.html", 
"components/ILIAS/TestQuestionPool");
   164             $this->
enable(
'select_all');
   169         $this->notes = $DIC->notes();
   171             $this->notes->gui()->initJavascript();
   199             foreach ($questionData as $key => 
$data) {
   200                 $notes_context = $this->notes
   203                         $this->parent_obj->getObject()->getId(),
   204                         $data[
'question_id'],
   207                 $numComments = $this->notes
   209                     ->getNrOfCommentsForContext($notes_context);
   211                 if ($this->
filter[
'commented'] && !$numComments) {
   212                     unset($questionData[$key]);
   216                 $questionData[$key][
'comments'] = $numComments;
   227         $cols[
"description"] = [
   228             "txt" => 
$lng->
txt(
"description"),
   232             "txt" => 
$lng->
txt(
"question_type"),
   235         if (!$this->confirmdelete) {
   240             $cols[
"statistics"] = [
   241                 "txt" => 
$lng->
txt(
"statistics"),
   248             $cols[
'lifecycle'] = [
   249                 'txt' => 
$lng->
txt(
'qst_lifecycle'),
   253                 $cols[
"comments"] = [
   254                     "txt" => 
$lng->
txt(
"comments"),
   259                 "txt" => 
$lng->
txt(
"create_date"),
   263                 "txt" => 
$lng->
txt(
"last_update"),
   279         $ti->setMaxLength(64);
   280         $ti->setValidationRegexp(
'/^[^%]+$/is');
   283         $ti->readFromSession();
   284         $this->
filter[
"title"] = $ti->getValue();
   288         $ti->setMaxLength(64);
   290         $ti->setValidationRegexp(
'/^[^%]+$/is');
   292         $ti->readFromSession();
   293         $this->
filter[
"description"] = $ti->getValue();
   295         if (!$this->confirmdelete) {
   298             $ti->setMaxLength(64);
   300             $ti->setValidationRegexp(
'/^[^%]+$/is');
   302             $ti->readFromSession();
   303             $this->
filter[
"author"] = $ti->getValue();
   307         $lifecycleOptions = array_merge(
   308             [
'' => $this->
lng->txt(
'qst_lifecycle_filter_all')],
   314         $lifecycleInp->readFromSession();
   315         $this->
filter[
'lifecycle'] = $lifecycleInp->getValue();
   319         $options[
""] = 
$lng->
txt(
'filter_all_question_types');
   320         foreach ($types as $translation => $row) {
   321             $options[$row[
'type_tag']] = $translation;
   327         $si->readFromSession();
   328         $this->
filter[
"type"] = $si->getValue();
   330         foreach ($this->taxIds as $taxId) {
   331             $postvar = 
"tax_$taxId";
   335             $inp->readFromSession();
   336             $this->
filter[$postvar] = $inp->getValue();
   350         foreach ($this->column as $key => 
$column) {
   351             if (strcmp(
$column[
'text'], $this->
lng->txt(
"points")) == 0) {
   352                 $this->column[$key][
'text'] = $this->
lng->txt(
"points") . 
" (" . $this->totalPoints . 
")";
   355         parent::fillHeader();
   366         $class = strtolower($this->questionrepository->getForQuestionId($a_set[
'question_id'])->getGuiClassName());
   367         $this->
ctrl->setParameterByClass(
"ilAssQuestionPageGUI", 
"q_id", $a_set[
"question_id"]);
   368         $this->
ctrl->setParameterByClass(
"ilAssQuestionPreviewGUI", 
"q_id", $a_set[
"question_id"]);
   369         $this->
ctrl->setParameterByClass($class, 
"q_id", $a_set[
"question_id"]);
   374         if (!$this->confirmdelete) {
   375             $this->tpl->setCurrentBlock(
'checkbox');
   376             $this->tpl->setVariable(
'CB_QUESTION_ID', $a_set[
"question_id"]);
   377             $this->tpl->parseCurrentBlock();
   379             if ($a_set[
"complete"] == 0) {
   380                 $icon = $this->ui_factory->symbol()->icon()->custom(
ilUtil::getImagePath(
"standard/icon_alert.svg"), $this->
lng->txt(
"warning_question_not_complete"));
   381                 $this->tpl->setCurrentBlock(
"qpl_warning");
   382                 $this->tpl->setVariable(
"ICON_WARNING", $this->renderer->render(
$icon));
   383                 $this->tpl->parseCurrentBlock();
   385                 $points = $a_set[
"points"];
   387             $this->totalPoints += $points;
   390                 if (strcmp($c, 
'points') == 0) {
   391                     $this->tpl->setCurrentBlock(
'points');
   392                     $this->tpl->setVariable(
"QUESTION_POINTS", $points);
   393                     $this->tpl->parseCurrentBlock();
   395                 if (strcmp($c, 
'statistics') == 0) {
   396                     $this->tpl->setCurrentBlock(
'statistics');
   398                     $this->tpl->setVariable(
"TXT_ASSESSMENT", $this->
lng->txt(
"statistics"));
   399                     $this->tpl->setVariable(
"IMG_ASSESSMENT", 
ilUtil::getImagePath(
"assessment.gif", 
"components/ILIAS/TestQuestionPool"));
   400                     $this->tpl->parseCurrentBlock();
   402                 if (strcmp($c, 
'author') == 0) {
   403                     $this->tpl->setCurrentBlock(
'author');
   404                     $this->tpl->setVariable(
"QUESTION_AUTHOR", $a_set[
"author"]);
   405                     $this->tpl->parseCurrentBlock();
   407                 if ($c == 
'lifecycle') {
   410                     $this->tpl->setCurrentBlock(
'lifecycle');
   411                     $this->tpl->setVariable(
"QUESTION_LIFECYCLE", 
$lifecycle->getTranslation($this->lng));
   412                     $this->tpl->parseCurrentBlock();
   415                     $this->tpl->setCurrentBlock(
'comments');
   417                     $this->tpl->parseCurrentBlock();
   419                 if (strcmp($c, 
'created') == 0) {
   420                     $this->tpl->setCurrentBlock(
'created');
   422                     $this->tpl->parseCurrentBlock();
   424                 if (strcmp($c, 
'tstamp') == 0) {
   425                     $this->tpl->setCurrentBlock(
'updated');
   427                     $this->tpl->parseCurrentBlock();
   431             $actions[] = $this->ui_factory->link()->standard(
   432                 $this->
lng->txt(
'preview'),
   436             $actions[] = $this->ui_factory->link()->standard(
   437                 $this->
lng->txt(
'statistics'),
   442                 $this->
ctrl->setParameterByClass($a_set[
'type_tag'] . 
'GUI', 
'q_id', $a_set[
'question_id']);
   443                 $editHref = $this->
ctrl->getLinkTargetByClass($a_set[
'type_tag'] . 
'GUI', 
'editQuestion');
   444                 $this->
ctrl->setParameterByClass($a_set[
'type_tag'] . 
'GUI', 
'q_id', null);
   445                 $actions[] = $this->ui_factory->link()->standard($this->
lng->txt(
'edit_question'), $editHref);
   447                 $editPageHref = $this->
ctrl->getLinkTargetByClass(
'ilAssQuestionPageGUI', 
'edit');
   448                 $actions[] = $this->ui_factory->link()->standard($this->
lng->txt(
'edit_page'), $editPageHref);
   452                 $this->
ctrl->setParameter($this->parent_obj, 
'q_id', $a_set[
'question_id']);
   453                 $moveHref = $this->
ctrl->getLinkTarget($this->parent_obj, 
'move');
   454                 $this->
ctrl->setParameter($this->parent_obj, 
'q_id', null);
   455                 $actions[] = $this->ui_factory->link()->standard($this->
lng->txt(
'move'), $moveHref);
   457                 $this->
ctrl->setParameter($this->parent_obj, 
'q_id', $a_set[
'question_id']);
   458                 $copyHref = $this->
ctrl->getLinkTarget($this->parent_obj, 
'copy');
   459                 $this->
ctrl->setParameter($this->parent_obj, 
'q_id', null);
   460                 $actions[] = $this->ui_factory->link()->standard($this->
lng->txt(
'copy'), $copyHref);
   462                 $this->
ctrl->setParameter($this->parent_obj, 
'q_id', $a_set[
'question_id']);
   463                 $deleteHref = $this->
ctrl->getLinkTarget($this->parent_obj, 
'deleteQuestions');
   464                 $this->
ctrl->setParameter($this->parent_obj, 
'q_id', null);
   465                 $actions[] = $this->ui_factory->link()->standard($this->
lng->txt(
'delete'), $deleteHref);
   469                 $this->
ctrl->setParameterByClass(
'ilAssQuestionFeedbackEditingGUI', 
'q_id', $a_set[
'question_id']);
   471                 $this->
ctrl->setParameterByClass(
'ilAssQuestionFeedbackEditingGUI', 
'q_id', null);
   472                 $actions[] = $this->ui_factory->link()->standard($this->
lng->txt(
'tst_feedback'), $feedbackHref);
   474                 $this->
ctrl->setParameterByClass(
'ilAssQuestionHintsGUI', 
'q_id', $a_set[
'question_id']);
   476                 $this->
ctrl->setParameterByClass(
'ilAssQuestionHintsGUI', 
'q_id', null);
   477                 $actions[] = $this->ui_factory->link()->standard($this->
lng->txt(
'tst_question_hints_tab'), $hintsHref);
   481                 $actions[] = $this->ui_factory->link()->standard($this->
lng->txt(
'ass_comments'), $this->
getCommentsAjaxLink($a_set[
'question_id']));
   484             $this->tpl->setCurrentBlock(
'hidden');
   485             $this->tpl->setVariable(
'HIDDEN_QUESTION_ID', $a_set[
"question_id"]);
   486             $this->tpl->parseCurrentBlock();
   490             if (strcmp($c, 
'description') == 0) {
   491                 $this->tpl->setCurrentBlock(
'description');
   492                 $this->tpl->setVariable(
"QUESTION_COMMENT", $a_set[
'description']);
   493                 $this->tpl->parseCurrentBlock();
   495             if (strcmp($c, 
'type') == 0) {
   496                 $this->tpl->setCurrentBlock(
'type');
   497                 $this->tpl->setVariable(
"QUESTION_TYPE", $this->questionrepository->getForQuestionId($a_set[
"question_id"])->getTypeName($this->
lng));
   498                 $this->tpl->parseCurrentBlock();
   501         $this->tpl->setVariable(
'QUESTION_ID', $a_set[
"question_id"]);
   502         if (!$this->confirmdelete) {
   504             $this->tpl->setVariable(
'QUESTION_TITLE_LINKED', $a_set[
'title']);
   506             $dropdown = $this->ui_factory->dropdown()->standard($actions)->withLabel($this->
lng->txt(
'actions'));
   508             $this->tpl->setVariable(
'ACTIONS', $this->renderer->render($dropdown));
   510             $this->tpl->setVariable(
'QUESTION_ID_UNLINKED', $a_set[
'question_id']);
   511             $this->tpl->setVariable(
'QUESTION_TITLE_UNLINKED', $a_set[
'title']);
   517         $this->editable = $value;
   527         $this->writeAccess = $value;
   541         if (in_array($a_field, [
'points', 
'created', 
'tstamp', 
'comments'])) {
   550         if (!$qData[
'comments']) {
   556         $comment_glyph = $this->ui_factory->symbol()->glyph()->comment()->withCounter(
   557             $this->ui_factory->counter()->status($qData[
'comments'])
   559             return "document.getElementById('$id').onclick = function (event) { $ajax_link; };";
   561         return $this->renderer->render($comment_glyph);
   567         $update_code = 
"il.UI.counter.getCounterObject($(\".ilTableOuter\")).incrementStatusCount(1);";
 
static getInstance($identifier)
 
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ilObjUser $user=null,)
 
enable(string $a_module_name)
 
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
 
__construct( $a_parent_obj, $a_parent_cmd, $a_write_access=false, $confirmdelete=false, $taxIds=[], $enableCommenting=false)
 
setFormAction(string $a_form_action, bool $a_multipart=false)
 
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
 
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
setResetCommand(string $a_val, string $a_caption="")
 
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
withAdditionalOnLoadCode(Closure $binder)
 
GeneralQuestionPropertiesRepository $questionrepository
 
setFormName(string $a_name="")
 
const CMD_SHOW_LIST
command constants 
 
setStyle(string $a_element, string $a_style)
 
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector. 
 
$questionCommentingEnabled
 
setDefaultOrderField(string $a_defaultorderfield)
 
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template. 
 
setFilterCommand(string $a_val, string $a_caption="")
 
isQuestionCommentingEnabled()
 
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory) 
 
setDefaultOrderDirection(string $a_defaultorderdirection)
 
getCommentsAjaxLink($questionId)
 
ILIAS Notes Service $notes
 
fillRow(array $a_set)
fill row  public 
 
RequestDataCollector $request
 
ILIAS UI Factory $ui_factory
 
isCommentsColumnSelected()
 
setQuestionCommentingEnabled(bool $questionCommentingEnabled)
 
setQuestionData($questionData)
 
static buildAjaxHash(int $node_type, ?int $node_id, string $obj_type, int $obj_id, string $sub_type=null, int $sub_id=null, int $news_id=0)
Build ajax hash. 
 
__construct(Container $dic, ilPlugin $plugin)
 
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
 
disable(string $a_module_name)
 
ILIAS UI Renderer $renderer
 
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
 
static getListCommentsJSCall(string $a_hash, string $a_update_code=null)
Get list comments js call. 
 
addMultiCommand(string $a_cmd, string $a_text)
 
numericOrdering(string $a_field)
 
static getDraftInstance()
 
static _getQuestionTypes($all_tags=false, $fixOrder=false, $withDeprecatedTypes=true)