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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 11 Oct 2005 20:47:04 -0000


albertel		Tue Oct 11 16:47:04 2005 EDT

  Added files:                 
    /loncom/html/adm/helper	newslot.helper 
  Log:
  - add helper to create a new slot
  
  
  

Index: loncom/html/adm/helper/newslot.helper
+++ loncom/html/adm/helper/newslot.helper
<helper title="Slot Creation" requiredpriv="mgq">
  <state name="START" title="Specify Required Attributes">
    <message nextstate="OPTIONAL">
      <message_text>
          Name: <br />&nbsp;&nbsp;&nbsp;
      </message_text>
    </message>
    <string variable="slotname" size="30">
      <validator>
          if ($val=~/^\s*$/) { return 'Must specify a name'; }
          if ($val=~/\s$/) { return 'Must not contain spaces'; }
          return undef;
      </validator>
    </string>
    <message>
      <message_text><br />Start time:<br />&nbsp;&nbsp;&nbsp;</message_text>
    </message>
    <date variable="starttime" hoursminutes="1"></date>
    <message>
      <message_text><br />End time:<br />&nbsp;&nbsp;&nbsp;</message_text>
    </message>
    <date variable="endtime" hoursminutes="1"></date>
    <message>
      <message_text><br />Type:</message_text>
    </message>
    <choices variable="type">
      <choice computer='preassigned'>Instructor asssignable.</choice>
      <choice computer='student_schedulable'>Student selectable.</choice>
      <defaultvalue>
         return 'preassigned';
      </defaultvalue>
    </choices>
  </state>

  <state name="OPTIONAL" title="Specify Optional Attributes">
    <message>
      <message_text>
          <p>Time students can start reserving:<br />&nbsp;&nbsp;&nbsp;
      </message_text>
    </message>
    <date variable="startreserve" hoursminutes="1" anytime="1"></date>
    <message>
      <message_text>
          </p><p>IP restrictions:<br />&nbsp;&nbsp;&nbsp;
      </message_text>
    </message>
    <string variable="ip" size="30">
      <validator>
          return undef;
      </validator>
    </string>
    <message>
      <message_text>
          </p><p>Description:<br />&nbsp;&nbsp;&nbsp;
      </message_text>
    </message>
    <string variable="description" size="60"></string>
    <message>
      <message_text>
          </p><p>Maxium number of students allowed in this slot:<br />&nbsp;&nbsp;&nbsp;
      </message_text>
    </message>
    <string variable="maxspace" size="4">
      <validator>
          if ($val ne '' && $val=~/\D/) { return 'Must be numeric.'; }
          return undef;
      </validator>
    </string>
    <message>
      <message_text>
          </p><p>Period of time in which this slot is can only be uniquely chosen:<br />&nbsp;&nbsp;&nbsp;Start:
      </message_text>
    </message>
    <date variable="startunique" hoursminutes="1" anytime="1"></date>
    <message><message_text><br />&nbsp;&nbsp;&nbsp;End: </message_text></message>
    <date variable="endunique" hoursminutes="1" anytime="1"></date>
    <message>
      <message_text>
          </p><p>Slot is:
      </message_text>
    </message>
    <choices variable="restricttosymb">
      <choice nextstate="FINISH" computer='any'>usable for any resource.</choice>
      <choice nextstate="RESOURCESELECT" computer='resource'>restricted to a specific resource.</choice>
      <defaultvalue>'any'</defaultvalue>
    </choices>
    <message> <message_text> </p> </message_text> </message>
  </state>
  <state name="RESOURCESELECT" title="Specify Optional Attributes">
    <resource variable="symb">
      <filterfunc>return $res->is_problem()</filterfunc>
      <valuefunc>return $res->symb()</valuefunc>
      <nextstate>FINISH</nextstate>
    </resource>    
  </state>
  <state name="FINISH" title="Specify Optional Attributes">
	    <message> <message_text> fin </message_text> </message>	
  </state>
</helper>