version 1.3, 2005/04/07 06:56:22
|
version 1.11, 2016/05/31 22:04:14
|
Line 4
|
Line 4
|
<message_text>Select </message_text> |
<message_text>Select </message_text> |
</message> |
</message> |
<choices variable="harry"> |
<choices variable="harry"> |
<choice computer='1' nextstate="Student">Reset times on one or more maps for a single student.</choice> |
<choice computer='1' nextstate="Student">Reset times on one or more folders/maps, resources or the course for a single student.</choice> |
<choice computer='0' nextstate="Class">Reset times on a single map for a section or whole clase.</choice> |
<choice computer='0' nextstate="Class">Reset times on a single folder/map, resource or the course for a section or the whole class.</choice> |
</choices> |
</choices> |
</state> |
</state> |
<state name="Student" title="Select Student"> |
<state name="Student" title="Select Student"> |
Line 17
|
Line 17
|
|
|
<state name="SelectAccess"> |
<state name="SelectAccess"> |
<message nextstate="ConfirmStu"> |
<message nextstate="ConfirmStu"> |
<message_text>This is a list of maps and times they were accessed, plese select those you want deleted.</message_text> |
<message_text>This is a list of first access times and what was accessed, please select those you want deleted.</message_text> |
</message> |
</message> |
<choices variable='delete' multichoice='true'> |
<choices variable='delete' multichoice='true'> |
<exec> |
<exec> |
Line 27
|
Line 27
|
foreach my $res (sort(keys(%times))) { |
foreach my $res (sort(keys(%times))) { |
my (undef,$symb)=split("\0",$res); |
my (undef,$symb)=split("\0",$res); |
my $escsymb=&Apache::lonnet::escape($symb); |
my $escsymb=&Apache::lonnet::escape($symb); |
my $title=&Apache::lonnet::gettitle($symb); |
my $title = |
|
($symb ne 'course') ? &Apache::lonnet::gettitle($symb) |
|
: $env{'course.'.$env{'request.course.id'}.'.description'}; |
my $time=&Apache::lonlocal::locallocaltime($times{$res}); |
my $time=&Apache::lonlocal::locallocaltime($times{$res}); |
my $description="<a href='/adm/navmaps?postsymb=".&Apache::lonnet::escape($symb)."'>$title</a> on $time"; |
my $description="<a href='/adm/navmaps?postsymb=".&Apache::lonnet::escape($symb)."'>$title</a> on $time"; |
push(@{$state->{CHOICES}},[$description,$escsymb]); |
push(@{$state->{CHOICES}},[$description,$escsymb]); |
Line 45
|
Line 47
|
if (!$fullname) { $fullname="$uname\@$udom"; } |
if (!$fullname) { $fullname="$uname\@$udom"; } |
return '<li>'.$fullname.'</li>'; |
return '<li>'.$fullname.'</li>'; |
</eval> |
</eval> |
<message><message_text></ul> for maps <ul></message_text></message> |
<message><message_text></ul> for <ul></message_text></message> |
<eval> |
<eval> |
my $list; |
my $list; |
my @symbs=split(/\|\|\|/,$helper->{'VARS'}{'delete'}); |
my @symbs=split(/\|\|\|/,$helper->{'VARS'}{'delete'}); |
foreach my $escsymb (@symbs) { |
foreach my $escsymb (@symbs) { |
my $symb=&Apache::lonnet::unescape($escsymb); |
my $symb=&Apache::lonnet::unescape($escsymb); |
$list.='<li>'.&Apache::lonnet::gettitle($symb).'</li>'; |
my $title = |
|
($symb ne 'course') ? &Apache::lonnet::gettitle($symb) |
|
: $env{'course.'.$env{'request.course.id'}.'.description'}; |
|
$list.='<li>'.$title.'</li>'; |
} |
} |
return $list; |
return $list; |
</eval> |
</eval> |
Line 60
|
Line 65
|
<state name="FinishStu" title="Processing"> |
<state name="FinishStu" title="Processing"> |
<final> |
<final> |
<finalcode> |
<finalcode> |
&Apache::lonnet::logthis($helper->{'VARS'}{'delete'}); |
|
if ($helper->{'STATE'} ne 'FinishStu') { return; } |
if ($helper->{'STATE'} ne 'FinishStu') { return; } |
my $result; |
my $result; |
my $courseid=$env{'request.course.id'}; |
my $courseid=$env{'request.course.id'}; |
my ($uname,$udom,$sec,$fullname)=split(':',$helper->{'VARS'}{'stu1'}); |
my ($uname,$udom,$sec,$fullname)=split(':',$helper->{'VARS'}{'stu1'}); |
&Apache::lonnet::logthis($helper->{'VARS'}{'delete'}); |
&Apache::lonnet::logthis($helper->{'VARS'}{'delete'}); |
|
my $needsdeval; |
foreach my $escsymb (split(/\|\|\|/,$helper->{'VARS'}{'delete'})) { |
foreach my $escsymb (split(/\|\|\|/,$helper->{'VARS'}{'delete'})) { |
my $symb=&Apache::lonnet::unescape($escsymb); |
my $symb=&Apache::lonnet::unescape($escsymb); |
|
my $key = "$courseid\0$symb"; |
|
my $title = |
|
($symb ne 'course') ? &Apache::lonnet::gettitle($symb) |
|
: $env{'course.'.$courseid.'.description'}; |
my $res=&Apache::lonnet::del('firstaccesstimes', |
my $res=&Apache::lonnet::del('firstaccesstimes', |
["$courseid\0$symb"],$udom,$uname); |
[$key],$udom,$uname); |
$result.="Removing access time from ". |
$result.="Removing access time from ". |
&Apache::lonnet::gettitle($symb).": ".$res.'</li><li>'; |
$title.": ".$res.'</li><li>'; |
|
if ($res eq 'ok') { |
|
if ($symb ne 'course') { |
|
my $what = []; |
|
my ($storeunder,@recurseup,$recursed); |
|
my $mapp = &Apache::lonnet::deversion(( |
|
&Apache::lonnet::decode_symb($symb))[2]); |
|
if ($symb =~ /\.(page|sequence)$/) { |
|
$storeunder = $env{'request.course.id'}.'.'.$mapp.'___(all).0.interval'; |
|
$what = [$storeunder,'map']; |
|
} else { |
|
$storeunder = $env{'request.course.id'}.'.'.$symb.'.0.interval'; |
|
$what = [$storeunder,'resource']; |
|
} |
|
&Apache::lonnet::del('timerinterval',[$key],$udom,$uname); |
|
my $userreply=&Apache::lonnet::resdata($uname,$udom,'user',$mapp, |
|
\$recursed,\@recurseup, |
|
$env{'request.course.id'}, |
|
'.','0.interval',($what)); |
|
if (ref($userreply) eq 'ARRAY') { |
|
if ($userreply->[0] =~ /^\d+$/) { |
|
if (($userreply->[1] eq 'map') || ($userreply->[1] eq 'resource')) { |
|
my %storecontent=($storeunder => $userreply->[0], |
|
$storeunder.'.type' => 'date_interval'); |
|
if (&Apache::lonnet::del |
|
('resourcedata',[keys(%storecontent)],$udom,$uname) eq 'ok') { |
|
&Apache::lonparmset::log_parmset(\%storecontent,1,$uname,$udom); |
|
$needsdeval = 1; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
} |
} |
|
if ($needsdeval) { |
|
&Apache::lonnet::devalidateuserresdata($uname,$udom); |
|
} |
$result=~s/<li>$//; |
$result=~s/<li>$//; |
return $result; |
return $result; |
</finalcode> |
</finalcode> |
Line 82
|
Line 127
|
|
|
<state name="Class"> |
<state name="Class"> |
<message nextstate="SelectMap"> |
<message nextstate="SelectMap"> |
<message_text>Select:<br /></message_text> |
|
</message> |
</message> |
<student variable='stu1' coursepersonnel='true' activeonly='true' multichoice='true' /> |
<student variable='stu1' coursepersonnel='true' activeonly='true' multichoice='true' /> |
</state> |
</state> |
|
|
<state name="SelectMap" title="Select a map"> |
<state name="SelectMap" title="Select a folder/map"> |
<message><message_text>Choose a resource</message_text></message> |
<resource variable="res2" includecourse="true"> |
<resource variable="res2"> |
<filterfunc>return (($res->is_map() && $res->map_contains_problem()) |
<filterfunc>return $res->is_map()</filterfunc> |
||$res->is_problem() );</filterfunc> |
<valuefunc>return $res->symb()</valuefunc> |
<valuefunc>return $res->symb()</valuefunc> |
<nextstate>ShowPlan</nextstate> |
<nextstate>ShowPlan</nextstate> |
</resource> |
</resource> |
Line 123
|
Line 167
|
my $symb=$helper->{'VARS'}{'res2'}; |
my $symb=$helper->{'VARS'}{'res2'}; |
my $key=$env{'request.course.id'}."\0".$symb; |
my $key=$env{'request.course.id'}."\0".$symb; |
my @names=split(/\|\|\|/,$helper->{'VARS'}{'stu1'}); |
my @names=split(/\|\|\|/,$helper->{'VARS'}{'stu1'}); |
|
my $what = []; |
|
my ($storeunder,@recurseup,$recursed); |
|
my $mapp = &Apache::lonnet::deversion(( |
|
&Apache::lonnet::decode_symb($symb))[2]); |
|
if ($symb =~ /\.(page|sequence)$/) { |
|
$storeunder = $env{'request.course.id'}.'.'.$mapp.'___(all).0.interval'; |
|
$what = [$storeunder,'map']; |
|
} else { |
|
$storeunder = $env{'request.course.id'}.'.'.$symb.'.0.interval'; |
|
$what = [$storeunder,'resource']; |
|
} |
|
my %donedeval; |
foreach my $name (@names) { |
foreach my $name (@names) { |
my ($uname,$udom,$sec,$fullname)=split(':',$name); |
my ($uname,$udom,$sec,$fullname)=split(':',$name); |
if (!$fullname) { $fullname="$uname\@$udom"; } |
if (!$fullname) { $fullname="$uname\@$udom"; } |
Line 134
|
Line 190
|
$result.="Removing access times ". |
$result.="Removing access times ". |
&Apache::lonlocal::locallocaltime($times{$key}). |
&Apache::lonlocal::locallocaltime($times{$key}). |
" found for student ".$fullname.": "; |
" found for student ".$fullname.": "; |
$result.=&Apache::lonnet::del('firstaccesstimes', |
my $delres=&Apache::lonnet::del('firstaccesstimes', |
[$key],$udom,$uname); |
[$key],$udom,$uname); |
|
$result.=$delres; |
|
if ($delres eq 'ok') { |
|
&Apache::lonnet::del('timerinterval', |
|
[$key],$udom,$uname); |
|
my $userreply=&Apache::lonnet::resdata($uname,$udom,'user',$mapp, |
|
\$recursed,\@recurseup, |
|
$env{'request.course.id'}, |
|
'.','0.interval',($what)); |
|
if (ref($userreply) eq 'ARRAY') { |
|
if ($userreply->[0] =~ /^\d+$/) { |
|
if (($userreply->[1] eq 'map') || ($userreply->[1] eq 'resource')) { |
|
my %storecontent=($storeunder => $userreply->[0], |
|
$storeunder.'.type' => 'date_interval'); |
|
if (&Apache::lonnet::del |
|
('resourcedata',[keys(%storecontent)],$udom,$uname) eq 'ok') { |
|
&Apache::lonparmset::log_parmset(\%storecontent,1,$uname,$udom); |
|
unless ($donedeval{$uname.':'.$udom}) { |
|
&Apache::lonnet::devalidateuserresdata($uname,$udom); |
|
$donedeval{$uname.':'.$udom} = 1; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
} |
} |
$result.="</li>\n<li>"; |
$result.="</li>\n<li>"; |
} |
} |