[LON-CAPA-cvs] cvs: loncom /html/adm/helper parameter.helper
bowersj2
lon-capa-cvs@mail.lon-capa.org
Tue, 17 Jun 2003 14:21:55 -0000
bowersj2 Tue Jun 17 10:21:55 2003 EDT
Modified files:
/loncom/html/adm/helper parameter.helper
Log:
Add support for setting tries to parameter.helper and edit some of the
text for conciseness.
Index: loncom/html/adm/helper/parameter.helper
diff -u loncom/html/adm/helper/parameter.helper:1.3 loncom/html/adm/helper/parameter.helper:1.4
--- loncom/html/adm/helper/parameter.helper:1.3 Thu May 29 12:38:01 2003
+++ loncom/html/adm/helper/parameter.helper Tue Jun 17 10:21:55 2003
@@ -1,9 +1,12 @@
<helper title="Course Parameter Helper" requiredpriv='opa'>
<exec>
+ # 'dateTypeHash' should really be renamed now that we have tries...
my %dateTypeHash = ('open_date' => "opening date",
'due_date' => "due date",
- 'answer_date' => "answer open date");
+ 'answer_date' => "answer open date",
+ 'tries' => 'number of tries'
+ );
my %levelTypeHash = ('whole_course' => "all problems in the course",
'map' => 'the selected folder',
'resource' => 'the selected problem');
@@ -22,13 +25,17 @@
<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>This helper will assist you in <b>setting the open,
+ due, and answer dates</b> for problems, or in
+ <b>setting the number of tries</b> for problems.</p>
+
+ <p>You will be asked to <b>select which problems</b> you wish to
+ set the parameters for, then <b>what parameter</b> you
+ wish to set, then you will select <b>whom the setting
+ affects</b>.</p>
- <p>After the wizard is done, you will be shown where in
- the advanced interface you would have gone to change
+ <p>After the helper is done, you will be shown where in
+ the advanced interface you would have gone to set
the parameter you have chosen, so in the future you
can do it directly.</p>
@@ -38,22 +45,22 @@
</state>
<state name="CHOOSE_LEVEL" title="Which Problem or Problems?">
- <message>Which problems do you wish to change a date for?</message>
+ <message>Which problems do you wish to set a parameter for?</message>
<choices variable="GRANULARITY">
<choice computer="whole_course" nextstate="CHOOSE_ACTION">
<b>Every problem</b> in the course
</choice>
<choice computer="map" nextstate="CHOOSE_FOLDER">
- Every problem in a particular <b>folder</b>
+ Every problem in <b>a particular folder</b>
</choice>
<choice computer="resource" nextstate="CHOOSE_RESOURCE">
- One particular <b>problem</b>
+ <b>One particular problem</b>
</choice>
</choices>
</state>
<state name="CHOOSE_FOLDER" title="Select Folder">
- <message>Select the folder you wish to set the date for:</message>
+ <message>Select the folder you wish to set the parameter for:</message>
<resource variable="RESOURCE_ID">
<nextstate>CHOOSE_ACTION</nextstate>
@@ -63,7 +70,7 @@
</state>
<state name="CHOOSE_RESOURCE" title="Select Problem">
- <message>Select the problem you wish to change the date for:</message>
+ <message>Select the problem you wish to set the parameter for:</message>
<resource variable="RESOURCE_ID" nextstate="CHOOSE_ACTION">
<nextstate>CHOOSE_ACTION</nextstate>
@@ -73,22 +80,38 @@
</state>
<state name="CHOOSE_ACTION" title="Parameter Type">
- <eval>return 'What parameters do you want to set for ' .
+ <eval>return 'What parameter do you want to set for ' .
&{$helper->{DATA}->{'levelType'}}()
. '?';
</eval>
<choices variable="ACTION_TYPE">
<nextstate>CHOOSE_DATE</nextstate>
- <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>
+ <choice computer="open_date" nextstate="CHOOSE_DATE">Set an <b>open date</b></choice>
+ <choice computer="due_date" nextstate="CHOOSE_DATE">Set a <b>due date</b></choice>
+ <choice computer="answer_date" nextstate="CHOOSE_DATE">Set an <b>answer open date</b></choice>
+ <choice computer="tries" nextstate="CHOOSE_TRIES">Set the <b>number of tries</b></choice>
</choices>
</state>
+ <state name="CHOOSE_TRIES" title="Set Number of Tries">
+ <eval>return 'How many tries should be set for ' .
+ &{$helper->{DATA}->{'levelType'}}()
+ . '?<br />';
+ </eval>
+ <string nextstate="CHOOSE_STUDENT_LEVEL" variable="TRIES">
+ <validator>if ($val !~ /^[1234567890]+$/) {
+ return '"' . $element->getValue() . '" is not '.
+ 'an acceptable number of tries. Tries must be a postive number ' .
+ 'with no decimal point.';}
+ return undef;
+ </validator>
+ </string>
+ </state>
+
<state name="CHOOSE_DATE" title="Set Date">
<eval>
return 'What should the ' .
- &{$helper->{DATA}->{'dateType'}}() .
+ &{$helper->{DATA}->{'dateType'}}() .
' be set to? <br /><br />';
</eval>
<date variable="PARM_DATE" hoursminutes='1'>
@@ -100,7 +123,7 @@
<eval>
return 'Set ' .
&{$helper->{DATA}->{'dateType'}}() .
- ' of ' .
+ 'for ' .
&{$helper->{DATA}->{'levelType'}}() .
' for. . .';
</eval>