### Eclipse Workspace Patch 1.0 #P limesurvey Index: survey.php =================================================================== --- survey.php (revision 8703) +++ survey.php (working copy) @@ -251,8 +251,10 @@ { $gid=$gl[0]; $groupUnconditionnalQuestionsCount[$gid]=0; + $qnumber = 0; foreach ($_SESSION['fieldarray'] as $ia) { + $qnumber++; if ($ia[5] == $gid) { $qidattributes=getQuestionAttributes($ia[0]); @@ -265,6 +267,7 @@ { $plus_qanda[] = $ia[4]; $plus_qanda[] = $ia[6]; // adds madatory identifyer for adding mandatory class to question wrapping div + $plus_qanda['number'] = $qnumber; $qanda[]=$plus_qanda; } if ($plus_inputnames) @@ -880,6 +883,7 @@ $question['essentials'] = 'id="question'.$qa[4].'"'.$n_q_display; $question['class'] = $q_class; $question['man_class'] = $man_class; + $question['number'] = $qa['number']; //=================================================================== $answer=$qa[1]; $help=$qa[2]; Index: question.php =================================================================== --- question.php (revision 8703) +++ question.php (working copy) @@ -520,6 +520,7 @@ $question['essentials'] = 'id="question'.$qa[4].'"'.$n_q_display; $question['class'] = $q_class; $question['man_class'] = $man_class; + $question['number'] = $_SESSION['step']; //=================================================================== $answer=$qa[1]; $help=$qa[2]; Index: group.php =================================================================== --- group.php (revision 8703) +++ group.php (working copy) @@ -325,11 +325,11 @@ $inputnames=array(); $qtypesarray = array(); - +$qnumber = 0; foreach ($_SESSION['fieldarray'] as $ia) { $qtypesarray[$ia[1]] = $ia[4]; - + $qnumber++; if ($ia[5] == $gid) { $qidattributes=getQuestionAttributes($ia[0]); @@ -344,6 +344,7 @@ { $plus_qanda[] = $ia[4]; $plus_qanda[] = $ia[6]; // adds madatory identifyer for adding mandatory class to question wrapping div + $plus_qanda['number'] = $qnumber; $qanda[]=$plus_qanda; } if ($plus_inputnames) @@ -1077,6 +1078,7 @@ $question['class'] = $q_class; $question['man_class'] = $man_class; $question['code']=$qa[5]; + $question['number']=$qa['number']; //=================================================================== $answer=$qa[1]; $help=$qa[2]; Index: common.php =================================================================== --- common.php (revision 8703) +++ common.php (working copy) @@ -2844,6 +2844,7 @@ if (strpos($line, "{QUESTION_INPUT_ERROR_CLASS}") !== false) $line=str_replace("{QUESTION_INPUT_ERROR_CLASS}", $question['input_error_class'], $line); if (strpos($line, "{QUESTION_CODE}") !== false) $line=str_replace("{QUESTION_CODE}", $question['code'], $line); + if (strpos($line, "{QUESTION_NUMBER}") !== false) $line=str_replace("{QUESTION_NUMBER}", $question['number'], $line); if (strpos($line, "{ANSWER}") !== false) $line=str_replace("{ANSWER}", $answer, $line); $totalquestionsAsked = $totalquestions - $totalBoilerplatequestions; if ($totalquestionsAsked < 1)