[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm /misc refresh_courseids_db.pl releaseslist.xml

raeburn raeburn@source.lon-capa.org
Thu, 16 Dec 2010 17:03:48 -0000


raeburn		Thu Dec 16 17:03:48 2010 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
    /loncom/misc	refresh_courseids_db.pl releaseslist.xml 
  Log:
  - New possible value for questiontype parameter: randomizetry.
    - Once used in course, course role selection requires 2.10 or later. 
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.501 loncom/interface/lonparmset.pm:1.502
--- loncom/interface/lonparmset.pm:1.501	Mon Aug 16 16:02:09 2010
+++ loncom/interface/lonparmset.pm	Thu Dec 16 17:03:42 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.501 2010/08/16 16:02:09 bisitz Exp $
+# $Id: lonparmset.pm,v 1.502 2010/12/16 17:03:42 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2150,7 +2150,7 @@
                     }
                 }
             } elsif ($markers[$i] =~ /_type\&\d+$/) {
-                if (($values[$i] eq 'anonsurvey') || ($values[$i] eq 'anonsurveycred')) {
+                if (($values[$i] eq 'anonsurvey') || ($values[$i] eq 'anonsurveycred') || ($values[$i] eq 'randomizetry')) {
                     &Apache::lonnet::update_released_required($Apache::lonnet::needsrelease{'parameter:type:'.$values[$i]});
                 }
             }
Index: loncom/misc/refresh_courseids_db.pl
diff -u loncom/misc/refresh_courseids_db.pl:1.8 loncom/misc/refresh_courseids_db.pl:1.9
--- loncom/misc/refresh_courseids_db.pl:1.8	Sun Aug 22 21:14:54 2010
+++ loncom/misc/refresh_courseids_db.pl	Thu Dec 16 17:03:48 2010
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # The LearningOnline Network
 #
-# $Id: refresh_courseids_db.pl,v 1.8 2010/08/22 21:14:54 raeburn Exp $
+# $Id: refresh_courseids_db.pl,v 1.9 2010/12/16 17:03:48 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -61,7 +61,7 @@
 
 exit if ($Apache::lonnet::perlvar{'lonRole'} ne 'library');
 
-use vars qw( %checkparms %checkresponsetypes %checkcrstypes %anonsurvey );
+use vars qw( %checkparms %checkresponsetypes %checkcrstypes %anonsurvey %randomizetry );
 
 #  Make sure this process is running from user=www
 my $wwwid=getpwnam('www');
@@ -382,8 +382,10 @@
     if (defined($navmap)) {
         my %anonsubmissions =  &Apache::lonnet::dump('nohist_anonsurveys',
                                                      $cdom,$cnum);
+        my %randomizetrysubm = &Apache::lonnet::dump('nohist_randomizetry',
+                                                     $cdom,$cnum);
         my %allresponses;
-        my $anonsurv_subm;
+        my ($anonsurv_subm,$randbytry_subm);
         foreach my $res ($navmap->retrieveResources(undef,sub { $_[0]->is_problem() },1,0)) {
             my %responses = $res->responseTypes();
             foreach my $key (keys(%responses)) {
@@ -396,6 +398,9 @@
                 if (exists($anonsubmissions{$symb."\0".$part})) {
                     $anonsurv_subm = 1;
                 }
+                if (exists($randomizetrysubm{$symb."\0".$part})) {
+                    $randbytry_subm = 1;
+                }
             }
         }
         foreach my $key (keys(%allresponses)) {
@@ -406,6 +411,10 @@
             ($reqdmajor,$reqdminor) = &update_reqd_loncaparev($anonsurvey{major},
                                           $anonsurvey{minor},$reqdmajor,$reqdminor);
         }
+        if ($randbytry_subm) {
+            ($reqdmajor,$reqdminor) = &update_reqd_loncaparev($randomizetry{major},
+                                          $randomizetry{minor},$reqdmajor,$reqdminor);
+        }
     }
     return ($reqdmajor,$reqdminor);
 }
@@ -467,6 +476,7 @@
         }
     }
     ($anonsurvey{major},$anonsurvey{minor}) = split(/\./,$Apache::lonnet::needsrelease{'parameter:type:anonsurvey'});
+    ($randomizetry{major},$randomizetry{minor}) = split(/\./,$Apache::lonnet::needsrelease{'parameter:type:randomizetry'});
     return;
 }
 
Index: loncom/misc/releaseslist.xml
diff -u loncom/misc/releaseslist.xml:1.1 loncom/misc/releaseslist.xml:1.2
--- loncom/misc/releaseslist.xml:1.1	Sat Jul 24 00:01:12 2010
+++ loncom/misc/releaseslist.xml	Thu Dec 16 17:03:48 2010
@@ -2,6 +2,7 @@
 <parameter name="type" value="anonsurvey">2.10</parameter>
 <parameter name="type" value="anonsurveycred">2.10</parameter>
 <parameter name="type" value="surveycred">2.10</parameter>
+<parameter name="type" value="randomizetry">2.10</parameter>
 <parameter name="type" value="practice">2.2</parameter>
 <resourcetag name="responsetype" value="custom">2.1</resourcetag>
 <resourcetag name="responsetype" value="math">2.2</resourcetag>