[LON-CAPA-cvs] cvs: loncom /html/adm/helper newslot.helper

albertel lon-capa-cvs@mail.lon-capa.org
Sun, 25 Jun 2006 21:57:56 -0000


albertel		Sun Jun 25 17:57:56 2006 EDT

  Modified files:              
    /loncom/html/adm/helper	newslot.helper 
  Log:
  - making use of the new <skip> mechanism
  
  
Index: loncom/html/adm/helper/newslot.helper
diff -u loncom/html/adm/helper/newslot.helper:1.19 loncom/html/adm/helper/newslot.helper:1.20
--- loncom/html/adm/helper/newslot.helper:1.19	Tue May 16 17:03:42 2006
+++ loncom/html/adm/helper/newslot.helper	Sun Jun 25 17:57:56 2006
@@ -157,6 +157,20 @@
         delete($helper->{'VARS'}{'endunique'});
       </exec>
     </condition>
+
+    <message>
+      </p><p>Proctored access:
+    </message>
+    <choices variable="useproctor">
+      <choice computer='no'>No proctor checkin required for access.</choice>
+      <choice computer='yes'>Require proctored checkin for access.</choice>
+      <defaultvalue>
+        my $default=&{$helper->{DATA}{origslot}}('proctor');
+        if ($default) { return 'yes'; }
+        return 'no';
+      </defaultvalue>
+    </choices>
+
     <message>
       </p><p>Secret word proctors use to checkin users:<br />&nbsp;&nbsp;&nbsp;
     </message>
@@ -211,22 +225,12 @@
 
   <state name="PROCTOR" title="Specify Proctors">
 
-    <nextstate>FINISH</nextstate>
+    <skip>
+      <clause>$helper->{'VARS'}{'useproctor'} eq 'no'</clause>
+      <nextstate>RESTRICTUSER</nextstate>
+    </skip>
 
-    <condition>
-       <clause>$helper->{'VARS'}{'type'} eq 'schedulable_student'</clause>
-       <nextstate>RESTRICTUSER</nextstate>
-    </condition>
-
-    <choices variable="useproctor">
-      <choice computer='no'>No proctor checkin required for access.</choice>
-      <choice computer='yes'>Require proctored access.</choice>
-      <defaultvalue>
-        my $default=&{$helper->{DATA}{origslot}}('proctor');
-        if ($default) { return 'yes'; }
-        return 'no';
-      </defaultvalue>
-    </choices>
+    <nextstate>RESTRICTUSER</nextstate>
 
     <student variable="proctor" multichoice="1" coursepersonnel="1"
              activeonly="1" emptyallowed="1">
@@ -243,6 +247,11 @@
 
 
   <state name="RESTRICTUSER" title="Restrict slot availability">
+    <skip>
+       <clause>$helper->{'VARS'}{'type'} ne 'schedulable_student'</clause>
+       <nextstate>FINISH</nextstate>
+    </skip>
+
     <nextstate>FINISH</nextstate>
     <message>
       <p>Slots are by default available to all users in a course, if you would like this slot to be restricted to a subset of users you can specify restrictions.</p>