--- loncom/homework/inputtags.pm 2006/05/30 12:45:37 1.192
+++ loncom/homework/inputtags.pm 2006/06/09 16:27:28 1.195
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# input definitons
#
-# $Id: inputtags.pm,v 1.192 2006/05/30 12:45:37 www Exp $
+# $Id: inputtags.pm,v 1.195 2006/06/09 16:27:28 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -283,7 +283,9 @@ sub start_textline {
$Apache::lonxml::evaluate--;
my $partid=$Apache::inputtags::part;
my $id=$Apache::inputtags::response[-1];
- if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
+ if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER'
+ || ($Apache::inputtags::status[-1] eq 'CANNOT_ANSWER' &&
+ $Apache::lonhomework::history{"resource.$partid.solved"} !~ /^correct/ )) {
my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval);
my $maxlength;
if ($size eq '') { $size=20; } else {
@@ -298,12 +300,17 @@ sub start_textline {
}
my $readonly=&Apache::lonxml::get_param('readonly',$parstack,
$safeeval);
- if (lc($readonly) eq 'yes') {
+ if (lc($readonly) eq 'yes'
+ || $Apache::inputtags::status[-1] eq 'CANNOT_ANSWER') {
$readonly=' readonly="readonly" ';
} else {
$readonly='';
}
- $result.= '';
}
if ($Apache::lonhomework::type eq 'exam'
@@ -441,6 +448,7 @@ sub file_selector {
push(@filelist,''.$file.'');
if (! &Apache::lonnet::stat_file($url)) {
+ &Apache::lonnet::logthis("bad file is $url");
push(@bad_file_list,''.$file.'');
}
@@ -542,8 +550,8 @@ sub decideoutput {
if ($previous) { $previousmsg=&mt('You have entered that answer before'); }
- if ($solved =~ /^correct/) {
- $bgcolor=$possiblecolors{'correct'};
+ if ($solved =~ /^correct/) {
+ $bgcolor=$possiblecolors{'correct'};
$message=&mt('You are correct.');
if ($awarded < 1 && $awarded > 0) {
$message=&mt('You are partially correct.');
@@ -710,6 +718,14 @@ sub decideoutput {
$message = &mt("Unknown message").": $award";
$button=1;
}
+ my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser();
+ foreach my $resid(@Apache::inputtags::response){
+ &Apache::lonnet::logthis("handback is ".$Apache::lonhomework::history{"resource.$part.$resid.handback"});
+ if ($Apache::lonhomework::history{"resource.$part.$resid.handback"}) {
+ $message.= '
Returned File';
+ }
+ }
+
if (lc($Apache::lonhomework::problemstatus) eq 'no' &&
$Apache::inputtags::status[-1] ne 'SHOW_ANSWER') {
$message = &mt("Answer Submitted: Your final submission will be graded after the due date.");