Index: mod/questionnaire/lang/en_utf8/questionnaire.php =================================================================== RCS file: /cvsroot/moodle/contrib/plugins/mod/questionnaire/lang/en_utf8/questionnaire.php,v retrieving revision 1.10.2.13 diff -u -r1.10.2.13 questionnaire.php --- mod/questionnaire/lang/en_utf8/questionnaire.php 5 Dec 2008 16:51:39 -0000 1.10.2.13 +++ mod/questionnaire/lang/en_utf8/questionnaire.php 28 Dec 2008 14:47:45 -0000 @@ -88,6 +88,7 @@ $string['name'] = 'Name'; $string['next'] = 'Next'; $string['nextpage'] = 'Next Page'; +$string['noanswer'] = 'No answer'; $string['nodata'] = 'No data posted.'; $string['noduplicates'] = 'No duplicate choices'; $string['noneinuse'] = 'No content currently defined.'; 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.24 diff -u -r1.31.2.24 questiontypes.class.php --- mod/questionnaire/questiontypes/questiontypes.class.php 18 Nov 2008 01:25:02 -0000 1.31.2.24 +++ mod/questionnaire/questiontypes/questiontypes.class.php 28 Dec 2008 14:47:45 -0000 @@ -850,24 +850,36 @@ $options = array($val1 => $stryes, $val2 => $strno); $name = 'q'.$this->id; $checked=(isset($data->{'q'.$this->id})?$data->{'q'.$this->id}:''); - $output = '\n"; - $currentradio = 0; + $ischecked = false; + foreach ($options as $value => $label) { $htmlid = 'auto-rb'.sprintf('%04d', ++$idcounter); $output .= ' "; $output .= ''. $value .'' . "\n"; - } else { - $output .= ' /> ' . "\n"; - } + $output .= ' /> ' . "\n"; $currentradio = ($currentradio + 1) % 2; } + // CONTRIB-846 + if ($this->required == 'n') { + $id=''; + $htmlid = 'auto-rb'.sprintf('%04d', ++$idcounter); + $output .= ''. + format_text($content, FORMAT_HTML).'  '; + $currentradio = ($currentradio + 1) % 2; + } + // end CONTRIB-846 $output .= '' . "\n"; echo $output; @@ -918,12 +930,14 @@ $otherempty = false; $output = ''; // find out which radio button is checked (if any); yields choice ID + if (isset($data->{'q'.$this->id})) { $checked = $data->{'q'.$this->id}; } else { $checked = ''; } $horizontal = $this->length; + $ischecked = false; foreach ($this->choices as $id => $choice) { $other = strpos($choice->content, '!other'); if ($other !== 0) { // this is a normal radio button @@ -935,6 +949,7 @@ ' onclick="other_check_empty(name, value)"'; if ($id == $checked) { $output .= ' checked="checked"'; + $ischecked = true; } $content = $choice->content; $valign = 'top'; @@ -969,6 +984,7 @@ ' onclick="other_check_empty(name, value)"'; if (($id == $checked) || !empty($data->$cid)) { $output .= ' checked="checked"'; + $ischecked = true; if (!$data->$cid) { $otherempty = true; } @@ -984,9 +1000,37 @@ $output .= ' />'; if ($horizontal) { $output .= ''; + } else { + $output .= '
'; } } } + + // CONTRIB-846 + if ($this->required == 'n') { + $id=''; + $htmlid = 'auto-rb'.sprintf('%04d', ++$idcounter); + if ($horizontal) { + $output .= ' '; + } + $output .= ''. + format_text($content, FORMAT_HTML).'  '; + $currentradio = ($currentradio + 1) % 2; + if ($horizontal) { + $output .=''; + } else { + $output .= '
'; + } + } + // end CONTRIB-846 + echo $output; if ($otherempty) { questionnaire_notify (get_string('otherempty', 'questionnaire'));