From 5196df589b0fbcead4a0943c8e7b227f8a98c897 Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Fri, 6 Aug 2010 02:23:53 +0000 Subject: [PATCH] survey MDL-23324 survey form generation was assuming that subquestions would always have the same type as their parent question. this lead to data being put in the wrong columns --- mod/survey/lib.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mod/survey/lib.php b/mod/survey/lib.php index 1e4de420dee..a5a71eccd62 100644 --- a/mod/survey/lib.php +++ b/mod/survey/lib.php @@ -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 "$strresponses"; echo "". get_string('notyetanswered', 'survey'). ""; @@ -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 ""; if ($oneanswer) { echo ""; -- 2.36.1