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

bowersj2 lon-capa-cvs@mail.lon-capa.org
Fri, 18 Apr 2003 17:32:26 -0000

bowersj2		Fri Apr 18 13:32:26 2003 EDT

  Added files:                 
    /loncom/html/adm/helper	parameter.helper 
  The XML version of the parameter helper.

Index: loncom/html/adm/helper/parameter.helper
+++ loncom/html/adm/helper/parameter.helper
<helper title="Course Parameter Helper">

    my %dateTypeHash = ('open_date' => "opening date",
                        'due_date' => "due date",
                        'answer_date' => "answer open date");
    my %levelTypeHash = ('whole_course' => "all problems in the course",
                         'map' => 'the selected folder',
                         'resource' => 'the selected problem');
    $helper->{DATA}->{'dateTypeHash'} = \%dateTypeHash;
    $helper->{DATA}->{'levelTypeHash'} = \%levelTypeHash;

    $helper->{DATA}->{'levelType'} = sub { 
           return $helper->{DATA}->{'levelTypeHash'}->{$helper->{VARS}->{GRANULARITY}};

    $helper->{DATA}->{'dateType'} = sub { 
           return $helper->{DATA}->{'dateTypeHash'}->{$helper->{VARS}->{ACTION_TYPE}};


  <state name="START" title="Welcome to the Assignment Parameter Helper">
    <message nextstate="CHOOSE_LEVEL">
        <p>This wizard will allow you to <b>set open, due, and 
           answer dates for problems</b>. You will be asked to 
           select a problem, what kind of date you want to set, 
           and for whom the date should be effective.</p>

        <p>After the wizard is done, you will be shown where in
           the advanced interface you would have gone to change
           the parameter you have chosen, so in the future you
           can do it directly.</p>

        <p>Press <b>Next -&gt;</b> to begin, or select <b>&lt;- 
           Previous</b> to go back to the previous screen.</p>

  <state name="CHOOSE_LEVEL" title="Which Problem or Problems?">
    <message>Which problems do you wish to change a date for?</message>

    <choices variable="GRANULARITY">
      <choice computer="whole_course" nextstate="CHOOSE_ACTION">
        <b>Every problem</b> in the course
      <choice computer="map" nextstate="CHOOSE_FOLDER">
        Every problem in a particular <b>folder</b>
      <choice computer="resource" nextstate="CHOOSE_RESOURCE">
        One particular <b>problem</b>

  <state name="CHOOSE_FOLDER" title="Select Folder">
    <message>Select the folder you wish to set the date for:</message>

    <resource variable="RESOURCE_ID">
      <filterfunc>return $res->is_map()</filterfunc>

  <state name="CHOOSE_RESOURCE" title="Select Problem">
    <message>Select the problem you wish to change the date for:</message>

    <resource variable="RESOURCE_ID" nextstate="CHOOSE_ACTION">
      <filterfunc>return $res->is_map || $res->is_problem()</filterfunc>
      <choicefunc>return $res->is_problem()</choicefunc>

  <state name="CHOOSE_ACTION" title="Parameter Type">
    <eval>return 'What parameters do you want to set for ' . 
      . '?';
    <choices variable="ACTION_TYPE">
      <choice computer="open_date">Set an <b>open date</b></choice>
      <choice computer="due_date">Set a <b>due date</b></choice>
      <choice computer="answer_date">Set an <b>answer open date</b></choice>

  <state name="CHOOSE_DATE" title="Set Date">
      return 'What should the ' .
       &{$helper->{DATA}->{'dateType'}}() .
       ' be set to? <br /><br />';
    <date variable="PARM_DATE" hoursminutes='1'>

  <state name="CHOOSE_STUDENT_LEVEL" title="Students Affected">
      return 'Set ' . 
       &{$helper->{DATA}->{'dateType'}}() .
        ' of ' .
       &{$helper->{DATA}->{'levelType'}}() .
        ' for. . .';
    <choices variable="TARGETS">
      <choice computer="course" nextstate="FINISH">
         . . . for <b>all students</b> in the course</choice>
      <choice computer="section" nextstate="CHOOSE_SECTION">
         . . . for a particular <b>section</b></choice>
      <choice computer="student" nextstate="CHOOSE_STUDENT">
         . . . for an individual <b>student</b></choice>

  <state name="CHOOSE_SECTION" title="Select Section">
      return 'Please select the section you wish to set the ' .
       &{$helper->{DATA}->{'dateType'}}() .
         ' for:<br />';</eval>
    <section variable="SECTION_NAME" nextstate="FINISH" />

  <state name="CHOOSE_STUDENT" title="Select Student">
      return 'Please select the student you wish to set the ' .
       &{$helper->{DATA}->{'dateType'}}() .
         ' for:<br />';</eval>
    <student variable="USER_NAME" nextstate="FINISH" />

  <state name="FINISH" title="Verify Selection">
    <parmwizfinal />