version 1.68, 2002/11/06 17:58:27
|
version 1.73, 2002/11/25 21:36:42
|
Line 89 sub start_numericalresponse {
|
Line 89 sub start_numericalresponse {
|
$result.=&Apache::edit::text_arg('Format:','format',$token,4); |
$result.=&Apache::edit::text_arg('Format:','format',$token,4); |
} elsif ($token->[1] eq 'stringresponse') { |
} elsif ($token->[1] eq 'stringresponse') { |
$result.=&Apache::edit::select_arg('Type:','type', |
$result.=&Apache::edit::select_arg('Type:','type', |
['cs','ci','mc'],$token); |
[['cs','Case Sensitive'],['ci','Case Insensitive'], |
|
['mc','Case Insensitive, Any Order']],$token); |
} elsif ($token->[1] eq 'formularesponse') { |
} elsif ($token->[1] eq 'formularesponse') { |
$result.=&Apache::edit::text_arg('Sample Points:','samples',$token,40); |
$result.=&Apache::edit::text_arg('Sample Points:','samples',$token,40); |
} |
} |
Line 112 sub start_numericalresponse {
|
Line 113 sub start_numericalresponse {
|
} |
} |
} elsif ($target eq 'meta') { |
} elsif ($target eq 'meta') { |
$result=&Apache::response::meta_package_write('numericalresponse'); |
$result=&Apache::response::meta_package_write('numericalresponse'); |
|
} elsif ($target eq 'answer' || $target eq 'grade') { |
|
&Apache::response::reset_params(); |
} |
} |
return $result; |
return $result; |
} |
} |
Line 127 sub end_numericalresponse {
|
Line 130 sub end_numericalresponse {
|
my $id = $Apache::inputtags::response['-1']; |
my $id = $Apache::inputtags::response['-1']; |
my $response = $ENV{'form.HWVAL'.$id}; |
my $response = $ENV{'form.HWVAL'.$id}; |
if ( $response =~ /[^\s]/) { |
if ( $response =~ /[^\s]/) { |
|
if (!$Apache::lonxml::default_homework_loaded) { |
|
&Apache::lonxml::default_homework_load($safeeval); |
|
} |
my %previous = &Apache::response::check_for_previous($response,$partid,$id); |
my %previous = &Apache::response::check_for_previous($response,$partid,$id); |
$Apache::lonhomework::results{"resource.$partid.$id.submission"}=$response; |
$Apache::lonhomework::results{"resource.$partid.$id.submission"}=$response; |
&Apache::lonxml::debug("submitted a $response<br>\n"); |
&Apache::lonxml::debug("submitted a $response<br>\n"); |
Line 198 sub end_numericalresponse {
|
Line 204 sub end_numericalresponse {
|
$result.="}. \\vskip 0 mm "; |
$result.="}. \\vskip 0 mm "; |
} |
} |
} |
} |
|
if ($Apache::lonhomework::type eq 'exam') { |
my (@answers)=&Apache::lonxml::get_param_var('answer',$parstack,$safeeval); |
my (@answers)=&Apache::lonxml::get_param_var('answer',$parstack,$safeeval); |
my (@formats)=&Apache::lonxml::get_param_var('format',$parstack,$safeeval); |
my (@formats)=&Apache::lonxml::get_param_var('format',$parstack,$safeeval); |
my $unit=&Apache::lonxml::get_param_var('unit',$parstack,$safeeval); |
my $unit=&Apache::lonxml::get_param_var('unit',$parstack,$safeeval); |
Line 221 sub end_numericalresponse {
|
Line 228 sub end_numericalresponse {
|
my @alphabet = ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P', |
my @alphabet = ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P', |
'Q','R','S','T','U','V','W','X','Y','Z'); |
'Q','R','S','T','U','V','W','X','Y','Z'); |
if ($target eq 'web') { |
if ($target eq 'web') { |
|
my $id=$Apache::inputtags::response[-1]; |
$result.= '<table border="1"><tr>'; |
$result.= '<table border="1"><tr>'; |
for ($ind=0;$ind<$number_of_bubbles;$ind++) { |
for ($ind=0;$ind<$number_of_bubbles;$ind++) { |
my $ans; |
my $ans; |
Line 239 sub end_numericalresponse {
|
Line 247 sub end_numericalresponse {
|
} |
} |
$ans = sprintf('%.'.$format,$bubbles_values[$ind]); |
$ans = sprintf('%.'.$format,$bubbles_values[$ind]); |
} |
} |
$result.='<td>'.$alphabet[$ind].': '.$ans.'</td>'; |
$result.='<td><input type="radio" name="HWVAL'.$id.'" value="'.$ans.'"><b>'.$alphabet[$ind].'</b>: '.$ans.'</td>'; |
} |
} |
$result.='</tr></table>'; |
$result.='</tr></table>'; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
Line 308 sub end_numericalresponse {
|
Line 316 sub end_numericalresponse {
|
$result.='\end{enumerate}'; |
$result.='\end{enumerate}'; |
&Apache::lonxml::increment_counter(); |
&Apache::lonxml::increment_counter(); |
} |
} |
|
} |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result.='</td></tr>'.&Apache::edit::end_table; |
$result.='</td></tr>'.&Apache::edit::end_table; |
} elsif ($target eq 'answer' || $target eq 'analyze') { |
} elsif ($target eq 'answer' || $target eq 'analyze') { |
Line 351 sub end_numericalresponse {
|
Line 360 sub end_numericalresponse {
|
} |
} |
} |
} |
if ($target eq 'answer') { |
if ($target eq 'answer') { |
if ($high) { $ans.=' ['.$low.','.$high.'] '; } |
if ($high) { $ans.=' ['.$low.','.$high.']'; } |
if ($sighigh) { $ans.= "Sig <i>$siglow - $sighigh</i>"; } |
if ($sighigh) { $ans.= " Sig <i>$siglow - $sighigh</i>"; } |
$result.=&Apache::response::answer_part($$tagstack[-1],$ans); |
$result.=&Apache::response::answer_part($$tagstack[-1],$ans); |
} elsif ($target eq 'analyze') { |
} elsif ($target eq 'analyze') { |
push (@{ $Apache::lonhomework::analyze{"$part_id.answer"} }, |
push (@{ $Apache::lonhomework::analyze{"$part_id.answer"} }, |