Skip to content

Commit

Permalink
fixed export of compress view
Browse files Browse the repository at this point in the history
  • Loading branch information
alex40724 committed Mar 17, 2022
1 parent 6b0c61e commit 398dd0f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Modules/Survey/classes/class.ilObjSurvey.php
Original file line number Diff line number Diff line change
Expand Up @@ -3390,7 +3390,8 @@ public function toXML()
$attribs = array("id" => $question_array[0]["question_id"]);
$attribs = array(
"showQuestiontext" => $question_array[0]["questionblock_show_questiontext"],
"showBlocktitle" => $question_array[0]["questionblock_show_blocktitle"]
"showBlocktitle" => $question_array[0]["questionblock_show_blocktitle"],
"compressView" => $question_array[0]["questionblock_compress_view"]
);
$a_xml_writer->xmlStartTag("questionblock", $attribs);
if (strlen($question_array[0]["questionblock_title"])) {
Expand Down
21 changes: 20 additions & 1 deletion Services/Survey/classes/class.SurveyImportParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
*/
class SurveyImportParser extends ilSaxParser
{
protected int $showQuestiontext;
protected int $showBlocktitle;
protected int $compressView;
public $path;
public $depth;
public $activequestion;
Expand Down Expand Up @@ -89,6 +92,8 @@ public function __construct($a_spl_id, $a_xml_file = '', $spl_exists = false, $a
$this->questionblocks = array();
$this->questionblock = array();
$this->showQuestiontext = 1;
$this->showBlocktitle = 0;
$this->compressView = 0;
$this->questionblocktitle = "";
$this->mapping = $a_mapping;
}
Expand Down Expand Up @@ -179,11 +184,19 @@ public function handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
$this->questionblock = array();
$this->questionblocktitle = "";
$this->showQuestiontext = 1;
$this->showBlocktitle = 0;
$this->compressView = 0;
foreach ($a_attribs as $attrib => $value) {
switch ($attrib) {
case "showQuestiontext":
$this->showQuestiontext = $value;
break;
case "showBlocktitle":
$this->showBlocktitle = $value;
break;
case "compressView":
$this->compressView = $value;
break;
}
}
break;
Expand Down Expand Up @@ -411,7 +424,13 @@ public function handlerEndTag($a_xml_parser, $a_name)
foreach ($questionblock as $question_id) {
array_push($qblock, $this->questions[$question_id]);
}
$this->survey->createQuestionblock($title, $this->showQuestiontext, false, $qblock);
$this->survey->createQuestionblock(
$title,
$this->showQuestiontext,
$this->showBlocktitle,
$qblock,
$this->compressView
);
}
}

Expand Down

0 comments on commit 398dd0f

Please sign in to comment.