19declare(strict_types=1);
35 protected bool $anonymous_test =
false
48 ?array $environment =
null
51 $lng->txt(
'test_question_set_type')
54 $lng->txt(
'test_question_set_type_fixed'),
55 $lng->txt(
'test_question_set_type_fixed_info')
58 $lng->txt(
'test_question_set_type_random'),
59 $lng->txt(
'test_question_set_type_random_info')
62 $trafo =
$refinery->custom()->transformation(
63 static function (
string $v):
bool {
73 $lng->txt(
'tst_anonymity')
76 $lng->txt(
'tst_anonymity_no_anonymization')
79 $lng->txt(
'tst_anonymity_anonymous_test')
81 ->withAdditionalTransformation($trafo);
83 if ($environment[
'participant_data_exists']) {
84 $inputs[
'question_set_type'] =
$inputs[
'question_set_type']->withDisabled(
true);
94 'question_set_type' => [
'text', $this->getQuestionSetType()],
95 'anonymity' => [
'integer', (
int) $this->getAnonymity()]
101 switch ($this->getQuestionSetType()) {
102 case \ilObjTest::QUESTION_SET_TYPE_FIXED:
106 case \ilObjTest::QUESTION_SET_TYPE_RANDOM:
119 return $this->question_set_type;
124 $clone = clone $this;
125 $clone->question_set_type = $question_set_type;
131 return $this->anonymous_test;
136 $clone = clone $this;
137 $clone->anonymous_test = $anonymous_test;
__construct(int $test_id, protected string $question_set_type=\ilObjTest::QUESTION_SET_TYPE_FIXED, protected bool $anonymous_test=false)
toForm(\ilLanguage $lng, FieldFactory $f, Refinery $refinery, ?array $environment=null)
withQuestionSetType(string $question_set_type)
withAnonymity(bool $anonymous_test)
toLog(AdditionalInformationGenerator $additional_info)
const QUESTION_SET_TYPE_FIXED
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...