--- loncom/interface/loncourserespicker.pm 2024/04/16 15:35:23 1.16 +++ loncom/interface/loncourserespicker.pm 2024/11/22 22:42:27 1.17 @@ -1,6 +1,6 @@ # The LearningOnline Network # -# $Id: loncourserespicker.pm,v 1.16 2024/04/16 15:35:23 raeburn Exp $ +# $Id: loncourserespicker.pm,v 1.17 2024/11/22 22:42:27 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -37,7 +37,7 @@ loncourserespicker provides an interface resources are to be either: (a) exported to an IMS Content Package -(b) subject to access blocking for the duriation of an exam/quiz. +(b) subject to access blocking for the duration of an exam/quiz. (c) dumped to an Authoring Space (d) receive shortened URLs to be used when deep-linking into a course @@ -63,9 +63,10 @@ a higher level to become unchecked. There is a submit button, which will be named differently according to the context in which resource/folder selection is being made. -The three contexts currently supported are: IMS export, selection of +The four contexts currently supported are: IMS export, selection of content to be subject to access restructions for the duration of an -exam, and selection of items for dumping to an Authoring Space. +exam, selection of items for dumping to an Authoring Space, and +display or creation of shortened URLs for deep-linking, =head1 INTERNAL SUBROUTINES @@ -132,7 +133,7 @@ Inputs: 7. - $numcount -- Total numer of folders and resources in course. - $context -- Context in which resources are being displayed - (imsexport, examblock or dumpdocs). + (imsexport, examblock, dumpdocs or shorturls). - $formname -- Name of form. @@ -153,7 +154,7 @@ no object instantiated. Inputs: 2. - $crstype -- Container type: Course or Community - - $context -- Context: imsexport, examblock or dumpdocs + - $context -- Context: imsexport, examblock, dumpdocs, or shorturls =item &clean() @@ -172,6 +173,7 @@ a Course Coordinator. Used to generate n (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. +(c) Inputs: 7 @@ -185,7 +187,7 @@ Inputs: 7 $title_ref - reference to hash containing titles for items in course - $context - examblock or dumpdocs + $context - examblock, dumpdocs or shorturls $cdom - course's domain @@ -518,7 +520,7 @@ sub create_picker { } } $display .= ''; - my $scripttag = + my $scripttag = &respicker_javascript($startcount,$numcount,$context,$formname,\%children, \%hierarchy,\@checked_maps,$numhome,$chkname); if (($context eq 'dumpdocs') || ($context eq 'shorturls')) { @@ -830,8 +832,10 @@ sub get_navmap_object { $outcome .= ''; if ($context eq 'imsexport') { &Apache::lonnet::logthis('IMS export failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'}); - } else { + } elsif ($context eq 'dumpdocs') { &Apache::lonnet::logthis('Copying to Authoring Space failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'}); + } elsif ($context eq 'shorturls') { + &Apache::lonnet::logthis('Displaying and/or saving URL shortcuts failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'}); } } elsif ($context eq 'examblock') { $outcome .= ''.&mt('Close window').'';