version 1.13, 2003/05/16 20:16:18
|
version 1.20, 2003/09/24 17:57:42
|
Line 104 sub end_foilgroup {
|
Line 104 sub end_foilgroup {
|
} elsif ( $target eq 'grade') { |
} elsif ( $target eq 'grade') { |
&grade_response($max,$randomize,$tol); |
&grade_response($max,$randomize,$tol); |
} |
} |
|
&Apache::lonxml::increment_counter(&getfoilcounts($max)); |
|
} elsif ($target eq 'edit') { |
|
$result=&Apache::edit::end_table(); |
} |
} |
return $result; |
return $result; |
} |
} |
Line 118 sub get_correct_order {
|
Line 121 sub get_correct_order {
|
} |
} |
@value_names = |
@value_names = |
sort { |
sort { |
if (abs($a->[0] - $b->[0]) > $tol) {return ($a->[0] cmp $b->[0]);} |
if (abs($a->[0] - $b->[0]) > $tol) {return ($a->[0] <=> $b->[0]);} |
return 0; |
return 0; |
} @value_names; |
} @value_names; |
my @value_names_tmp=@value_names; |
my @value_names_tmp=@value_names; |
Line 238 sub displayfoils {
|
Line 241 sub displayfoils {
|
my $status=$Apache::inputtags::status[-1]; |
my $status=$Apache::inputtags::status[-1]; |
my @whichopt=(1..($#whichfoils+1)); |
my @whichopt=(1..($#whichfoils+1)); |
my @correctorder=&get_correct_order($tol,@whichfoils); |
my @correctorder=&get_correct_order($tol,@whichfoils); |
if (($solved =~ /^correct/) || ($status eq 'SHOW_ANSWER')) { |
if ( &Apache::response::show_answer() && ($target ne 'tex')) { |
foreach my $name (@whichfoils) { |
foreach my $name (@whichfoils) { |
my $text=$Apache::response::foilgroup{$name.'.text'}; |
my $text=$Apache::response::foilgroup{$name.'.text'}; |
my $value=shift(@correctorder); |
my $value=shift(@correctorder); |
$result.='<br />'.$value.':'.$text; |
if ($target eq 'web') {$result.='<br />';} else {$result.=' \strut\\\\\strut ';} |
|
$result.=$value.':'.$text; |
} |
} |
} else { |
} else { |
my $i = 0; |
my $i = 0; |
Line 252 sub displayfoils {
|
Line 256 sub displayfoils {
|
my $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"}; |
my $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"}; |
my %lastresponse=&Apache::lonnet::str2hash($lastresponse); |
my %lastresponse=&Apache::lonnet::str2hash($lastresponse); |
my @alp = splice @alphabet, 0, $#whichopt + 1; |
my @alp = splice @alphabet, 0, $#whichopt + 1; |
|
my $internal_counter=$Apache::lonxml::counter; |
foreach my $name (@whichfoils) { |
foreach my $name (@whichfoils) { |
my $lastopt=$lastresponse{$name}; |
my $lastopt=$lastresponse{$name}; |
my $optionlist=''; |
my $optionlist=''; |
Line 284 sub displayfoils {
|
Line 289 sub displayfoils {
|
} else { |
} else { |
if ($Apache::lonhomework::type eq 'exam') { |
if ($Apache::lonhomework::type eq 'exam') { |
$result.='\vskip 0 mm '.$text.' \vskip -3 mm '."\n"; |
$result.='\vskip 0 mm '.$text.' \vskip -3 mm '."\n"; |
$result.='\vskip -5 mm\begin{enumerate}\item[\textbf{'.$Apache::lonxml::counter.'}.]\parbox{\textwidth - 5 mm}{'.&Apache::optionresponse::bubbles(\@alp,\@whichopt).'}\end{enumerate} \vskip -5 mm \strut '; |
$result.='\vskip -5 mm\begin{enumerate}\item[\textbf{'.$internal_counter.'}.]\parbox{\textwidth - 5 mm}{'.&Apache::optionresponse::bubbles(\@alp,\@whichopt).'}\end{enumerate} \vskip -5 mm \strut '; |
|
$internal_counter++; |
} else { |
} else { |
$result.=' \\\\ \framebox[5 mm][s]{\tiny\strut} '.$text."\n"; |
$result.=' \vskip 0mm \framebox[5 mm][s]{\tiny\strut} '.$text."\n"; |
} |
} |
} |
} |
$temp++; |
$temp++; |