diff --git a/application/helpers/export_helper.php b/application/helpers/export_helper.php index b1bbff04d14..2c8d0824e21 100644 --- a/application/helpers/export_helper.php +++ b/application/helpers/export_helper.php @@ -1039,7 +1039,7 @@ function quexml_create_multi(&$question,$qid,$varname,$scale_id = false,$free = else $response->appendChild(QueXMLCreateFree($free['f'],$free['len'],$Row['question'])); - $response->setAttribute("varName",$varname . QueXMLCleanup($Row['title'])); + $response->setAttribute("varName",QueXMLCleanup($Row['title'])); $question->appendChild($response); } @@ -1105,7 +1105,7 @@ function quexml_create_subQuestions(&$question,$qid,$varname,$use_answers = fals $subQuestion = $dom->createElement("subQuestion"); $text = $dom->createElement("text",QueXMLCleanup($Row['question'],'')); $subQuestion->appendChild($text); - $subQuestion->setAttribute("varName",$varname . QueXMLCleanup($Row['title'])); + $subQuestion->setAttribute("varName",$varname .'_'. QueXMLCleanup($Row['title'])); $question->appendChild($subQuestion); } diff --git a/application/libraries/admin/quexmlpdf.php b/application/libraries/admin/quexmlpdf.php index 26d1640a6e0..c2e5aa17473 100644 --- a/application/libraries/admin/quexmlpdf.php +++ b/application/libraries/admin/quexmlpdf.php @@ -1695,6 +1695,17 @@ protected function createQuestion($question) $bgtype = 3; //box group type temp set to 3 (text) + // question with > 1 responses and >1 subquestions --> matrix question --> need to come up with unique variable names + if (count($question['responses'])>1) + { + foreach ($subquestions as $index=>$sv) + { + $subquestions[$index]['varname']=$subquestions[$index]['varname'].'_'.$varname; + } + } + $debugoutput=$subquestions; +file_put_contents('/debugdata.txt', print_r($debugoutput, true), FILE_APPEND); + switch ($type) { case 'fixed':