Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'MDL-30815-m21' of git://github.com/ankitagarwal/moodle …

…into MOODLE_21_STABLE
  • Loading branch information...
commit 9bfa5bd8cc4587e74afe591195b0666d61115455 2 parents 98899b9 + 7e9eccf
Sam Hemelryk samhemelryk authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 mod/choice/renderer.php
5 mod/choice/renderer.php
View
@@ -46,10 +46,13 @@ public function display_options($options, $coursemoduleid, $vertical = false) {
$html .= html_writer::start_tag('ul', array('class'=>'choices' ));
$availableoption = count($options['options']);
+ $choicecount = 0;
foreach ($options['options'] as $option) {
+ $choicecount++;
$html .= html_writer::start_tag('li', array('class'=>'option'));
$option->attributes->name = 'answer';
$option->attributes->type = 'radio';
+ $option->attributes->id = 'choice_'.$choicecount;
$labeltext = $option->text;
if (!empty($option->attributes->disabled)) {
@@ -58,7 +61,7 @@ public function display_options($options, $coursemoduleid, $vertical = false) {
}
$html .= html_writer::empty_tag('input', (array)$option->attributes);
- $html .= html_writer::tag('label', $labeltext, array('for'=>$option->attributes->name));
+ $html .= html_writer::tag('label', $labeltext, array('for'=>$option->attributes->id));
$html .= html_writer::end_tag('li');
}
$html .= html_writer::tag('li','', array('class'=>'clearfloat'));
Please sign in to comment.
Something went wrong with that request. Please try again.