--- loncom/interface/loncourserespicker.pm 2013/11/13 01:40:07 1.8
+++ loncom/interface/loncourserespicker.pm 2016/10/16 21:49:51 1.14
@@ -1,6 +1,6 @@
# The LearningOnline Network
#
-# $Id: loncourserespicker.pm,v 1.8 2013/11/13 01:40:07 raeburn Exp $
+# $Id: loncourserespicker.pm,v 1.14 2016/10/16 21:49:51 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -75,7 +75,7 @@ select items. Checking a folder causes
within the folder. Unchecking a resource causing unchecking of folders
containing the item back up to the top level.
-Inputs: 9.
+Inputs: 11.
- $navmap -- Reference to LON-CAPA navmap object
(encapsulates information about resources in the course).
@@ -106,6 +106,10 @@ Inputs: 9.
- $uploadedfiles -- Reference to hash: keys are paths to files in
/home/httpd/lonUsers/$cdom/$1/$2/$3/$cnum/userfiles.
+
+ - $readonly -- if true, no "check all" or "uncheck all" buttons will
+ be displayed, and checkboxes will be disabled, if this
+ is for an exam block.
Output: $output is the HTML mark-up for display/selection of content
@@ -151,7 +155,7 @@ Inputs: 2.
Takes incoming title and replaces non-alphanumeric characters with underscore,
so title can be used as suggested file name (with appended extension) for file
-copied from course to Authoring space.
+copied from course to Authoring Space.
=item &enumerate_course_contents()
@@ -162,7 +166,7 @@ map url, or symb, for an iteration throu
a Course Coordinator. Used to generate numerical IDs to facilitate
(a) storage of lists of maps or resources to be blocked during an exam,
(b) processing selected form element during dumping of selected course
- content to Authoring space.
+ content to Authoring Space.
Inputs: 7
@@ -206,7 +210,8 @@ use Apache::lonlocal;
use LONCAPA qw(:DEFAULT :match);
sub create_picker {
- my ($navmap,$context,$formname,$crstype,$blockedmaps,$blockedresources,$block,$preamble,$numhome,$uploadedfiles) = @_;
+ my ($navmap,$context,$formname,$crstype,$blockedmaps,$blockedresources,$block,$preamble,
+ $numhome,$uploadedfiles,$readonly) = @_;
return unless (ref($navmap));
my ($it,$output,$numdisc,%maps,%resources,%discussiontime,%currmaps,%currresources,%files);
$it = $navmap->getIterator(undef,undef,undef,1,undef,undef);
@@ -236,16 +241,19 @@ sub create_picker {
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
my $crsprefix = &propath($cdom,$cnum).'/userfiles/';
- my ($info,$display,$onsubmit,$togglebuttons);
+ my ($info,$display,$onsubmit,$togglebuttons,$disabled);
if ($context eq 'examblock') {
my $maps_elem = 'docs_maps_'.$block;
my $res_elem = 'docs_resources_'.$block;
$onsubmit = ' onsubmit="return writeToOpener('."'$maps_elem','$res_elem'".');"';
$info = &mt('Items in '.lc($crstype).' for which access will be blocked.');
+ if ($readonly) {
+ $disabled = ' disabled="disabled"';
+ }
}
if ($context eq 'dumpdocs') {
$info = ''.
- &mt('Choose the uploaded course items and templated pages/problems to be copied to Authoring space.').
+ &mt('Choose the uploaded course items and templated pages/problems to be copied to Authoring Space.').
'
';
$startcount = 3 + $numhome;
$onsubmit = ' onsubmit="return checkUnique(document.'.$formname.',document.'.$formname.'.archive);"';
@@ -253,10 +261,14 @@ sub create_picker {
$info = &mt('Choose which items you wish to export from your '.$crstype.'.');
$startcount = 5;
}
- $togglebuttons = ''.
- ' ';
+ if ($disabled) {
+ $togglebuttons = '
';
+ } else {
+ $togglebuttons = ''.
+ ' ';
+ }
$display = '