--- loncom/homework/structuretags.pm 2015/09/14 13:45:19 1.539 +++ loncom/homework/structuretags.pm 2015/12/10 16:26:43 1.543 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.539 2015/09/14 13:45:19 raeburn Exp $ +# $Id: structuretags.pm,v 1.543 2015/12/10 16:26:43 damieng Exp $ # # Copyright Michigan State University Board of Trustees # @@ -523,23 +523,25 @@ sub page_start { } elsif (!defined($found{'body'}) && $env{'request.state'} eq 'construct') { if ($target eq 'web' || $target eq 'edit') { - # Breadcrumbs for Authoring Space - &Apache::lonhtmlcommon::clear_breadcrumbs(); - &Apache::lonhtmlcommon::add_breadcrumb({ - 'text' => 'Authoring Space', - 'href' => &Apache::loncommon::authorspace($env{'request.uri'}), - }); - # breadcrumbs (and tools) will be created - # in start_page->bodytag->innerregister + unless ($env{'form.inhibitmenu'} eq 'yes') { + # Breadcrumbs for Authoring Space + &Apache::lonhtmlcommon::clear_breadcrumbs(); + &Apache::lonhtmlcommon::add_breadcrumb({ + 'text' => 'Authoring Space', + 'href' => &Apache::loncommon::authorspace($env{'request.uri'}), + }); + # 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()); - } +# &Apache::lonhtmlcommon::add_breadcrumb({ +# 'text' => 'Problem Editing', # 'Problem Testing' +# 'href' => '', +# }); + $pageheader = &Apache::loncommon::head_subbox( + &Apache::loncommon::CSTR_pageheader()); + } + } } elsif (!defined($found{'body'})) { my %add_entries; my $background=&Apache::lonxml::get_param('background',$parstack, @@ -976,6 +978,12 @@ $show_all 'onclick="javascript:setmode(this.form,'."'edit'".')" />'; $result .= ''; + if ($env{'browser.type'} ne 'explorer' || $env{'browser.version'} > 9) { + my $uri = $env{'request.uri'}; + my $daxeurl = '/daxepage'.$uri; + $result .= ''; + } $result.='
@@ -1510,6 +1518,7 @@ sub start_problem { my $status; my $accessmsg; my $resource_due; + my $ipused; my $name= &get_resource_name($parstack,$safeeval); my ($result,$form_tag_start,$slot_name,$slot,$probpartlist); @@ -1522,7 +1531,7 @@ sub start_problem { &Apache::lonnet::set_first_access($interval[1],$timelimit); } - ($status,$accessmsg,$slot_name,$slot) = + ($status,$accessmsg,$slot_name,$slot,$ipused) = &Apache::lonhomework::check_slot_access('0','problem'); push (@Apache::inputtags::status,$status); } @@ -1613,7 +1622,8 @@ sub start_problem { ( $status eq 'NOTRESERVABLE') || ( $status eq 'RESERVABLE') || ( $status eq 'RESERVABLE_LATER') || - ( $status eq 'INVALID_ACCESS')) { + ( $status eq 'INVALID_ACCESS') || + ( $status eq 'NEED_DIFFERENT_IP')) { my $bodytext=&Apache::lonxml::get_all_text("/problem",$parser, $style); if ( $target eq "web" ) { @@ -1646,7 +1656,14 @@ sub start_problem { &Apache::lonnavmaps::timeToHumanString($accessmsg,'start')); } elsif ($status eq 'NOTRESERVABLE') { $msg.=&mt('Not available to make a reservation.'); - } + } elsif ($status eq 'NEED_DIFFERENT_IP') { + if ($ipused) { + $msg.=&mt('You must use the same computer ([_1]) you used when you first accessed this resource using your time/place-based reservation.',"IP: $ipused"); + } else { + $msg.=&mt('Each student must use a different computer to access this resource at this time and/or place.').'
'. + &mt('Somebody else has already used this particular computer for that purpose.'); + } + } $result.=$msg.'
'; } elsif ($target eq 'tex') { my $startminipage = ($env{'form.problem_split'}=~/yes/i)? '' @@ -1666,8 +1683,11 @@ sub start_problem { $result .= &Apache::bridgetask::proctor_validation_screen($slot); } elsif ($target eq 'grade') { - &Apache::bridgetask::proctor_check_auth($slot_name,$slot, - 'problem'); + my $checkinresult = &Apache::bridgetask::proctor_check_auth($slot_name,$slot, + 'problem'); + if ($checkinresult = /^error:/) { + $result .= 'error'; + } } } elsif ($target eq 'web') { if ($status eq 'CAN_ANSWER') { @@ -1677,10 +1697,18 @@ sub start_problem { $Apache::lonhomework::history{'resource.0.checkedin'}; if ($checked_in eq '') { # unproctored slot access, self checkin - &Apache::bridgetask::check_in('problem',undef,undef, - $slot_name); - $checked_in = - $Apache::lonhomework::results{"resource.0.checkedin"}; + my $needsiptied; + if (ref($slot)) { + $needsiptied = $slot->{'iptied'}; + } + my $check = &Apache::bridgetask::check_in('problem',undef,undef, + $slot_name,$needsiptied); + if ($check =~ /^error: /) { + &Apache::lonnet::logthis("Error during self-checkin of problem (symb: $env{'request.symb'}) using slot: $slot_name"); + } else { + $checked_in = + $Apache::lonhomework::results{"resource.0.checkedin"}; + } } if ((ref($slot) eq 'HASH') && ($checked_in ne '')) { if ($slot->{'starttime'} < time()) { @@ -1703,7 +1731,9 @@ sub start_problem { ''; # create a page header and exit if ($env{'request.state'} eq "construct") { - $result.= &problem_web_to_edit_header($env{'form.rndseed'}); + unless ($env{'form.inhibitmenu'} eq 'yes') { + $result.= &problem_web_to_edit_header($env{'form.rndseed'}); + } if ($Apache::lonhomework::type eq 'practice') { $result.= ''.