diff -aur questionnaire.orig/questiontypes/questiontypes.class.php questionnaire/questiontypes/questiontypes.class.php --- questionnaire.orig/questiontypes/questiontypes.class.php 2010-12-10 15:14:05.000000000 -0500 +++ questionnaire/questiontypes/questiontypes.class.php 2010-12-10 15:15:39.000000000 -0500 @@ -619,21 +619,22 @@ } else if (is_int($rids)) { $prtotal = 0; } - $isnumeric = $this->type_id == 10; + $isnumeric = $this->type_id == 10; if ($rows = $this->get_response_text_results($rids)) { - if ($isnumeric) { - /// Count identical answers (numeric questions only) - foreach ($rows as $row) { - if(!empty($row->response)) { - $this->text = $row->response; - $textidx = clean_text($this->text); + foreach ($rows as $row) { + if(!empty($row->response)) { + $this->text = $row->response; + $textidx = clean_text($this->text); $this->counts[$textidx] = !empty($this->counts[$textidx]) ? ($this->counts[$textidx] + 1) : 1; - $this->userid[$textidx] = !empty($this->counts[$textidx]) ? ($this->counts[$textidx] + 1) : 1; + $this->userid[$textidx] = !empty($this->counts[$textidx]) ? ($this->counts[$textidx] + 1) : 1; } } + + if ($isnumeric) { + /// Count identical answers (numeric questions only) $this->mkreslistnumeric(count($rids), $this->precise); } else { - $this->mkreslisttext($rows); + $this->mkreslist(count($rids), $this->precise, $prtotal); } } else { print_string('noresponsedata', 'questionnaire');