version 1.123, 2007/06/29 17:32:31
|
version 1.124, 2007/07/17 20:44:07
|
Line 240 sub end_foilgroup {
|
Line 240 sub end_foilgroup {
|
$direction, |
$direction, |
$bubbles_per_line); |
$bubbles_per_line); |
} elsif ($target eq 'answer' ) { |
} elsif ($target eq 'answer' ) { |
$result=&displayanswers($answer, \@shown); |
$result=&displayanswers($answer, \@shown, $bubbles_per_line); |
} elsif ( $target eq 'grade') { |
} elsif ( $target eq 'grade') { |
&grade_response($answer, \@shown, $bubbles_per_line); |
&grade_response($answer, \@shown, $bubbles_per_line); |
} elsif ( $target eq 'analyze') { |
} elsif ( $target eq 'analyze') { |
Line 585 sub displayfoils {
|
Line 585 sub displayfoils {
|
my @alphabet = ('A'..'Z'); |
my @alphabet = ('A'..'Z'); |
my $i = 0; |
my $i = 0; |
my $bubble_number = 0; |
my $bubble_number = 0; |
|
my $line = 0; |
my $temp=0; |
my $temp=0; |
my $id=$Apache::inputtags::response['-1']; |
my $id=$Apache::inputtags::response['-1']; |
my $part=$Apache::inputtags::part; |
my $part=$Apache::inputtags::part; |
Line 612 sub displayfoils {
|
Line 613 sub displayfoils {
|
$result .= ' />'.$Apache::response::foilgroup{$name.'.text'}."</label>"; |
$result .= ' />'.$Apache::response::foilgroup{$name.'.text'}."</label>"; |
} else { |
} else { |
if ($Apache::lonhomework::type eq 'exam') { |
if ($Apache::lonhomework::type eq 'exam') { |
$result .= '{\small \textbf{'.$alphabet[$i].'}}$\bigcirc$'.$Apache::response::foilgroup{$name.'.text'}.'\\\\'; #' stupid emacs |
|
$i++; |
|
$bubble_number++; |
|
if($bubble_number >= $bubbles_per_line) { |
if($bubble_number >= $bubbles_per_line) { |
|
$line++; |
$i = 0; |
$i = 0; |
$bubble_number = 0; |
$bubble_number = 0; |
$result.='\item[\textbf{'.$Apache::lonxml::counter.'}.]'; |
$result.='\item[\textbf{'.($Apache::lonxml::counter+$line).'}.]'; |
} |
} |
|
$result .= '{\small \textbf{'.$alphabet[$i].'}}$\bigcirc$'.$Apache::response::foilgroup{$name.'.text'}.'\\\\'; #' stupid emacs |
|
$i++; |
|
$bubble_number++; |
} else { |
} else { |
$result .= '\vspace*{-2 mm}\item '.$Apache::response::foilgroup{$name.'.text'}; |
$result .= '\vspace*{-2 mm}\item '.$Apache::response::foilgroup{$name.'.text'}; |
} |
} |
Line 652 sub displayallanswers {
|
Line 654 sub displayallanswers {
|
} |
} |
|
|
sub displayanswers { |
sub displayanswers { |
my ($answer, $whichopt)=@_; |
my ($answer, $whichopt, $bubbles_per_line)=@_; |
my $result=&Apache::response::answer_header('radiobuttonresponse'); |
my $result; |
|
|
if ($Apache::lonhomework::type eq 'exam') { |
if ($Apache::lonhomework::type eq 'exam') { |
my $correct = ('A'..'Z')[$answer]; |
my $line = int($answer/$bubbles_per_line); |
$result.=&Apache::response::answer_part('radiobuttonresponse', |
my $correct = ('A'..'Z')[$answer%$bubbles_per_line]; |
$correct); |
$result .= &Apache::response::answer_header('radiobuttonresponse', |
|
$line); |
|
$result .= &Apache::response::answer_part('radiobuttonresponse', |
|
$correct); |
|
} else { |
|
$result .= &Apache::response::answer_header('radiobuttonresponse'); |
} |
} |
foreach my $name (@{ $whichopt }) { |
foreach my $name (@{ $whichopt }) { |
$result.=&Apache::response::answer_part('radiobuttonresponse', |
$result.=&Apache::response::answer_part('radiobuttonresponse', |