--- rat/lonuserstate.pm 2019/02/07 01:51:34 1.149.2.2 +++ rat/lonuserstate.pm 2018/03/29 19:59:08 1.155 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Construct and maintain state and binary representation of course for user # -# $Id: lonuserstate.pm,v 1.149.2.2 2019/02/07 01:51:34 raeburn Exp $ +# $Id: lonuserstate.pm,v 1.155 2018/03/29 19:59:08 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -42,7 +42,7 @@ use Safe::Hole; use Opcode; use Apache::lonenc; use Fcntl qw(:flock); -use LONCAPA; +use LONCAPA qw(:DEFAULT :match); use File::Basename; @@ -255,9 +255,9 @@ sub loadmap { push(@map_ids, $resource_id); if ($hash{'src_'.$lpc.'.'.$resource_id}) { $rescount{$lpc} ++; - if (($hash{'src_'.$lpc.'.'.$resource_id}=~/\.sequence$/) || + if (($hash{'src_'.$lpc.'.'.$resource_id}=~/\.sequence$/) || ($hash{'src_'.$lpc.'.'.$resource_id}=~/\.page$/)) { - $mapcount{$lpc} ++; + $mapcount{$lpc} ++; } } unless ($codechecked) { @@ -484,6 +484,8 @@ sub parse_resource { } elsif ($turi!~/\.(sequence|page)$/) { $turi='/adm/coursedocs/showdoc'.$turi; } + } elsif ($turi=~ m{^/adm/$match_domain/$match_courseid/\d+/ext\.tool$}) { + $turi='/adm/wrapper'.$turi; } elsif ($turi=~/\S/) { # normal non-empty internal resource my $mapdir=$uri; $mapdir=~s/[^\/]+$//; @@ -1227,11 +1229,8 @@ sub readmap { undef %randompick; undef %randompickseed; undef %randomorder; - undef %randomizationcode; undef %hiddenurl; undef %encurl; - undef %rescount; - undef %mapcount; $retfrid=''; $errtext=''; my ($untiedhash,$untiedparmhash,$tiedhash,$tiedparmhash); # More state flags. @@ -1375,11 +1374,8 @@ sub readmap { undef %randompick; undef %randompickseed; undef %randomorder; - undef %randomizationcode; undef %hiddenurl; undef %encurl; - undef %rescount; - undef %mapcount; $errtext=''; $retfrid=''; #