version 1.114, 2004/07/12 16:19:48
|
version 1.123, 2005/01/10 19:21:57
|
Line 192 sub end_foilgroup {
|
Line 192 sub end_foilgroup {
|
my $ignored=0; |
my $ignored=0; |
foreach $name (@whichopt) { |
foreach $name (@whichopt) { |
my $response=&Apache::response::getresponse($temp); |
my $response=&Apache::response::getresponse($temp); |
if ($ENV{'form.submitted'} eq 'scantron') { |
if ($ENV{'form.submitted'} eq 'scantron' && $response=~/\S/) { |
$response = $opt[$response]; |
$response = $opt[$response]; |
} |
} |
if ( $response =~ /[^\s]/) { |
if ( $response =~ /[^\s]/) { |
Line 220 sub end_foilgroup {
|
Line 220 sub end_foilgroup {
|
$responsestr; |
$responsestr; |
$Apache::lonhomework::results{"resource.$part.$id.submissiongrading"}=$gradestr; |
$Apache::lonhomework::results{"resource.$part.$id.submissiongrading"}=$gradestr; |
|
|
if (!$Apache::lonhomework::scantronmode) { |
if ($Apache::lonhomework::type eq 'survey') { |
|
if ($ignored == 0) { |
|
my $ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='SUBMITTED'; |
|
&Apache::response::handle_previous(\%previous,$ad); |
|
} elsif ($wrong==0 && $right==0) { |
|
} else { |
|
my $ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='MISSING_ANSWER'; |
|
&Apache::response::handle_previous(\%previous,$ad); |
|
} |
|
} elsif (!$Apache::lonhomework::scantronmode) { |
my $ad; |
my $ad; |
if ($wrong==0 && $ignored==0) { |
if ($wrong==0 && $ignored==0) { |
$ad='EXACT_ANS'; |
$ad='EXACT_ANS'; |
Line 238 sub end_foilgroup {
|
Line 247 sub end_foilgroup {
|
} else { |
} else { |
my $ad; |
my $ad; |
if ($wrong==0 && $right==0) { |
if ($wrong==0 && $right==0) { |
#nothing submitted |
#nothing submitted only assign a score if we |
|
#need to override a previous grade |
|
if (defined($Apache::lonhomework::history{"resource.$part.$id.awarddetail"})) { |
|
$ad='ASSIGNED_SCORE'; |
|
} |
} else { |
} else { |
$ad='ASSIGNED_SCORE'; |
$ad='ASSIGNED_SCORE'; |
} |
} |
Line 453 sub optionlist_correction {
|
Line 466 sub optionlist_correction {
|
if ($TeXlayout eq 'vertical') { |
if ($TeXlayout eq 'vertical') { |
$texoptionlist.=' \vskip 0 mm ', |
$texoptionlist.=' \vskip 0 mm ', |
} else { |
} else { |
$texoptionlist.=','; |
$texoptionlist.=', '; |
} |
} |
} |
} |
chop($texoptionlist); |
$texoptionlist=~s/, $//; |
if ($TeXlayout ne 'vertical') {$texoptionlist.='.';} |
if ($TeXlayout ne 'vertical') {$texoptionlist.='.';} |
} else { |
} else { |
if ($TeXlayout ne 'vertical') {$texoptionlist='\\item [] \\vskip -5 mm';} |
if ($TeXlayout ne 'vertical') {$texoptionlist='\\item [] \\vskip -5 mm';} |
Line 491 sub webbubbles {
|
Line 504 sub webbubbles {
|
|
|
|
|
sub bubbles { |
sub bubbles { |
my ($ralphabit,$ropt) = @_; |
my ($ralphabet,$ropt,$response) = @_; |
my @alphabet = @$ralphabit; |
my @alphabet = @$ralphabet; |
my @opt = @$ropt; |
my @opt = @$ropt; |
my ($result,$head,$line) =('','',''); |
my ($result,$head,$line) =('','',''); |
my $number_of_bubbles = $#opt + 1; |
my $number_of_bubbles = $#opt + 1; |
Line 508 sub bubbles {
|
Line 521 sub bubbles {
|
for (my $ind=0;$ind<=$number_of_bubbles;$ind++) { |
for (my $ind=0;$ind<=$number_of_bubbles;$ind++) { |
my $leftmargin; |
my $leftmargin; |
$opt[$ind]=&Apache::lonxml::latex_special_symbols($opt[$ind]); |
$opt[$ind]=&Apache::lonxml::latex_special_symbols($opt[$ind]); |
|
if ($response eq 'rankresponse') {$opt[$ind]='Rank '.$opt[$ind];} |
if ($ind==0) {$leftmargin=6;} else {$leftmargin=10;} |
if ($ind==0) {$leftmargin=6;} else {$leftmargin=10;} |
$current_length += (length($opt[$ind])+length($alphabet[$ind])+4)*2; |
$current_length += (length($opt[$ind])+length($alphabet[$ind])+4)*2; |
if ($current_length<($textwidth-$leftmargin) and $ind!=$number_of_bubbles) { |
if ($current_length<($textwidth-$leftmargin) and $ind!=$number_of_bubbles) { |
Line 609 sub end_foil {
|
Line 623 sub end_foil {
|
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' |
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' |
|| $target eq 'tex' || $target eq 'analyze') { |
|| $target eq 'tex' || $target eq 'analyze') { |
my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval); |
my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval); |
|
if ($target eq 'tex' && $Apache::lonhomework::type eq 'exam') { |
|
$text='\vskip 5mm $\triangleright$ '.$text; |
|
} |
if ($value ne 'unused') { |
if ($value ne 'unused') { |
my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); |
my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); |
&Apache::lonxml::debug("Got a name of :$name:"); |
&Apache::lonxml::debug("Got a name of :$name:"); |
if (!$name) { $name=$Apache::lonxml::curdepth; } |
if (!$name) { |
|
&Apache::lonxml::error("Foils without names exist. This can cause problems to malfunction."); |
|
$name=$Apache::lonxml::curdepth; |
|
} |
&Apache::lonxml::debug("Using a name of :$name:"); |
&Apache::lonxml::debug("Using a name of :$name:"); |
if (defined($Apache::response::foilnames{$name})) { |
if (defined($Apache::response::foilnames{$name})) { |
&Apache::lonxml::error(&mt("Foil name <b><tt>[_1]</tt></b> appears more than once. Foil names need to be unique.",$name)); |
&Apache::lonxml::error(&mt("Foil name <b><tt>[_1]</tt></b> appears more than once. Foil names need to be unique.",$name)); |
Line 623 sub end_foil {
|
Line 643 sub end_foil {
|
&& !&Apache::response::showallfoils() ) { |
&& !&Apache::response::showallfoils() ) { |
push @{ $Apache::response::conceptgroup{'names'} }, $name; |
push @{ $Apache::response::conceptgroup{'names'} }, $name; |
$Apache::response::conceptgroup{"$name.value"} = $value; |
$Apache::response::conceptgroup{"$name.value"} = $value; |
if ($target eq 'tex' and $Apache::lonhomework::type eq 'exam') { |
$Apache::response::conceptgroup{"$name.text"} = $text; |
$Apache::response::conceptgroup{"$name.text"} = '\vskip 4 mm $\triangleright$ '.$text; |
|
} else { |
|
$Apache::response::conceptgroup{"$name.text"} = $text; |
|
} |
|
$Apache::response::conceptgroup{"$name.location"} = $location; |
$Apache::response::conceptgroup{"$name.location"} = $location; |
} else { |
} else { |
push @{ $Apache::response::foilgroup{'names'} }, $name; |
push @{ $Apache::response::foilgroup{'names'} }, $name; |
$Apache::response::foilgroup{"$name.value"} = $value; |
$Apache::response::foilgroup{"$name.value"} = $value; |
if ($target eq 'tex' and $Apache::lonhomework::type eq 'exam') { |
$Apache::response::foilgroup{"$name.text"} = $text; |
$Apache::response::foilgroup{"$name.text"} = '\vskip 5 mm $\triangleright$ '.$text; |
|
} else { |
|
$Apache::response::foilgroup{"$name.text"} = $text; |
|
} |
|
$Apache::response::foilgroup{"$name.location"} = $location; |
$Apache::response::foilgroup{"$name.location"} = $location; |
} |
} |
} |
} |
Line 649 sub end_foil {
|
Line 661 sub end_foil {
|
|
|
sub start_drawoptionlist { |
sub start_drawoptionlist { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
return $token->[4]; |
if ($target ne 'meta') { |
|
return $token->[4]; |
|
} |
} |
} |
|
|
sub end_drawoptionlist { |
sub end_drawoptionlist { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
return $token->[2]; |
if ($target ne 'meta') { |
|
return $token->[2]; |
|
} |
} |
} |
|
|
sub insert_foil { |
sub insert_foil { |