';
- for ($ind=0;$ind<$number_of_bubbles;$ind++) {
- my $ans;
- if ($formats[0] ne '') {
- $ans = sprintf('%.'.$formats[0],$bubbles_values[$ind]);
- } else {
- my $badans = $bubbles_values[$ind];
- my $format = '';
- #What is the number? (integer,decimal,floating point)
- if ($badans=~/^(\d*\.?\d*)(E|e)(\d*)$/) {
- $format = 'e'.$2;
- } elsif ($badans=~/^(\d*)\.(\d*)$/) {
- $format = '4f';
- } elsif ($badans=~/^(\d*)$/) {
- $format = 'd';
- }
- $ans = sprintf('%.'.$format,$bubbles_values[$ind]);
+ my $previous=$Apache::lonhomework::history{"resource.$Apache::inputtags::part.$id.submission"};
+ for (my $ind=0;$ind<$number_of_bubbles;$ind++) {
+ my $checked='';
+ if ($previous eq $bubble_values->[$ind]) {
+ $checked=" checked='on' ";
}
- $result.=''.$alphabet[$ind].': '.$ans.' | ';
+ $result.=''.$alphabet[$ind].': '.
+ $bubble_display->[$ind].' | ';
}
$result.='