--- loncom/homework/lonhomework.pm 2011/10/31 19:35:03 1.329
+++ loncom/homework/lonhomework.pm 2011/12/15 01:21:28 1.333
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Homework handler
#
-# $Id: lonhomework.pm,v 1.329 2011/10/31 19:35:03 raeburn Exp $
+# $Id: lonhomework.pm,v 1.333 2011/12/15 01:21:28 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -442,13 +442,13 @@ sub check_access {
$Apache::lonhomework::results{'resource.'.$id.'.maxtries'}=$maxtries;
if ($maxtries && $tries >= $maxtries) { $status = 'CANNOT_ANSWER'; }
# if (correct and show prob status) or excused then CANNOT_ANSWER
- if(($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/
- &&
- &show_problem_status()
- &&
- $Apache::lonhomework::history{"resource.$id.awarded"}==1)
- ||
- $Apache::lonhomework::history{"resource.$id.solved"}=~/^excused/) {
+ if ( ($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/)
+ && (&show_problem_status()) ) {
+ if (($Apache::lonhomework::history{"resource.$id.awarded"} >= 1) ||
+ (&Apache::lonnet::EXT("resource.$id.retrypartial") !~/^1|on|yes$/i)) {
+ $status = 'CANNOT_ANSWER';
+ }
+ } elsif ($Apache::lonhomework::history{"resource.$id.solved"}=~/^excused/) {
$status = 'CANNOT_ANSWER';
}
if ($status eq 'CANNOT_ANSWER'
@@ -698,7 +698,7 @@ sub analyze_header {
my $js = &Apache::structuretags::setmode_javascript();
# Breadcrumbs
- my $brcrum = [{'href' => &Apache::loncommon::authorspace(),
+ my $brcrum = [{'href' => &Apache::loncommon::authorspace($request->uri),
'text' => 'Construction Space'},
{'href' => '',
'text' => 'Problem Testing'},
@@ -936,7 +936,7 @@ sub editxmlmode {
&Apache::lonhtmlcommon::dragmath_js("EditMathPopup");
# Breadcrumbs
- my $brcrum = [{'href' => &Apache::loncommon::authorspace(),
+ my $brcrum = [{'href' => &Apache::loncommon::authorspace($request->uri),
'text' => 'Construction Space'},
{'href' => '',
'text' => 'Problem Editing'}];
@@ -1125,7 +1125,7 @@ sub get_template_list {
my $filename=$file->[0];
$filename=~s{^\Q$londocroot\E}{};
$result.=' '
- .''.&mt('Example').''
+ .&Apache::loncommon::modal_link($filename.'?inhibitmenu=yes',&mt('Example'),600,420,'sample')
.'
'."\n";
$count ++;
}
@@ -1162,7 +1162,7 @@ sub newproblem {
my $dest = &Apache::lonnet::filelocation("",$request->uri);
my $errormsg;
my $instructions;
- my $brcrum = [{'href' => &Apache::loncommon::authorspace(),
+ my $brcrum = [{'href' => &Apache::loncommon::authorspace($request->uri),
'text' => 'Construction Space'},
{'href' => '',
'text' => "Create New $extension"}];