--- loncom/interface/londocs.pm 2006/07/20 18:37:14 1.241 +++ loncom/interface/londocs.pm 2006/07/20 20:42:48 1.242 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.241 2006/07/20 18:37:14 www Exp $ +# $Id: londocs.pm,v 1.242 2006/07/20 20:42:48 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -961,6 +961,9 @@ sub breadcrumbs { '&markedcopy_title='. &escape($env{'form.markedcopy_title'}); } + my $randompick=-1; + my $isencrypted=0; + my $ishidden=0; while (@folders) { my $folder=shift(@folders); my $foldername=shift(@folders); @@ -968,17 +971,25 @@ sub breadcrumbs { $folderpath.=$folder.'&'.$foldername; my $url='/adm/coursedocs?folderpath='. &escape($folderpath); + my $name=&unescape($foldername); +# randompick number, hidden, encrypted is appended with ":"s to the foldername + $name=~s/\:(\d*)\:(\w*)\:(\w*)$//; + if ($1 ne '') { + $randompick=$1; + } else { + $randompick=-1; + } + if ($2) { $ishidden=1; } + if ($3) { $isencrypted=1; } &Apache::lonhtmlcommon::add_breadcrumb( {'href'=>$url.$cpinfo, - 'title'=>&unescape($foldername), + 'title'=>$name, 'text'=>''. - &unescape($foldername).'' + $name.'' }); - - } - return &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp', - 'LC_docs_path'); + return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp', + 'LC_docs_path'),$randompick,$ishidden,$isencrypted); } sub editor { @@ -1003,7 +1014,8 @@ sub editor { $env{'form.markedcopy_title'}=$title; $env{'form.markedcopy_url'}=$url; } - $r->print(&breadcrumbs($folder)); + my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted)=&breadcrumbs($folder); + $r->print($breadcrumbtrail); if ($fatal) { $r->print('

'.$errtext.'

'); } else { @@ -1223,6 +1235,16 @@ sub editor { # ---------------------------------------------------------------- Print screen my $idx=0; my $shown=0; + if (($ishidden) || ($isencrypted) || ($randompick>=0)) { + $r->print('

'.&mt('Parameters').':

'); + } + if ($randompick>=0) { + $r->print('

'.&mt('Caution: this folder is set to randomly pick a subset of resources. Adding or removing resources from this folder will change the set of resources that the students see, resulting in spurious or missing credit for completed problems, not limited to ones you modify. Do not modify the contents of this folder if it is in active student use.').'

'); + } $r->print(''); foreach (@Apache::lonratedt::order) { my ($name,$url)=split(/\:/,$Apache::lonratedt::resources[$_]); @@ -1608,7 +1630,14 @@ END my $foldername=&escape($foldertitle); my $folderpath=$env{'form.folderpath'}; if ($folderpath) { $folderpath.='&' }; - $folderpath.=$folderarg.'&'.$foldername; +# Append randompick number, hidden, and encrypted with ":" to foldername, +# so it gets transferred between levels + $folderpath.=$folderarg.'&'.$foldername.':'.(&Apache::lonratedt::getparameter($orderidx, + 'parameter_randompick'))[0] + .':'.((&Apache::lonratedt::getparameter($orderidx, + 'parameter_hiddenresource'))[0]=~/^yes$/i) + .':'.((&Apache::lonratedt::getparameter($orderidx, + 'parameter_encrypturl'))[0]=~/^yes$/i); $url.='folderpath='.&escape($folderpath).$cpinfo; $parameterset='