if ($explanation) {
     $explanation = "<b>" . $clang->gT('Only answer this question if the following conditions are met:') . "</b>" . "<br/> ° " . $explanation;
     //"[".sprintf($clang->gT("Only answer this question %s"), $explanation)."]";
 } else {
     $explanation = '';
 }
 ++$total_questions;
 //TIBO map question qid to their q number
 $mapquestionsNumbers[$deqrow['qid']] = $total_questions;
 //END OF GETTING CONDITIONS
 $qid = $deqrow['qid'];
 $fieldname = "{$surveyid}" . "X" . "{$gid}" . "X" . "{$qid}";
 if (isset($showsgqacode) && $showsgqacode == true) {
     $deqrow['question'] = $deqrow['question'] . "<br />" . $clang->gT("ID:") . " {$fieldname} <br />" . $clang->gT("Question code:") . " " . $deqrow['title'];
 }
 $question = array('QUESTION_NUMBER' => $total_questions, 'QUESTION_CODE' => $deqrow['title'], 'QUESTION_TEXT' => preg_replace('/(?:<br ?\\/?>|<\\/(?:p|h[1-6])>)$/is', '', tokenReplace($deqrow['question'])), 'QUESTION_SCENARIO' => $explanation, 'QUESTION_MANDATORY' => '', 'QUESTION_ID' => $deqrow['qid'], 'QUESTION_CLASS' => question_class($deqrow['type']), 'QUESTION_TYPE_HELP' => '', 'QUESTION_MAN_MESSAGE' => '', 'QUESTION_VALID_MESSAGE' => '', 'QUESTION_FILE_VALID_MESSAGE' => '', 'QUESTIONHELP' => '', 'ANSWER' => '');
 if ($deqrow['mandatory'] == 'Y') {
     $question['QUESTION_MANDATORY'] = $clang->gT('*');
     $question['QUESTION_CLASS'] .= ' mandatory';
     $pdfoutput .= $clang->gT("*");
 }
 $pdfoutput = '';
 //DIFFERENT TYPES OF DATA FIELD HERE
 if (isset($_POST['printableexport'])) {
     $pdf->intopdf($deqrow['title'] . " " . $deqrow['question']);
 }
 if ($deqrow['help']) {
     $hh = $deqrow['help'];
     $question['QUESTIONHELP'] = $hh;
     if (isset($_POST['printableexport'])) {
         $pdf->helptextintopdf($hh);
Example #2
0
    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<!-- PRESENT THE QUESTIONS -->\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
Example #3
0
            });
// -->
</script>
EOD;
$answer = $answers[0][1];
//GET HELP
$hquery = "SELECT help FROM {$dbprefix}questions WHERE qid={$ia['0']} AND language='" . $_SESSION['s_lang'] . "'";
$hresult = db_execute_num($hquery) or safe_die($connect->ErrorMsg());
//Checked
$help = "";
while ($hrow = $hresult->FetchRow()) {
    $help = $hrow[0];
}
$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];
$question['aid'] = 'unknown';
$question['sqid'] = 'unknown';
$question['type'] = $qrows['type'];
if ($qrows['mandatory'] == 'Y') {
    $question['man_class'] = ' mandatory';
} else {
    $question['man_class'] = '';
}
$content = templatereplace(file_get_contents("{$thistpl}/startpage.pstpl"));
$content .= '<form method="post" action="index.php" id="limesurvey" name="limesurvey" autocomplete="off">';
$content .= templatereplace(file_get_contents("{$thistpl}/startgroup.pstpl"));
$question_template = file_get_contents("{$thistpl}/question.pstpl");
if (substr_count($question_template, '{QUESTION_ESSENTIALS}') > 0) {
Example #4
0
 $groupname = $gl[1];
 $groupdescription = $gl[2];
 echo "\n\n<!-- START THE GROUP -->\n";
 echo "\n\n<div id='group-{$gid}'>\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<!-- PRESENT THE QUESTIONS -->\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
Example #5
0
     echo templatereplace(file_get_contents("{$thistpl}/groupdescription.pstpl"));
 }
 echo "\n";
 echo "\n\n<!-- PRESENT THE QUESTIONS -->\n";
 $i = 0;
 foreach ($qanda as $qa) {
     if ($gid != $qa[6]) {
         continue;
     }
     $qid = $qa[4];
     $qinfo = LimeExpressionManager::GetQuestionStatus($qid);
     $lastgrouparray = explode("X", $qa[7]);
     $lastgroup = $lastgrouparray[0] . "X" . $lastgrouparray[1];
     // id of the last group, derived from question id
     $lastanswer = $qa[7];
     $q_class = question_class($qinfo['info']['type']);
     $man_class = '';
     if ($qinfo['info']['mandatory'] == 'Y') {
         $man_class .= ' mandatory';
     }
     if ($qinfo['anyUnanswered'] && $_SESSION['maxstep'] != $_SESSION['step']) {
         $man_class .= ' missing';
     }
     $n_q_display = '';
     if ($qinfo['hidden'] && $qinfo['info']['type'] != '*') {
         continue;
         // skip this one
     }
     if (!$qinfo['relevant'] || $qinfo['hidden'] && $qinfo['info']['type'] == '*') {
         $n_q_display = ' style="display: none;"';
     }