Survey page renderer.
More...
◆ __construct()
ILIAS\Survey\Page\PageRenderer::__construct |
( |
\ilObjSurvey |
$survey, |
|
|
array |
$page_data, |
|
|
array |
$working_data = [] , |
|
|
array |
$errors = [] , |
|
|
int |
$question_title_mode = 1 |
|
) |
| |
◆ compressQuestion()
ILIAS\Survey\Page\PageRenderer::compressQuestion |
( |
?array |
$previous_page, |
|
|
array |
$page |
|
) |
| |
|
protected |
Definition at line 157 of file class.PageRenderer.php.
Referenced by ILIAS\Survey\Page\PageRenderer\render().
161 if (is_null($previous_page)) {
165 if ($previous_page[
"type_tag"] === $page[
"type_tag"] &&
166 $page[
"type_tag"] ===
"SurveySingleChoiceQuestion") {
167 if (\SurveySingleChoiceQuestion::compressable($previous_page[
"question_id"], $page[
"question_id"])) {
◆ render()
ILIAS\Survey\Page\PageRenderer::render |
( |
| ) |
|
Definition at line 57 of file class.PageRenderer.php.
References $data, ILIAS\$error, ILIAS\Survey\Page\PageRenderer\$page_data, ILIAS\Survey\Page\PageRenderer\$question_title_mode, ILIAS\Survey\Page\PageRenderer\compressQuestion(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().
62 $stpl = new \ilTemplate(
"tpl.page.html",
true,
true,
"Modules/Survey/Page");
65 if (count($page) > 1 && $page[0][
"questionblock_show_blocktitle"]) {
66 $stpl->setCurrentBlock(
"questionblock_title");
67 $stpl->setVariable(
"TEXT_QUESTIONBLOCK_TITLE", $page[0][
"questionblock_title"]);
68 $stpl->parseCurrentBlock();
72 $compress_view =
false;
73 if (count($page) > 1) {
74 $compress_view = $page[0][
"questionblock_compress_view"];
76 $previous_page = null;
78 foreach ($page as $k =>
$data) {
79 $page[$k][
"compressed"] =
false;
80 $page[$k][
"compressed_first"] =
false;
82 $page[$k][
"compressed"] =
true;
83 if ($previous_key !== null && $page[$previous_key][
"compressed"] ==
false) {
84 $page[$previous_key][
"compressed_first"] =
true;
88 $previous_page =
$data;
92 foreach ($page as
$data) {
95 if ($data[
"heading"]) {
96 $stpl->setCurrentBlock(
"heading");
97 $stpl->setVariable(
"QUESTION_HEADING", $data[
"heading"]);
98 $stpl->parseCurrentBlock();
100 $stpl->setCurrentBlock(
"survey_content");
102 $question_gui = $this->survey->getQuestionGUI($data[
"type_tag"], $data[
"question_id"]);
105 $question_gui->object->setObligatory($data[
"obligatory"]);
108 $show_questiontext = ($data[
"questionblock_show_questiontext"]) ? 1 : 0;
112 if (!$this->survey->getShowQuestionTitles() || $data[
"compressed_first"]) {
115 $working_data = $this->working_data[$data[
"question_id"]] ?? null;
116 $error = $this->errors[$data[
"question_id"]] ??
"";
121 $question_output = $question_gui->getWorkingForm(
126 $this->survey->getSurveyId(),
131 if ($data[
"compressed"]) {
134 $stpl->setVariable(
"CMPR_CLASS",
"il-svy-qst-compressed");
136 $stpl->setVariable(
"QUESTION_OUTPUT", $question_output);
139 $this->
ctrl->setParameter($this,
"qid", $data[
"question_id"]);
141 if ($data[
"obligatory"]) {
144 $stpl->parseCurrentBlock();
149 $stpl->setCurrentBlock(
"required");
150 $stpl->setVariable(
"TEXT_REQUIRED", $this->
lng->txt(
"required_field"));
151 $stpl->parseCurrentBlock();
◆ $ctrl
ilCtrl ILIAS\Survey\Page\PageRenderer::$ctrl |
|
protected |
◆ $errors
array ILIAS\Survey\Page\PageRenderer::$errors = [] |
|
protected |
◆ $lng
◆ $page_data
array ILIAS\Survey\Page\PageRenderer::$page_data |
|
protected |
◆ $question_title_mode
int ILIAS\Survey\Page\PageRenderer::$question_title_mode |
|
protected |
◆ $survey
◆ $working_data
array ILIAS\Survey\Page\PageRenderer::$working_data = [] |
|
protected |
The documentation for this class was generated from the following file: