--- loncom/interface/loncourserespicker.pm 2013/11/13 01:40:07 1.8
+++ loncom/interface/loncourserespicker.pm 2015/04/09 17:57:05 1.12
@@ -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.12 2015/04/09 17:57:05 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -151,7 +151,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 +162,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
@@ -245,7 +245,7 @@ sub create_picker {
}
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);"';
@@ -466,7 +466,7 @@ sub create_picker {
$display .= '';
my $scripttag =
&respicker_javascript($startcount,$numcount,$context,$formname,\%children,
- \%hierarchy,\@checked_maps);
+ \%hierarchy,\@checked_maps,$numhome);
if ($context eq 'dumpdocs') {
return $scripttag.$display;
}
@@ -498,7 +498,7 @@ sub create_picker {
sub respicker_javascript {
my ($startcount,$numitems,$context,$formname,$children,$hierarchy,
- $checked_maps) = @_;
+ $checked_maps,$numhome) = @_;
return unless ((ref($children) eq 'HASH') && (ref($hierarchy) eq 'HASH')
&& (ref($checked_maps) eq 'ARRAY'));
my ($elem,$nested,$nameforelem);
@@ -591,11 +591,13 @@ EXTRA
} elsif ($context eq 'dumpdocs') {
my $blankmsg = &mt('An item selected has no filename set in the "Save as ..." column.');
my $dupmsg = &mt('Items selected for copying need unique filenames in the "Save as ..." column.');
+ my $homemsg = &mt('An Authoring Space needs to be selected.');
$scripttag .= <<"EXTRA";
function checkUnique(form,field) {
var duplicate = 0;
var blank = 0;
+ var numhome = '$numhome';
if (field.length > 0) {
for (i=0; i 1) {
+ if (!form.authorspace.options[form.authorspace.selectedIndex].value) {
+ alert('$homemsg');
+ return false;
+ }
+ }
return true;
}
@@ -685,10 +693,12 @@ function writeToOpener(maps,resources) {
}
}
if (isResource == 1) {
- if (nesting[elemnum].length > 0) {
- var lastelem = nesting[elemnum].length-1;
- if (document.$formname.elements[nesting[elemnum][lastelem]].checked) {
- include = 0;
+ if (nesting[elemnum] != null) {
+ if (nesting[elemnum].length > 0) {
+ var lastelem = nesting[elemnum].length-1;
+ if (document.$formname.elements[nesting[elemnum][lastelem]].checked) {
+ include = 0;
+ }
}
}
}
@@ -730,7 +740,7 @@ sub get_navmap_object {
undef,{'only_body' => 1,}).
'