19declare(strict_types=0);
31 protected ilUIServices $ui_services,
33 protected int $assignment_type
39 array $visible_column_ids,
41 \
ILIAS\Data\Order $order,
42 mixed $additional_viewcontrol_data,
44 mixed $additional_parameters
46 [$column_name, $direction] = $order->join([], fn($ret, $key, $value) => [$key, $value]);
48 uasort($this->data,
function (
$a,
$b) {
49 return strcmp(
$a[
'title'],
$b[
'title']);
52 if ($direction ===
'DESC') {
53 $rows = array_reverse($this->data);
57 foreach ($rows as $row) {
59 ? $row[
'assignment_id']
62 switch ($row[
'ttype']) {
64 $type = $this->
lng->txt(
'tst_question_set_type_fixed');
68 $type = $this->
lng->txt(
'tst_question_set_type_random');
71 $this->
ctrl->setParameterByClass(
'ilobjtestgui',
'ref_id', $row[
'ref_id']);
72 $this->
ctrl->setParameterByClass(
'ilobjtestgui',
'cmd',
'questionsTabGateway');
73 $title_link = $this->ui_services->factory()->link()->standard($row[
'title'], $this->
ctrl->getLinkTargetByClass(
'ilobjtestgui'));
82 if (isset($row[
'qpls']) && count($row[
'qpls']) > 0) {
86 yield $row_builder->buildDataRow(
94 mixed $additional_viewcontrol_data,
96 mixed $additional_parameters
103 int $a_objective_id = 0
109 $tst_data[
'ref_id'] = $tst->getRefId();
110 $tst_data[
'title'] = $tst->getTitle();
111 $tst_data[
'description'] = $tst->getLongDescription();
112 $tst_data[
'ttype'] = $tst->getQuestionSetType();
116 switch ($tst->getQuestionSetType()) {
118 $tst_data[
'qst_info'] = $this->
lng->txt(
'crs_loc_tst_num_qst');
119 $tst_data[
'qst_info'] .= (
' ' . count($tst->getAllQuestions()));
131 $list->loadDefinitions();
134 $translator->loadLabels($list);
135 $tst_data[
'qst_info'] = $this->
lng->txt(
'crs_loc_tst_qpls');
137 foreach ($list as $definition) {
138 $title = $definition->getPoolTitle();
140 $filterTitle[] = $translator->getTaxonomyFilterLabel($definition->getMappedTaxonomyFilter());
141 $filterTitle[] = $translator->getTypeFilterLabel($definition->getTypeFilter());
142 if (!empty($filterTitle)) {
143 $title .=
' -> ' . implode(
' / ', $filterTitle);
145 $tst_data[
'qpls'][] = $title;
149 $tst_data[
'qst_info'] .= (
' ' . 0);
158 int $a_objective_id = 0
160 $this->data = [$this->doParse($a_tst_ref_id, $a_objective_id)];
170 foreach ($available as $assignment) {
172 $tmp = $this->doParse($assignment->getTestRefId(), $assignment->getObjectiveId());
174 $assignment->delete();
179 $tmp[
'assignment_id'] = $assignment->getAssignmentId();
189 foreach ($this->data as $assignment) {
191 ? $assignment[
'assignment_id']
192 : $assignment[
'ref_id'];
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Provides fluid interface to RBAC services.
static lookupObjectiveTitle(int $a_objective_id, bool $a_add_description=false)
Class ilCtrl provides processing control methods.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
parseMultipleAssignments(int $container_id, int $test_type)
parseSingleAssignment(int $a_tst_ref_id, int $a_objective_id=0)
getRows(\ILIAS\UI\Component\Table\DataRowBuilder $row_builder, array $visible_column_ids, \ILIAS\Data\Range $range, \ILIAS\Data\Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
Mainly for the purpose of pagination-support, it is important to know about the total number of recor...
__construct(protected ilLanguage $lng, protected ilDBInterface $db, protected ilUIServices $ui_services, protected ilCtrl $ctrl, protected int $assignment_type)
doParse(int $a_tst_ref_id, int $a_objective_id=0)
const string TABLE_COL_SELECTION_OF_TEST_QUESTIONS
const string TABLE_COL_QESTIONS
const string TABLE_COL_COURSE_OBJECTIVES
const int TYPE_MULTIPLE_ASSIGNMENTS
const string TABLE_COL_TITLE
getAssignmentsByType(int $a_type)
Get assignments by type.
const QUESTION_SET_TYPE_RANDOM
const QUESTION_SET_TYPE_FIXED
Class ilObjectFactory This class offers methods to get instances of the type-specific object classes ...
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples