--- loncom/homework/inputtags.pm 2011/07/26 17:14:51 1.293
+++ loncom/homework/inputtags.pm 2012/01/29 03:02:52 1.301
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# input definitons
#
-# $Id: inputtags.pm,v 1.293 2011/07/26 17:14:51 raeburn Exp $
+# $Id: inputtags.pm,v 1.301 2012/01/29 03:02:52 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -911,7 +911,13 @@ sub decideoutput {
}
}
}
- if ($awarded==1) { $button=0; } else { $button=1; }
+ if ($awarded >= 1) {
+ $button=0;
+ } elsif (&Apache::lonnet::EXT("resource.$part.retrypartial") !~/^1|on|yes$/i) {
+ $button=0;
+ } else {
+ $button=1;
+ }
$previousmsg='';
} elsif ($solved =~ /^excused/) {
if ($target eq 'tex') {
@@ -1070,6 +1076,7 @@ sub decideoutput {
} elsif ($award eq 'ANONYMOUS_CREDIT') {
$message = &mt("Your anonymous submission has been recorded, and credit awarded.");
$css_class=$possible_class{'correct'};
+ $button=1;
} elsif ($award eq 'DRAFT') {
$message = &mt("Copy saved but not submitted.");
$css_class=$possible_class{'not_charged_try'};
@@ -1459,7 +1466,7 @@ sub get_grade_messages {
$trial.="/".$Apache::inputtags::params{'maxtries'};
}
}
- $trystr = '
'.&mt($tries_text.' [_1]',$trial).'';
+ $trystr = ' | '.&mt($tries_text.' [_1]',$trial).' | ';
}
}
@@ -1488,7 +1495,10 @@ sub gradestatus {
&& $status ne 'UNAVAILABLE'
&& $status ne 'INVALID_ACCESS'
&& $status ne 'NEEDS_CHECKIN'
- && $status ne 'NOT_IN_A_SLOT') {
+ && $status ne 'NOT_IN_A_SLOT'
+ && $status ne 'RESERVABLE'
+ && $status ne 'RESERVABLE_LATER'
+ && $status ne 'NOTRESERVABLE') {
($previousmsg,$latemessage,$message,$trystr) =
&get_grade_messages($id,"resource.$id",$target,$status,
@@ -1580,7 +1590,7 @@ sub previous_tries {
{$1 $txt_correct. $3}s;
}
my $trystr = "(".&mt('Try [_1]',$Apache::lonhomework::history{"$prefix.tries"}).")";
- if ($curr_rndseed || $lastrndseed) {
+ if (($curr_rndseed || $lastrndseed) && ($i > 1)) {
if ($curr_rndseed ne $lastrndseed) {
$trystr .= '
'.&mt('New problem variation this try.').'';
}
@@ -1622,31 +1632,13 @@ sub previous_tries {
''.
&mt('Submitted Answer').' | ';
$output ='';
- #return $output;
- $output = &Apache::loncommon::js_ready($output);
- $output.='
';
- my $windowopen=&Apache::lonhtmlcommon::javascript_docopen();
my $tries_text = &get_tries_text('link');
- my $start_page =
- &Apache::loncommon::start_page($tries_text, undef,
- {'only_body' => 1,
- 'bgcolor' => '#FFFFFF',
- 'js_ready' => 1,
- 'inherit_jsmath' => 1, });
- my $end_page =
- &Apache::loncommon::end_page({'js_ready' => 1,});
my $prefix = $env{'form.request.prefix'};
$prefix =~ tr{.}{_};
my $function_name = "LONCAPA_previous_tries_".$prefix.
$Apache::lonxml::curdepth.'_'.$env{'form.counter'};
- my $result ="".&mt($tries_text)."
";
- #use Data::Dumper;
- #&Apache::lonnet::logthis(&Dumper(\%Apache::inputtags::submission_display));
+ my $result = &Apache::loncommon::modal_adhoc_window($function_name,420,410,$output,&mt($tries_text))."
";
return $result;
}