--- loncom/homework/inputtags.pm 2006/09/21 21:23:19 1.205
+++ loncom/homework/inputtags.pm 2006/10/17 15:11:11 1.209
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# input definitons
#
-# $Id: inputtags.pm,v 1.205 2006/09/21 21:23:19 albertel Exp $
+# $Id: inputtags.pm,v 1.209 2006/10/17 15:11:11 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -283,6 +283,7 @@ sub needs_exam_box {
sub start_textline {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
my $result = "";
+ my $id = &start_input($parstack,$safeeval);
if ($target eq 'web') {
$Apache::lonxml::evaluate--;
my $partid=$Apache::inputtags::part;
@@ -321,7 +322,8 @@ sub start_textline {
}
} else {
#right or wrong don't show what was last typed in.
- $result=''.$Apache::inputtags::answertxt{$id}.'';
+ my $count = scalar(@Apache::inputtags::inputlist)-1;
+ $result=''.$Apache::inputtags::answertxt{$id}[$count].'';
#$result='';
}
} elsif ($target eq 'edit') {
@@ -356,6 +358,7 @@ sub end_textline {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
if ($target eq 'web') { $Apache::lonxml::evaluate++; }
elsif ($target eq 'edit') { return ('','no'); }
+ &end_input();
return "";
}
@@ -459,7 +462,7 @@ sub show_past_portfile_submission {
}
my (@file_list,@bad_file_list);
foreach my $file (split(/\s*,\s*/,&unescape($Apache::lonhomework::history{"resource.$part.$id.portfiles"}))) {
- my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser();
+ my (undef,undef,$domain,$user)=&Apache::lonnet::whichuser();
my $url="/uploaded/$domain/$user/portfolio$file";
my $icon=&Apache::loncommon::icon($url);
push(@file_list,'
{$award} < $best) {
+ $best = $awards->{$award};
+ $which = $j;
+ }
+ $j++;
+ }
+ if (defined($which)) {
+ if (ref($nameref)) {
+ return ($$awardref[$which],$$msgref[$which],$$nameref[$which]);
+ } else {
+ return ($$awardref[$which],$$msgref[$which]);
+ }
}
return ('ERROR',undef);
}
+}
sub decideoutput {
my ($award,$awarded,$awardmsg,$solved,$previous,$target)=@_;
@@ -740,7 +753,7 @@ sub decideoutput {
$message = &mt("Unknown message").": $award";
$button=1;
}
- my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser();
+ my (undef,undef,$domain,$user)=&Apache::lonnet::whichuser();
foreach my $resid(@Apache::inputtags::response){
if ($Apache::lonhomework::history{"resource.$part.$resid.handback"}) {
$message.='
';