\n";
echo templatereplace(file_get_contents("$thistpl/startgroup.pstpl"));
echo "\n";
if ($groupdescription)
{
echo templatereplace(file_get_contents("$thistpl/groupdescription.pstpl"));
}
echo "\n";
// count the number of non-conditionnal and conditionnal questions in this group
echo "\n\n\n";
if (is_array($qanda))
{
foreach ($qanda as $qa)
{
if ($gl[0] == $qa[6])
{
$q_class = question_class($qa[8]); // render question class (see common.php)
if ($qa[9] == 'Y')
{
$man_class = ' mandatory';
}
else
{
$man_class = '';
}
if ($qa[3] != 'Y')
{
$n_q_display = '';
}
else
{
$n_q_display = ' style="display: none;"';
}
$question= $qa[0];
//===================================================================
// The following four variables offer the templating system the
// capacity to fully control the HTML output for questions making the
// above echo redundant if desired.
$question['essentials'] = 'id="question'.$qa[4].'"'.$n_q_display;
$question['class'] = $q_class;
$question['man_class'] = $man_class;
$question['code'] = $qa[5];
$question['sgq']=$qa[7];
//===================================================================
$answer=$qa[1];
$help=$qa[2];
$question_template = file_get_contents($thistpl.'/question.pstpl');
if( preg_match( '/\{QUESTION_ESSENTIALS\}/' , $question_template ) === false || preg_match( '/\{QUESTION_CLASS\}/' , $question_template ) === false )
{
// if {QUESTION_ESSENTIALS} is present in the template but not {QUESTION_CLASS} remove it because you don't want id="" and display="" duplicated.
$question_template = str_replace( '{QUESTION_ESSENTIALS}' , '' , $question_template );
$question_template = str_replace( '{QUESTION_CLASS}' , '' , $question_template );
echo '
';
echo templatereplace($question_template);
echo '
';
}
else
{
echo templatereplace($question_template);
};
}
}
}
echo "\n\n\n";
echo templatereplace(file_get_contents("$thistpl/endgroup.pstpl"));
echo "\n\n
\n";
echo "\n";
}
//echo " \n";
$navigator = surveymover();
echo "\n\n\n";
echo templatereplace(file_get_contents("$thistpl/navigator.pstpl"));
echo "\n";
if ($thissurvey['active'] != "Y") {echo "".$clang->gT("This survey is currently not active. You will not be able to save your responses.")."
\n";}
if (is_array($conditions) && count($conditions) != 0 )
{
//if conditions exist, create hidden inputs for 'previously' answered questions
// Note that due to move 'back' possibility, there may be answers from next pages
// However we make sure that no answer from this page are inserted here
foreach (array_keys($_SESSION) as $SESak)
{
if (in_array($SESak, $_SESSION['insertarray']) && !in_array($SESak, $inputnames))
{
echo "