--- loncom/interface/lonblockingmenu.pm 2016/10/16 21:49:51 1.19
+++ loncom/interface/lonblockingmenu.pm 2016/10/23 14:35:32 1.22
@@ -2,7 +2,7 @@
# Routines for configuring blocking of access to collaborative functions,
# and specific resources during an exam
#
-# $Id: lonblockingmenu.pm,v 1.19 2016/10/16 21:49:51 raeburn Exp $
+# $Id: lonblockingmenu.pm,v 1.22 2016/10/23 14:35:32 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -318,13 +318,16 @@ Creates web form elements used to select
items in the course for use in an exam block of type: "Triggered by
Activating Timer".
-Inputs: 7 (three required, last four optional)
+Inputs: 8 (four required, last four optional)
- $intervals - Reference to hash of parameters for timed intervals
- $parmcount - numeric ID of current block
- $navmap - navmaps object
+ - $context - this will be "accesstimes" if called by lonaccesstimes.pm,
+ or "blocking" if called internally by lonblockingmenu.pm
+
- $currkey - current interval (where this is a block already using
an interval-based trigger).
@@ -339,6 +342,34 @@ Inputs: 7 (three required, last four opt
Outputs: 1 - $intervalform - web form elements used to select a time interval
+=item &interval_details()
+
+Creates name/scope of current interval and expandable/collapsible
+showing which interval parameters apply to the current folder/resource
+
+Inputs: 6
+
+ - $item - course, map url, or resource symb
+
+ - $type - course, map, or resource
+
+ - $url - url of item (null if item is course).
+
+ - $navmap - navmaps object
+
+ - $intervals - Reference to hash of parameters for timed intervals
+
+ - $parmcount - unique ID for current element.
+
+
+Outputs: 2
+
+ - $itemname - name/scope of interval (timer) parameter
+
+ - $iteminfo - Expandable/collapsible block showing which interval
+ (timer) parameters affect the current folder or resource.
+
+
=item &trigger_details_toggle()
Creates link used to expand item showing information about timer for current
@@ -348,6 +379,7 @@ Inputs: 1 - $parmcount - numericID of ex
Outputs: 1 - returns HTML for link to display contents of information item
+
=item &show_timer_path()
Display hierarchy of names of folders/sub-folders containing the current
@@ -392,11 +424,20 @@ Output: 1 - Javascript (with tags) for functions used to:
+ toggle visibility of unordered list for display of detailed
+ information about intervals.
+
=back
=cut
@@ -520,7 +561,8 @@ sub handler {
({href=>'/adm/setblock',
text=>'Blocking communication/content access'});
- my $js = &blockingmenu_javascript($blockcount);
+ my $js = &blockingmenu_javascript($blockcount).
+ &details_javascript();
$r->print(
&Apache::loncommon::start_page('Blocking communication/content access',$js).
@@ -678,7 +720,7 @@ sub get_timed_items {
my $resourcedata=&Apache::lonparmset::readdata($cnum,$cdom);
if (ref($resourcedata) eq 'HASH') {
foreach my $key (keys(%{$resourcedata})) {
- if ($key =~ /^\Q$cid\E(.+)\.0\.interval$/) {
+ if ($key =~ /^\Q$cid\E(.*)\.0\.interval$/) {
my $middle = $1;
if ($middle eq '') {
$intervals{'course'}{'all'} = $resourcedata->{$key};
@@ -1094,7 +1136,6 @@ ACT
$ltext->{'endd'}.': '.$endform.'');
} elsif ($record =~ /^firstaccess____(.+)$/) {
my $item = $1;
- my ($itemname,$iteminfo,$skipdetails);
my $type = 'map';
my $url;
if ($item eq 'course') {
@@ -1106,118 +1147,8 @@ ACT
$url = $item;
}
$r->print('
');
}
$r->print(<<"END");
@@ -1281,7 +1212,7 @@ sub display_addblocker_table {
my %lt = &Apache::lonlocal::texthash(
'exam' => 'e.g., Exam 1',
);
- my $intervalform = &create_interval_form($intervals,$parmcount,$navmap);
+ my $intervalform = &create_interval_form($intervals,$parmcount,$navmap,'blocking');
if ($intervalform ne '') {
$intervalform = '