1 <?php declare(strict_types=1);
24 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
25 $this->
setRowTemplate(
'tpl.il_as_tst_random_question_offer.html',
'Modules/Test');
33 public function build(
int $numberOfQuestions,
int $selectedPool) : self
35 $this->
setTitle($this->lng->txt(
'tst_question_offer'));
37 $questionIds = $this->test->randomSelectQuestions(
41 $questionpools = $this->test->getAvailableQuestionpools(
true);
44 foreach ($questionIds as $questionId) {
45 $dataset = $this->test->getQuestionDataset($questionId);
47 'title' => $dataset->title,
48 'description' => $dataset->description,
50 'author' => $dataset->author,
51 'pool' => $questionpools[$dataset->obj_fi][
'title'],
58 $this->
addHiddenInput(
'chosen_questions', implode(
',', $questionIds));
60 $this->
addColumn($this->lng->txt(
'tst_question_title'));
61 $this->
addColumn($this->lng->txt(
'description'));
62 $this->
addColumn($this->lng->txt(
'tst_question_type'));
63 $this->
addColumn($this->lng->txt(
'author'));
68 if (count(
$data) > 0) {
69 $this->
addCommandButton(
'insertRandomSelection', $this->lng->txt(
'random_accept_sample'));
70 $this->
addCommandButton(
'createRandomSelection', $this->lng->txt(
'random_another_sample'));
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
addHiddenInput($a_name, $a_value)
Add Hidden Input field.
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
setNoEntriesText($a_text)
Set text for an empty table.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTestRandomQuestionSelectionTableGUI.
__construct($a_parent_obj, string $a_parent_cmd, ilObjTest $test)
ilTestRandomQuestionSelectionTableGUI constructor.
build(int $numberOfQuestions, int $selectedPool)
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
__construct(Container $dic, ilPlugin $plugin)
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.
getRefId()
get reference id public