version 1.44, 2001/08/18 07:56:51
|
version 1.46, 2001/11/12 20:27:28
|
Line 23 sub initialize_inputtags {
|
Line 23 sub initialize_inputtags {
|
@Apache::inputtags::previous=(); |
@Apache::inputtags::previous=(); |
# id of current part, 0 means that no part is current (inside <problem> only |
# id of current part, 0 means that no part is current (inside <problem> only |
$Apache::inputtags::part=''; |
$Apache::inputtags::part=''; |
# list of problem date statuses, the first element is for <problem> |
# list of problem date statuses, the first element is for <problem> |
#if there is a second element it is for the current <part> |
# if there is a second element it is for the current <part> |
@Apache::inputtags::status=(); |
@Apache::inputtags::status=(); |
#hash of defined params for the current response |
# hash of defined params for the current response |
%Apache::inputtags::params=(); |
%Apache::inputtags::params=(); |
|
# list of all ids, for <import>, these get join()ed and prepended |
|
@Apache::inputtags::import=(); |
} |
} |
|
|
sub start_input { |
sub start_input { |
Line 54 sub start_textarea {
|
Line 56 sub start_textarea {
|
if ( $cols eq '') { $cols = 80; } |
if ( $cols eq '') { $cols = 80; } |
my $rows = &Apache::lonxml::get_param('rows',$parstack,$safeeval); |
my $rows = &Apache::lonxml::get_param('rows',$parstack,$safeeval); |
if ( $rows eq '') { $rows = 10; } |
if ( $rows eq '') { $rows = 10; } |
$result= '<textarea name="HWVAL'.$Apache::inputtags::response['-1'].'" '. |
if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') { |
"rows=\"$rows\" cols=\"$cols\">".$oldresponse; |
$result= '<textarea name="HWVAL'.$Apache::inputtags::response['-1'].'" '. |
|
"rows=\"$rows\" cols=\"$cols\">".$oldresponse; |
|
} else { |
|
$result='<table border="1"><tr><td><i>'.$oldresponse.'</i></td></tr></table>'; |
|
} |
if ($oldresponse ne '') { |
if ($oldresponse ne '') { |
#get rid of any startup text if the user has already responded |
#get rid of any startup text if the user has already responded |
&Apache::lonxml::get_all_text("/textarea",$$parser[$#$parser]); |
&Apache::lonxml::get_all_text("/textarea",$$parser[$#$parser]); |
Line 67 sub start_textarea {
|
Line 73 sub start_textarea {
|
sub end_textarea { |
sub end_textarea { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
if ($target eq 'web') { |
if ($target eq 'web') { |
return "</textarea>"; |
if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') { |
} |
return "</textarea>"; |
|
} |
|
} |
&end_input; |
&end_input; |
return ''; |
return ''; |
} |
} |
Line 83 sub start_textline {
|
Line 91 sub start_textline {
|
my $id=$Apache::inputtags::response['-1']; |
my $id=$Apache::inputtags::response['-1']; |
my $oldresponse = |
my $oldresponse = |
$Apache::lonhomework::history{"resource.$partid.$id.submission"}; |
$Apache::lonhomework::history{"resource.$partid.$id.submission"}; |
$result= '<input type="text" name="HWVAL'.$id.'" value="'. |
if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') { |
$oldresponse.'" size="'.$size.'" />'; |
$result= '<input type="text" name="HWVAL'.$id.'" value="'. |
|
$oldresponse.'" size="'.$size.'" />'; |
|
} else { |
|
$result='<i>'.$oldresponse.'</i>'; |
|
} |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result=&Apache::edit::tag_start($target,$token, |
$result=&Apache::edit::tag_start($target,$token, |
&Apache::lonxml::description($token)); |
&Apache::lonxml::description($token)); |