[LON-CAPA-cvs] cvs: loncom(randomize) /interface londocs.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Fri, 29 Jun 2007 19:51:08 -0000


albertel		Fri Jun 29 15:51:08 2007 EDT

  Modified files:              (Branch: randomize)
    /loncom/interface	londocs.pm 
  Log:
  - randomorder only folders
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.278.2.1 loncom/interface/londocs.pm:1.278.2.2
--- loncom/interface/londocs.pm:1.278.2.1	Thu Jun 28 19:26:46 2007
+++ loncom/interface/londocs.pm	Fri Jun 29 15:51:06 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.278.2.1 2007/06/28 23:26:46 albertel Exp $
+# $Id: londocs.pm,v 1.278.2.2 2007/06/29 19:51:06 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1894,7 +1894,7 @@
 	    $url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb);
 	}
     }
-    my $parameterset=' ';
+    my ($parameterset,$rand_order_text) = (' ', ' ');
     if ($isfolder || $extension eq 'sequence') {
 	my $foldername=&escape($foldertitle);
 	my $folderpath=$env{'form.folderpath'};
@@ -1917,6 +1917,10 @@
                                               '" />'.
 '<font size="-2"><a href="javascript:void(0)">'.&mt('Save').'</a></font></label>';
        
+	my $ro_set=
+	    ((&LONCAPA::map::getparameter($orderidx,'parameter_randomorder'))[0]=~/^yes$/i?' checked="checked"':'');
+	$rand_order_text ='
+<nobr><label><input type="checkbox" name="randorder_$orderidx" onClick="this.form.changeparms.value=\'randomorder\';this.form.submit()" '.$ro_set.' /> '.&mt('Random Order').' </label></nobr>';
     }
     if ($ispage) {
         my $pagename=&escape($pagetitle);
@@ -1943,21 +1947,18 @@
     if (($allowed) && ($folder!~/^supplemental/)) {
  	my %lt=&Apache::lonlocal::texthash(
  			      'hd' => 'Hidden',
- 			      'ec' => 'URL hidden',
- 			      'ro' => 'Random Order',);
+ 			      'ec' => 'URL hidden');
 	my $enctext=
 	    ((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i?' checked="checked"':'');
 	my $hidtext=
 	    ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i?' checked="checked"':'');
-	my $rotext=
-	    ((&LONCAPA::map::getparameter($orderidx,'parameter_randomorder'))[0]=~/^yes$/i?' checked="checked"':'');
+
 	$line.=(<<ENDPARMS);
 <td bgcolor="#BBBBFF"><font size='-2'>
 <nobr><label><input type="checkbox" name="hidprs_$orderidx" onClick="this.form.changeparms.value='hiddenresource';this.form.submit()" $hidtext /> $lt{'hd'}</label></nobr></td>
 <td bgcolor="#BBBBFF"><font size='-2'>
 <nobr><label><input type="checkbox" name="encprs_$orderidx" onClick="this.form.changeparms.value='encrypturl';this.form.submit()" $enctext /> $lt{'ec'}</label></nobr></td>
-<td bgcolor="#BBBBFF"><font size='-2'>
-<nobr><label><input type="checkbox" name="randorder_$orderidx" onClick="this.form.changeparms.value='randomorder';this.form.submit()" $rotext /> $lt{'ro'}</label></nobr></td>
+<td bgcolor="#BBBBFF"><font size="-2">$rand_order_text</font></td>
 <td bgcolor="#BBBBFF"><font size="-2">$parameterset</font></td>
 ENDPARMS
     }