--- loncom/homework/inputtags.pm 2001/06/01 15:52:50 1.34
+++ loncom/homework/inputtags.pm 2001/07/13 14:02:35 1.38
@@ -31,6 +31,7 @@ sub initialize_inputtags {
sub start_input {
my ($parstack,$safeeval)=@_;
my $id = &Apache::lonxml::get_param('id',$parstack,$safeeval);
+ if ($id eq '') { $id = $Apache::lonxml::curdepth; }
push (@Apache::inputtags::input,$id);
push (@Apache::inputtags::inputlist,$id);
return $id;
@@ -42,7 +43,7 @@ sub end_input {
}
sub start_textarea {
- my ($target,$token,$parstack,$parser,$safeeval)=@_;
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
my $result = "";
my $id = &start_input($parstack,$safeeval);
if ($target eq 'web') {
@@ -62,7 +63,7 @@ sub start_textarea {
}
sub end_textarea {
- my ($target,$token,$parstack,$parser,$safeeval)=@_;
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
if ($target eq 'web') {
return "";
}
@@ -71,7 +72,7 @@ sub end_textarea {
}
sub start_textline {
- my ($target,$token,$parstack,$parser,$safeeval)=@_;
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
my $result = "";
if ($target eq 'web') {
my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval);
@@ -79,11 +80,21 @@ sub start_textline {
my $oldresponse = $Apache::lonhomework::history{"resource.$Apache::inputtags::part.$Apache::inputtags::response['-1'].submission"};
$result= '';
}
+ if ($target eq 'edit') {
+ $result.=&Apache::edit::tag_start($target,$token,&Apache::lonxml::description($token));
+ $result.=&Apache::edit::text_arg('Size:','size',$token,'5')."";
+ $result.=&Apache::edit::end_table;
+ }
+ if ($target eq 'modified') {
+ my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'size');
+ if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
+ }
return $result;
}
sub end_textline {
- my ($target,$token,$parstack,$parser,$safeeval)=@_;
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
+ if ($target eq 'edit') { return ('','no'); }
return "";
}
@@ -92,7 +103,7 @@ sub start_datasubmission {
}
sub end_datasubmission {
- my ($target,$token,$parstack,$parser,$safeeval)=@_;
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
if ( $target == 'web' ) {
return '';
}
@@ -148,9 +159,22 @@ sub decideoutput {
my ($award,$solved)=@_;
my $message='';
my $button=0;
- if ($solved =~ /^correct/ || $award eq 'EXACT_ANS' || $award eq 'APPROX_ANS' ) {
- $message = "You are correct. Your receipt is ".&Apache::lonnet::receipt;
+ if ($solved =~ /^correct/) {
+ $message = "You are correct. Your receipt is ".
+ &Apache::lonnet::receipt;
+ $button=0;
+ } elsif ($solved =~ /^excused/) {
+ $message = "You are excused from the problem.";
$button=0;
+ } elsif ($award eq 'EXACT_ANS' || $award eq 'APPROX_ANS' ) {
+ if ($solved =~ /^incorrect/ || $solved eq '') {
+ $message = "Incorrect";
+ $button=1;
+ } else {
+ $message = "You are correct. Your receipt is ".
+ &Apache::lonnet::receipt;
+ $button=0;
+ }
} elsif ($award eq 'NO_RESPONSE') {
$message = '';
$button=1;