--- loncom/homework/inputtags.pm 2007/05/21 22:57:17 1.224 +++ loncom/homework/inputtags.pm 2007/08/03 23:29:57 1.228 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.224 2007/05/21 22:57:17 albertel Exp $ +# $Id: inputtags.pm,v 1.228 2007/08/03 23:29:57 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,7 +31,6 @@ use strict; use Apache::loncommon; use Apache::lonlocal; use Apache::lonnet; -use lib '/home/httpd/lib/perl/'; use LONCAPA; @@ -116,8 +115,7 @@ sub check_for_duplicate_ids { sub start_input { my ($parstack,$safeeval)=@_; - my $id = &Apache::lonxml::get_param('id',$parstack,$safeeval); - if ($id eq '') { $id = $Apache::lonxml::curdepth; } + my $id = &Apache::lonxml::get_id($parstack,$safeeval); push (@Apache::inputtags::input,$id); push (@Apache::inputtags::inputlist,$id); return $id; @@ -449,7 +447,7 @@ sub file_selector { $result.='
'.''.&mt('OR:').'
'; } if ($which eq 'portfolioonly' || $which eq 'both') { - $result.=$extratext.''. + $result.=$extratext.''. &mt('Select Portfolio Files').'
'. ''. '
'; @@ -637,9 +635,6 @@ sub decideoutput { &mt('Your receipt is').' '.&Apache::lonnet::receipt($Apache::inputtags::part). (($target eq 'web')?&Apache::loncommon::help_open_topic('Receipt'):''); } - &Apache::lonnet::logthis(" er \n$symb\n$message\n".$env{'course.'. - $env{'request.course.id'}. - '.disable_receipt_display'}); } $button=0; $previousmsg=''; @@ -1183,12 +1178,15 @@ sub previous_tries { my ($match,$which) = &find_which_previous($i); $message=$previousmsg; my $previous = $count_lookup{$which}; - $message =~ s{()}{ as submission # $previous $1}; + $message =~ s{()}{ as submission \# $previous $1}; } elsif ($Apache::lonhomework::history{"$prefix.tries"}) { - if ( $Apache::lonhomework::history{"$prefix.solved"} =~ - /^correct/) { + if (!(lc($Apache::lonhomework::problemstatus) eq 'no' + && $Apache::inputtags::status[-1] ne 'SHOW_ANSWER') + && $Apache::lonhomework::history{"$prefix.solved"} =~/^correct/ + ) { + $message =~ s{()(.*?)()} - {$1 Correct. $3}; + {$1 Correct. $3}s; } my $trystr = "(Try ". $Apache::lonhomework::history{"$prefix.tries"}.')'; @@ -1228,6 +1226,8 @@ sub previous_tries { $output=~s/\\/\\\\/g; $output=~s/\'/\\\'/g; $output=~s/\s+/ /g; + $output.='
'; + my $windowopen=&Apache::lonhtmlcommon::javascript_docopen(); my $start_page = &Apache::loncommon::start_page('Previous Tries', undef,