version 1.146, 2004/06/04 22:06:07
|
version 1.152, 2004/08/23 19:34:52
|
Line 45 sub start_numericalresponse {
|
Line 45 sub start_numericalresponse {
|
$result.=&Apache::edit::text_arg('Answer:','answer',$token); |
$result.=&Apache::edit::text_arg('Answer:','answer',$token); |
if ($token->[1] eq 'numericalresponse') { |
if ($token->[1] eq 'numericalresponse') { |
$result.=&Apache::edit::text_arg('Incorrect Answers:','incorrect', |
$result.=&Apache::edit::text_arg('Incorrect Answers:','incorrect', |
$token); |
$token). |
|
&Apache::loncommon::help_open_topic('numerical_wrong_answers'); |
$result.=&Apache::edit::text_arg('Unit:','unit',$token,5). |
$result.=&Apache::edit::text_arg('Unit:','unit',$token,5). |
&Apache::loncommon::help_open_topic('Physical_Units'); |
&Apache::loncommon::help_open_topic('Physical_Units'); |
$result.=&Apache::edit::text_arg('Format:','format',$token,4). |
$result.=&Apache::edit::text_arg('Format:','format',$token,4). |
Line 115 sub start_numericalresponse {
|
Line 116 sub start_numericalresponse {
|
} |
} |
chop $answertxt; |
chop $answertxt; |
if ($target eq 'web') { |
if ($target eq 'web') { |
$answertxt.=" $unit.<br />"; |
$answertxt.=" $unit "; |
} |
} |
$Apache::inputtags::answertxt{$id}=$answertxt; |
$Apache::inputtags::answertxt{$id}=$answertxt; |
} |
} |
Line 411 sub get_table_sizes {
|
Line 412 sub get_table_sizes {
|
$textwidth=$1.'.'.$2; |
$textwidth=$1.'.'.$2; |
} |
} |
my $bubbles_per_line=int($textwidth/$cell_width); |
my $bubbles_per_line=int($textwidth/$cell_width); |
if (($bubbles_per_line > $number_of_bubbles/2) && ($number_of_bubbles % 2==0)) {$bubbles_per_line=$number_of_bubbles/2;} |
if ($bubbles_per_line > $number_of_bubbles) { |
|
$bubbles_per_line=$number_of_bubbles; |
|
}elsif (($bubbles_per_line > $number_of_bubbles/2) && ($number_of_bubbles % 2==0)) {$bubbles_per_line=$number_of_bubbles/2;} |
my $number_of_tables = int($number_of_bubbles/$bubbles_per_line); |
my $number_of_tables = int($number_of_bubbles/$bubbles_per_line); |
my @table_range = (); |
my @table_range = (); |
for (my $i=0;$i<$number_of_tables;$i++) {push @table_range,$bubbles_per_line;} |
for (my $i=0;$i<$number_of_tables;$i++) {push @table_range,$bubbles_per_line;} |
Line 517 sub get_tolrange {
|
Line 520 sub get_tolrange {
|
sub get_sigrange { |
sub get_sigrange { |
my ($sig)=@_; |
my ($sig)=@_; |
&Apache::lonxml::debug("Got a sig of :$sig:"); |
&Apache::lonxml::debug("Got a sig of :$sig:"); |
|
my $courseid=$ENV{'request.course.id'}; |
|
if (lc($ENV{"course.$courseid.disablesigfigs"}) eq 'yes') { |
|
return (15,0); |
|
} |
my $sig_lbound; |
my $sig_lbound; |
my $sig_ubound; |
my $sig_ubound; |
if ($sig eq '') { |
if ($sig eq '') { |
Line 548 sub start_stringresponse {
|
Line 555 sub start_stringresponse {
|
my $result; |
my $result; |
my $id = &Apache::response::start_response($parstack,$safeeval); |
my $id = &Apache::response::start_response($parstack,$safeeval); |
if ($target eq 'meta') { |
if ($target eq 'meta') { |
&Apache::response::start_response($parstack,$safeeval); |
|
$result=&Apache::response::meta_package_write('stringresponse'); |
$result=&Apache::response::meta_package_write('stringresponse'); |
&Apache::response::end_response(); |
|
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::text_arg('Answer:','answer',$token); |
$result.=&Apache::edit::text_arg('Answer:','answer',$token); |
Line 558 sub start_stringresponse {
|
Line 563 sub start_stringresponse {
|
[['cs','Case Sensitive'],['ci','Case Insensitive'], |
[['cs','Case Sensitive'],['ci','Case Insensitive'], |
['mc','Case Insensitive, Any Order'], |
['mc','Case Insensitive, Any Order'], |
['re','Regular Expression']],$token); |
['re','Regular Expression']],$token); |
|
$result.=&Apache::edit::text_arg('String to display for answer:', |
|
'answerdisplay',$token); |
$result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); |
$result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); |
} elsif ($target eq 'modified') { |
} elsif ($target eq 'modified') { |
my $constructtag; |
my $constructtag; |
Line 570 sub start_stringresponse {
|
Line 577 sub start_stringresponse {
|
} |
} |
} elsif ($target eq 'web') { |
} elsif ($target eq 'web') { |
if ( &Apache::response::show_answer() ) { |
if ( &Apache::response::show_answer() ) { |
$Apache::inputtags::answertxt{$id}= |
my $answer= |
&Apache::lonxml::get_param('answer',$parstack,$safeeval); |
&Apache::lonxml::get_param('answerdisplay',$parstack,$safeeval); |
|
if (!defined $answer || $answer eq '') { |
|
$answer= |
|
&Apache::lonxml::get_param('answer',$parstack,$safeeval); |
|
} |
|
$Apache::inputtags::answertxt{$id}=$answer; |
} |
} |
} elsif ($target eq 'answer' || $target eq 'grade') { |
} elsif ($target eq 'answer' || $target eq 'grade') { |
&Apache::response::reset_params(); |
&Apache::response::reset_params(); |