--- loncom/homework/bridgetask.pm 2020/09/01 17:07:59 1.264.8.1 +++ loncom/homework/bridgetask.pm 2023/07/06 22:23:14 1.264.8.1.2.3 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.264.8.1 2020/09/01 17:07:59 raeburn Exp $ +# $Id: bridgetask.pm,v 1.264.8.1.2.3 2023/07/06 22:23:14 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -119,14 +119,21 @@ sub check_in_sequence { my ($symb) = &Apache::lonnet::whichuser(); my ($map) = &Apache::lonnet::decode_symb($symb); my @resources = - $navmap->retrieveResources($map, sub { $_[0]->is_problem() },0,0); + $navmap->retrieveResources($map, sub { $_[0]->is_problem() || $_[0]->is_tool() },0,0); my %old_history = %Apache::lonhomework::history; my %old_results = %Apache::lonhomework::results; foreach my $res (@resources) { &Apache::lonxml::debug("doing ".$res->src); &Apache::structuretags::initialize_storage($res->symb); - my $type = ($res->is_task()) ? 'Task' : 'problem'; + my $type; + if ($res->is_task()) { + $type = 'Task'; + } elsif ($res->is_tool) { + $type = 'tool'; + } else { + $type = 'problem'; + } &create_new_version($type,$user,$domain,$slot_name); &Apache::structuretags::finalize_storage($res->symb); } @@ -160,7 +167,7 @@ sub create_new_version { $domain = $env{'user.domain'}; } - } elsif ($type eq 'problem') { + } elsif (($type eq 'problem') || ($type eq 'tool')) { &Apache::lonxml::debug("authed $slot_name"); } if (!defined($user) || !defined($domain)) { @@ -682,7 +689,8 @@ sub start_Task { $target eq 'tex') { if ($env{'form.markaccess'}) { my @interval=&Apache::lonnet::EXT("resource.0.interval"); - &Apache::lonnet::set_first_access($interval[1],$interval[0]); + my ($timelimit) = ($interval[0] =~ /^(\d+)/); + &Apache::lonnet::set_first_access($interval[1],$timelimit); } } @@ -1408,7 +1416,7 @@ DONEBUTTON if ($canstore) { &Apache::structuretags::finalize_storage(); my @interval = &Apache::lonnet::EXT("resource.0.interval"); - if ($interval[0] =~ /^\d+$/ && $interval[1] eq 'resource') { + if ($interval[0] =~ /^\d+/ && $interval[1] eq 'resource') { my $key=$courseid."\0".$symb; my %times=&Apache::lonnet::get('firstaccesstimes', [$key],$domain,$name); @@ -3286,9 +3294,9 @@ sub proctor_validation_screen {
$lt{'prus'} | |
$lt{'pasw'} | |
$lt{'prdo'} | |
$lt{'prus'} | |
$lt{'pasw'} | |
$lt{'prdo'} |