--- loncom/homework/structuretags.pm 2009/05/28 12:39:17 1.447 +++ loncom/homework/structuretags.pm 2010/08/09 23:39:50 1.461.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.447 2009/05/28 12:39:17 bisitz Exp $ +# $Id: structuretags.pm,v 1.461.2.1 2010/08/09 23:39:50 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -212,8 +212,21 @@ sub page_start { if ($env{'environment.remote'} ne 'off') { $body_args{'only_body'} = 1; } - $pageheader = &Apache::lonhtmlcommon::breadcrumbs() # FIXME add breadcrumbs - .&Apache::loncommon::head_subbox( + # Breadcrumbs for Construction Space + &Apache::lonhtmlcommon::clear_breadcrumbs(); + &Apache::lonhtmlcommon::add_breadcrumb({ + 'text' => 'Construction Space', + 'href' => &Apache::loncommon::authorspace(), + }); + # breadcrumbs (and tools) will be created + # in start_page->bodytag->innerregister + +# FIXME Where are we? +# &Apache::lonhtmlcommon::add_breadcrumb({ +# 'text' => 'Problem Editing', # 'Problem Testing' +# 'href' => '', +# }); + $pageheader =&Apache::loncommon::head_subbox( &Apache::loncommon::CSTR_pageheader()); } } elsif (!defined($found{'body'})) { @@ -241,16 +254,19 @@ sub page_start { my $page_start = &Apache::loncommon::start_page($name,$extra_head, \%body_args); $page_start .= $pageheader; - if (!defined($found{'body'}) - && $env{'request.state'} ne 'construct' - && ($target eq 'web' || $target eq 'webgrade')) { - - my ($symb,undef,undef,undef,$publicuser)= &Apache::lonnet::whichuser(); - if ($symb eq '' && !$publicuser) { - my $help = &Apache::loncommon::help_open_topic("Ambiguous_Reference"); - $help=&mt("Browsing resource, all submissions are temporary.")."
"; - $page_start .= $help; - } + + unless ($env{'request.gcicontext'} eq 'buildtest') { + if (!defined($found{'body'}) + && $env{'request.state'} ne 'construct' + && ($target eq 'web' || $target eq 'webgrade')) { + + my ($symb,undef,undef,undef,$publicuser)= &Apache::lonnet::whichuser(); + if ($symb eq '' && !$publicuser) { + $page_start .= '

' + .&mt('Browsing resource, all submissions are temporary.') + .'

'; + } + } } if (!defined($found{'body'}) && $env{'request.state'} ne 'construct') { @@ -260,7 +276,8 @@ sub page_start { my $form_tag_start; if (!defined($found{'form'})) { $form_tag_start='
'. &problem_edit_buttons().' -
+
'.&Apache::lonxml::message_location().' '. - '
'; + '
'; } sub problem_edit_footer { return '

'. @@ -424,12 +441,14 @@ sub problem_web_to_edit_header { my $show_all_foils_text = ($Apache::lonhomework::parsing_a_task) ? - &mt(' Show All Instances') - : &mt(' Show All Foils'); + &mt('Show All Instances') + : &mt('Show All Foils'); - my $show_all= ''; + $show_all.= ' /> '.$show_all_foils_text + .''; @@ -502,7 +521,7 @@ $show_all -
+
@@ -526,7 +545,7 @@ $show_all $result.='
-
+
'; $result.=''; $result .= ''; $result.='
-
+
'.&Apache::lonxml::message_location().' '; return $result; @@ -635,7 +654,11 @@ item store_aggregates() sub store_aggregates { my ($symb,$courseid) = @_; - my %aggregate; + my (%aggregate,%subtracker); + my $tracksub; + if ($symb =~ m{^uploaded/gcitest/$LONCAPA::match_courseid/default_1261144274.sequence___\d+___gci/gci/}) { + $tracksub = 1; + } my @parts; my $cdomain = $env{'course.'.$env{'request.course.id'}.'.domain'}; my $cname = $env{'course.'.$env{'request.course.id'}.'.num'}; @@ -650,6 +673,9 @@ sub store_aggregates { $Apache::lonhomework::results{'resource.'.$part.'.award'} eq 'EXACT_ANS') { $aggregate{$symb."\0".$part."\0correct"} = 1; + if ($tracksub) { + $subtracker{$env{'user.name'}.':'.$env{'user.domain'}."\0correct"} ++; + } } if ($Apache::lonhomework::results{'resource.'.$part.'.tries'} == 1) { $aggregate{$symb."\0".$part."\0users"} = 1; @@ -662,11 +688,22 @@ sub store_aggregates { } } $aggregate{$symb."\0".$part."\0attempts"} = 1; + if ($tracksub) { + if ($Apache::lonhomework::type eq 'survey') { + $subtracker{$env{'user.name'}.':'.$env{'user.domain'}."\0surveysubs"} ++; + } else { + $subtracker{$env{'user.name'}.':'.$env{'user.domain'}."\0attempts"} ++; + } + } } if (keys (%aggregate) > 0) { &Apache::lonnet::cinc('nohist_resourcetracker',\%aggregate, $cdomain,$cname); } + if (keys(%subtracker) > 0) { + &Apache::lonnet::cinc('nohist_submissiontracker',\%subtracker, + $cdomain,$cname); + } } sub checkout_msg { @@ -680,9 +717,7 @@ sub checkout_msg { return (<$lt{'resource'}

$lt{'id_expln'}

- -

$lt{'warning'}

-
+

$lt{'warning'}

@@ -900,27 +935,34 @@ sub start_problem { if ($env{'request.state'} ne "construct" && ($symb eq '' || $Apache::lonhomework::type eq 'practice')) { $form_tag_start.=''. - ''; + $rndseed.'" />'; + unless ($env{'request.gcicontext'} eq 'buildtest') { + $form_tag_start .= ''; + } if (exists($env{'form.username'})) { $form_tag_start.= ''; } - if ($env{'request.role.adv'}) { - $form_tag_start.= - '