FetchRow(); $ia = array(0 => $qid, 1 => $surveyid.'X'.$qrows['gid'].'X'.$qid, 2 => $qrows['title'], 3 => $qrows['question'], 4 => $qrows['type'], 5 => $qrows['gid'], 6 => $qrows['mandatory'], //7 => $qrows['other']); // ia[7] is conditionsexist not other 7 => 'N', 8 => 'N' ); // ia[8] is usedinconditions $answers = retrieveAnswers($ia); if (!$thissurvey['template']) { $thistpl=sGetTemplatePath($defaulttemplate); } else { $thistpl=sGetTemplatePath(validate_templatedir($thissurvey['template'])); } doHeader(); $dummy_js = ' '; $answer=$answers[0][1]; $help=$answers[0][2]; $question = $answers[0][0]; $question['code']=$answers[0][5]; $question['class'] = question_class($qrows['type']); $question['essentials'] = 'id="question'.$qrows['qid'].'"'; $question['sgq']=$ia[1]; //Temporary fix for error condition arising from linked question via replacement fields //@todo: find a consistent way to check and handle this - I guess this is already handled but the wrong values are entered into the DB $search_for = '{INSERTANS'; if(strpos($question['text'],$search_for)!==false){ $pattern_text = '/{([A-Z])*:([0-9])*X([0-9])*X([0-9])*}/'; $replacement_text = $clang->gT('[Dependency on another question (ID $4)]'); $text = preg_replace($pattern_text,$replacement_text,$question['text']); $question['text']=$text; } if ($qrows['mandatory'] == 'Y') { $question['man_class'] = ' mandatory'; } else { $question['man_class'] = ''; }; $content = templatereplace(file_get_contents("$thistpl/startpage.pstpl")); $content .='
'; $content .= templatereplace(file_get_contents("$thistpl/startgroup.pstpl")); $question_template = file_get_contents("$thistpl/question.pstpl"); if(substr_count($question_template , '{QUESTION_ESSENTIALS}') > 0 ) // the following has been added for backwards compatiblity. {// LS 1.87 and newer templates $content .= "\n".templatereplace($question_template)."\n"; } else {// LS 1.86 and older templates $content .= '
'; $content .= "\n".templatereplace($question_template)."\n"; $content .= "\n\t
\n"; }; $content .= templatereplace(file_get_contents("$thistpl/endgroup.pstpl")).$dummy_js; $content .= '

 

'; $content .= templatereplace(file_get_contents("$thistpl/endpage.pstpl")); echo $content; echo "\n"; exit; ?>