survey MDL-23324 survey form generation was assuming that subquestions would always...
authorAndrew Davis <andrew@affinitysoftware.net>
Fri, 6 Aug 2010 02:23:53 +0000 (02:23 +0000)
committerAndrew Davis <andrew@affinitysoftware.net>
Fri, 6 Aug 2010 02:23:53 +0000 (02:23 +0000)
mod/survey/lib.php

index 1e4de42..a5a71ec 100644 (file)
@@ -539,11 +539,6 @@ function survey_print_multi($question) {
     $numoptions = count($options);
 
     $oneanswer = ($question->type == 1 || $question->type == 2) ? true : false;
-    if ($question->type == 2) {
-        $P = "P";
-    } else {
-        $P = "";
-    }
 
     echo "<tr class=\"smalltext\"><th scope=\"row\">$strresponses</th>";
     echo "<th scope=\"col\" class=\"hresponse\">". get_string('notyetanswered', 'survey'). "</th>";
@@ -567,6 +562,13 @@ function survey_print_multi($question) {
             $q->text = get_string($q->text, "survey");
         }
 
+        $oneanswer = ($q->type == 1 || $q->type == 2) ? true : false;
+        if ($q->type == 2) {
+            $P = "P";
+        } else {
+            $P = "";
+        }
+
         echo "<tr class=\"$rowclass rblock\">";
         if ($oneanswer) {
             echo "<th scope=\"row\" class=\"optioncell\">";