### Eclipse Workspace Patch 1.0 #P moodle19dev Index: mod/questionnaire/questions.php =================================================================== RCS file: /cvsroot/moodle/contrib/plugins/mod/questionnaire/questions.php,v retrieving revision 1.15.2.2 diff -u -r1.15.2.2 questions.php --- mod/questionnaire/questions.php 20 Jun 2008 13:36:45 -0000 1.15.2.2 +++ mod/questionnaire/questions.php 12 Jul 2010 16:46:23 -0000 @@ -262,8 +262,8 @@ if ($nbnameddegrees && $nbnameddegrees != $qformdata->length) { $qformdata->length = $nbnameddegrees; } - // sanity check for "no duplicate choices"" - if ($qformdata->precise == 2 && $nbvalues != $qformdata->length) { + // sanity check for "no duplicate choices"" //dev jr 9 JUL 2010 + if ($qformdata->precise == 2 && ($qformdata->length > $nbvalues || !$qformdata->length)) { $qformdata->length = $nbvalues; } } elseif ($qformdata->type_id == QUESCHECK) { Index: mod/questionnaire/locallib.php =================================================================== RCS file: /cvsroot/moodle/contrib/plugins/mod/questionnaire/locallib.php,v retrieving revision 1.49.2.68 diff -u -r1.49.2.68 locallib.php --- mod/questionnaire/locallib.php 24 Mar 2010 12:47:07 -0000 1.49.2.68 +++ mod/questionnaire/locallib.php 12 Jul 2010 16:46:23 -0000 @@ -1111,8 +1111,12 @@ break; case 8: // Rate - $num = 0; - $nbchoices = count($record->choices); + $num = 0; + if ($record->precise != 2) { //dev jr 9 JUL 2010 + $nbchoices = count($record->choices); + } else { // if "No duplicate choices", can restrict nbchoices to number of rate items specified + $nbchoices = $record->length; + } $na = get_string('notapplicable', 'questionnaire'); foreach ($record->choices as $cid => $choice) { // in case we have named degrees on the Likert scale, count them to substract from nbchoices Index: mod/questionnaire/questiontypes/questiontypes.class.php =================================================================== RCS file: /cvsroot/moodle/contrib/plugins/mod/questionnaire/questiontypes/questiontypes.class.php,v retrieving revision 1.31.2.49 diff -u -r1.31.2.49 questiontypes.class.php --- mod/questionnaire/questiontypes/questiontypes.class.php 18 Mar 2010 17:11:02 -0000 1.31.2.49 +++ mod/questionnaire/questiontypes/questiontypes.class.php 12 Jul 2010 16:46:24 -0000 @@ -1195,7 +1195,12 @@ echo ''; $num = 0; - $nbchoices = count($this->choices) - $nameddegrees; + if ($this->precise != 2) { //dev jr 9 JUL 2010 + $nbchoices = count($this->choices) - $nameddegrees; + } else { // if "No duplicate choices", can restrict nbchoices to number of rate items specified + $nbchoices = $this->length; + } + foreach ($this->choices as $cid => $choice) { $str = 'q'."{$this->id}_$cid"; for ($j = 0; $j < $this->length; $j++) {