File:  [LON-CAPA] / loncom / html / adm / helper / parameter.helper
Revision 1.2: download - view: text, annotated - select for diffs
Fri May 16 17:21:33 2003 UTC (21 years, 1 month ago) by bowersj2
Branches: MAIN
CVS tags: version_0_99_0, HEAD
Require the users of the parameter helper and course initialization helper
to have the 'opa' priviledge of setting parameters.

    1: <helper title="Course Parameter Helper" requiredpriv='opa'>
    2: 
    3:   <exec>
    4:     my %dateTypeHash = ('open_date' => "opening date",
    5:                         'due_date' => "due date",
    6:                         'answer_date' => "answer open date");
    7:     my %levelTypeHash = ('whole_course' => "all problems in the course",
    8:                          'map' => 'the selected folder',
    9:                          'resource' => 'the selected problem');
   10:     $helper->{DATA}->{'dateTypeHash'} = \%dateTypeHash;
   11:     $helper->{DATA}->{'levelTypeHash'} = \%levelTypeHash;
   12: 
   13:     $helper->{DATA}->{'levelType'} = sub { 
   14:            return $helper->{DATA}->{'levelTypeHash'}->{$helper->{VARS}->{GRANULARITY}};
   15:        };
   16: 
   17:     $helper->{DATA}->{'dateType'} = sub { 
   18:            return $helper->{DATA}->{'dateTypeHash'}->{$helper->{VARS}->{ACTION_TYPE}};
   19:        };
   20: 
   21:   </exec>
   22: 
   23:   <state name="START" title="Welcome to the Assignment Parameter Helper">
   24:     <message nextstate="CHOOSE_LEVEL">
   25:         <p>This wizard will allow you to <b>set open, due, and 
   26:            answer dates for problems</b>. You will be asked to 
   27:            select a problem, what kind of date you want to set, 
   28:            and for whom the date should be effective.</p>
   29: 
   30:         <p>After the wizard is done, you will be shown where in
   31:            the advanced interface you would have gone to change
   32:            the parameter you have chosen, so in the future you
   33:            can do it directly.</p>
   34: 
   35:         <p>Press <b>Next -&gt;</b> to begin, or select <b>&lt;- 
   36:            Previous</b> to go back to the previous screen.</p>
   37:       </message>    
   38:     </state>
   39: 
   40:   <state name="CHOOSE_LEVEL" title="Which Problem or Problems?">
   41:     <message>Which problems do you wish to change a date for?</message>
   42:     <choices variable="GRANULARITY">
   43:       <choice computer="whole_course" nextstate="CHOOSE_ACTION">
   44:         <b>Every problem</b> in the course
   45:         </choice>
   46:       <choice computer="map" nextstate="CHOOSE_FOLDER">
   47:         Every problem in a particular <b>folder</b>
   48:         </choice>
   49:       <choice computer="resource" nextstate="CHOOSE_RESOURCE">
   50:         One particular <b>problem</b>
   51:         </choice>
   52:       </choices>
   53:     </state>
   54: 
   55:   <state name="CHOOSE_FOLDER" title="Select Folder">
   56:     <message>Select the folder you wish to set the date for:</message>
   57: 
   58:     <resource variable="RESOURCE_ID">
   59:       <nextstate>CHOOSE_ACTION</nextstate>
   60:       <filterfunc>return $res->is_map()</filterfunc>
   61:       </resource>
   62:     </state>
   63: 
   64:   <state name="CHOOSE_RESOURCE" title="Select Problem">
   65:     <message>Select the problem you wish to change the date for:</message>
   66: 
   67:     <resource variable="RESOURCE_ID" nextstate="CHOOSE_ACTION">
   68:       <nextstate>CHOOSE_ACTION</nextstate>
   69:       <filterfunc>return $res->is_map || $res->is_problem()</filterfunc>
   70:       <choicefunc>return $res->is_problem()</choicefunc>
   71:       </resource>
   72:     </state>
   73: 
   74:   <state name="CHOOSE_ACTION" title="Parameter Type">
   75:     <eval>return 'What parameters do you want to set for ' . 
   76:       &{$helper->{DATA}->{'levelType'}}()
   77:       . '?';
   78:       </eval>
   79:     <choices variable="ACTION_TYPE">
   80:       <nextstate>CHOOSE_DATE</nextstate>
   81:       <choice computer="open_date">Set an <b>open date</b></choice>
   82:       <choice computer="due_date">Set a <b>due date</b></choice>
   83:       <choice computer="answer_date">Set an <b>answer open date</b></choice>
   84:       </choices>
   85:     </state>
   86: 
   87:   <state name="CHOOSE_DATE" title="Set Date">
   88:     <eval>
   89:       return 'What should the ' .
   90:        &{$helper->{DATA}->{'dateType'}}() .
   91:        ' be set to? <br /><br />';
   92:       </eval>
   93:     <date variable="PARM_DATE" hoursminutes='1'>
   94:       <nextstate>CHOOSE_STUDENT_LEVEL</nextstate>
   95:       </date>
   96:     </state>
   97: 
   98:   <state name="CHOOSE_STUDENT_LEVEL" title="Students Affected">
   99:     <eval>
  100:       return 'Set ' . 
  101:        &{$helper->{DATA}->{'dateType'}}() .
  102:         ' of ' .
  103:        &{$helper->{DATA}->{'levelType'}}() .
  104:         ' for. . .';
  105:       </eval>
  106:     <choices variable="TARGETS">
  107:       <choice computer="course" nextstate="FINISH">
  108:          . . . for <b>all students</b> in the course</choice>
  109:       <choice computer="section" nextstate="CHOOSE_SECTION">
  110:          . . . for a particular <b>section</b></choice>
  111:       <choice computer="student" nextstate="CHOOSE_STUDENT">
  112:          . . . for an individual <b>student</b></choice>
  113:       </choices>
  114:     </state>
  115: 
  116:   <state name="CHOOSE_SECTION" title="Select Section">
  117:     <eval>
  118:       return 'Please select the section you wish to set the ' .
  119:        &{$helper->{DATA}->{'dateType'}}() .
  120:          ' for:<br />';</eval>
  121:     <section variable="SECTION_NAME" nextstate="FINISH" />
  122:     </state>
  123: 
  124:   <state name="CHOOSE_STUDENT" title="Select Student">
  125:     <eval>
  126:       return 'Please select the student you wish to set the ' .
  127:        &{$helper->{DATA}->{'dateType'}}() .
  128:          ' for:<br />';</eval>
  129:     <student variable="USER_NAME" nextstate="FINISH" />
  130:     </state>
  131: 
  132:   <state name="FINISH" title="Verify Selection">
  133:     <parmwizfinal />
  134:     </state>
  135: 
  136:   </helper>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>