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.10
diff -u -r1.10.2.10 questionnaire.php
--- mod/questionnaire/lang/en_utf8/questionnaire.php 4 Oct 2008 12:57:47 -0000 1.10.2.10
+++ mod/questionnaire/lang/en_utf8/questionnaire.php 31 Oct 2008 22:57:50 -0000
@@ -85,6 +85,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.22
diff -u -r1.31.2.22 questiontypes.class.php
--- mod/questionnaire/questiontypes/questiontypes.class.php 14 Oct 2008 21:07:55 -0000 1.31.2.22
+++ mod/questionnaire/questiontypes/questiontypes.class.php 31 Oct 2008 22:57:51 -0000
@@ -848,10 +848,9 @@
$options = array($val1 => $stryes, $val2 => $strno);
$name = 'q'.$this->id;
$checked=(isset($data->{'q'.$this->id})?$data->{'q'.$this->id}:'');
-
$output = '\n";
-
$currentradio = 0;
+
foreach ($options as $value => $label) {
$htmlid = 'auto-rb'.sprintf('%04d', ++$idcounter);
$output .= ' ";
@@ -859,13 +858,22 @@
if ($value == $checked) {
$output .= ' checked="checked"';
}
- if ($label === '') {
- $output .= ' /> ' . "\n";
- } else {
- $output .= ' /> ' . "\n";
- }
+ $output .= ' /> ' . "\n";
$currentradio = ($currentradio + 1) % 2;
}
+ // added JR upon Daniele's suggestion
+ if ($this->required == 'n') {
+ $id=0;
+ $htmlid = 'auto-rb'.sprintf('%04d', ++$idcounter);
+ $output .= ''.
+ format_text($content, FORMAT_HTML).' ';
+ $currentradio = ($currentradio + 1) % 2;
+ }
+ // end Daniele's suggestion
$output .= '' . "\n";
echo $output;
@@ -922,6 +930,7 @@
$checked = '';
}
$horizontal = $this->length;
+
foreach ($this->choices as $id => $choice) {
$other = strpos($choice->content, '!other');
if ($other !== 0) { // this is a normal radio button
@@ -982,9 +991,35 @@
$output .= ' />';
if ($horizontal) {
$output .= '';
+ } else {
+ $output .= '
';
}
}
}
+
+ // added JR upon Daniele's suggestion
+ if ($this->required == 'n') {
+ $id=0;
+ $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 Daniele's suggestion
+
echo $output;
if ($otherempty) {
questionnaire_notify (get_string('otherempty', 'questionnaire'));