--- loncom/interface/lonhelper.pm 2004/08/12 07:45:03 1.86 +++ loncom/interface/lonhelper.pm 2004/09/24 19:49:12 1.87 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # .helper XML handler to implement the LON-CAPA helper # -# $Id: lonhelper.pm,v 1.86 2004/08/12 07:45:03 albertel Exp $ +# $Id: lonhelper.pm,v 1.87 2004/09/24 19:49:12 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1174,6 +1174,13 @@ sub end_choice { return ''; } +{ + # used to generate unique id attributes for tags. + # internal use only. + my $id = 0; + sub new_id { return $id++; } +} + sub render { my $self = shift; my $var = $self->{'variable'}; @@ -1256,6 +1263,7 @@ BUTTONS my $type = "radio"; if ($self->{'multichoice'}) { $type = 'checkbox'; } foreach my $choice (@{$self->{CHOICES}}) { + my $id = &new_id(); $result .= "\n \n"; $result .= " tags. + # internal use only. + my $id=0; + sub new_id { return $id++;} +} + sub render { my $self = shift; my $result = ''; @@ -2513,14 +2530,16 @@ BUTTONS if ($status eq 'Published' && $helper->{VARS}->{'construction'}) { $onclick = 'onclick="a=1" '; } + my $id = &new_id(); $result .= '" . "&"'). + . ".forminput' ".qq{id="$id"}." value='" . HTML::Entities::encode($fileName,'<>&"'). "'"; if (!$self->{'multichoice'} && $choices == 0) { $result .= ' checked'; } - $result .= "/>" . $file . "" . + $result .= "/>". + qq{" . "$title" . "$status" . "\n"; $choices++;