### Eclipse Workspace Patch 1.0 #P moodle19dev Index: mod/questionnaire/locallib.php =================================================================== RCS file: /cvsroot/moodle/contrib/plugins/mod/questionnaire/locallib.php,v retrieving revision 1.49.2.63 diff -u -r1.49.2.63 locallib.php --- mod/questionnaire/locallib.php 18 Nov 2009 22:46:49 -0000 1.49.2.63 +++ mod/questionnaire/locallib.php 25 Nov 2009 14:03:24 -0000 @@ -1104,6 +1104,7 @@ case 8: // Rate $num = 0; $nbchoices = count($record->choices); + $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 $nameddegrees = 0; @@ -1112,6 +1113,9 @@ $nameddegrees++; } else { $str = 'q'."{$record->id}_$cid"; + if (isset($formdata->$str) && $formdata->$str == $na) { + $formdata->$str = -1; + } for ($j = 0; $j < $record->length; $j++) { $num += (isset($formdata->$str) && ($j == $formdata->$str)); } 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.41 diff -u -r1.31.2.41 questiontypes.class.php --- mod/questionnaire/questiontypes/questiontypes.class.php 23 Nov 2009 20:14:49 -0000 1.31.2.41 +++ mod/questionnaire/questiontypes/questiontypes.class.php 25 Nov 2009 14:03:25 -0000 @@ -1230,7 +1230,7 @@ } if ($na) { if ( (in_array($na, $data->{'q'.$this->id})) || - (isset($data->$str) && $data->$str == 'N/A') || + (isset($data->$str) && $data->$str == -1) || $this->required == 'n' ) { // automatically check N/A buttons if rate question is not required $checked = ' checked="checked"'; } else {