Annotation of loncom/html/adm/helper/parameter.helper, revision 1.22
1.20 raeburn 1: <helper title="Course Parameter Helper" requiredpriv='opa&S'>
1.1 bowersj2 2:
3: <exec>
1.4 bowersj2 4: # 'dateTypeHash' should really be renamed now that we have tries...
1.1 bowersj2 5: my %dateTypeHash = ('open_date' => "opening date",
6: 'due_date' => "due date",
1.4 bowersj2 7: 'answer_date' => "answer open date",
1.6 bowersj2 8: 'tries' => 'number of tries',
9: 'weight' => 'problem weight'
1.4 bowersj2 10: );
1.1 bowersj2 11: my %levelTypeHash = ('whole_course' => "all problems in the course",
12: 'map' => 'the selected folder',
13: 'resource' => 'the selected problem');
14: $helper->{DATA}->{'dateTypeHash'} = \%dateTypeHash;
15: $helper->{DATA}->{'levelTypeHash'} = \%levelTypeHash;
16:
17: $helper->{DATA}->{'levelType'} = sub {
18: return $helper->{DATA}->{'levelTypeHash'}->{$helper->{VARS}->{GRANULARITY}};
19: };
20:
21: $helper->{DATA}->{'dateType'} = sub {
22: return $helper->{DATA}->{'dateTypeHash'}->{$helper->{VARS}->{ACTION_TYPE}};
23: };
24:
25: </exec>
26:
27: <state name="START" title="Welcome to the Assignment Parameter Helper">
28: <message nextstate="CHOOSE_LEVEL">
1.14 albertel 29:
30: <p>This helper will assist you in <b>setting the open, due,
31: and answer dates</b> for problems, <b>setting the problem
32: weights</b>, or in <b>setting the number of tries</b> for
33: problems.</p>
1.4 bowersj2 34:
35: <p>You will be asked to <b>select which problems</b> you wish to
36: set the parameters for, then <b>what parameter</b> you
37: wish to set, then you will select <b>whom the setting
38: affects</b>.</p>
1.1 bowersj2 39:
1.4 bowersj2 40: <p>After the helper is done, you will be shown where in
41: the advanced interface you would have gone to set
1.1 bowersj2 42: the parameter you have chosen, so in the future you
43: can do it directly.</p>
44:
45: <p>Press <b>Next -></b> to begin, or select <b><-
46: Previous</b> to go back to the previous screen.</p>
47: </message>
48: </state>
49:
50: <state name="CHOOSE_LEVEL" title="Which Problem or Problems?">
1.4 bowersj2 51: <message>Which problems do you wish to set a parameter for?</message>
1.1 bowersj2 52: <choices variable="GRANULARITY">
53: <choice computer="whole_course" nextstate="CHOOSE_ACTION">
1.7 albertel 54: Course default for all problems
1.1 bowersj2 55: </choice>
56: <choice computer="map" nextstate="CHOOSE_FOLDER">
1.7 albertel 57: Every problem in a particular folder (overrides course default)
1.1 bowersj2 58: </choice>
59: <choice computer="resource" nextstate="CHOOSE_RESOURCE">
1.7 albertel 60: One particular problem (overrides folder and course defaults)
1.1 bowersj2 61: </choice>
62: </choices>
63: </state>
64:
65: <state name="CHOOSE_FOLDER" title="Select Folder">
1.4 bowersj2 66: <message>Select the folder you wish to set the parameter for:</message>
1.1 bowersj2 67:
68: <resource variable="RESOURCE_ID">
69: <nextstate>CHOOSE_ACTION</nextstate>
70: <filterfunc>return $res->is_map()</filterfunc>
1.3 bowersj2 71: <valuefunc>return $res->map_pc();</valuefunc>
1.1 bowersj2 72: </resource>
73: </state>
74:
75: <state name="CHOOSE_RESOURCE" title="Select Problem">
1.4 bowersj2 76: <message>Select the problem you wish to set the parameter for:</message>
1.1 bowersj2 77:
1.13 albertel 78: <resource variable="RESOURCE_ID" nextstate="CHOOSE_ACTION" addparts="true">
1.1 bowersj2 79: <nextstate>CHOOSE_ACTION</nextstate>
80: <filterfunc>return $res->is_map || $res->is_problem()</filterfunc>
81: <choicefunc>return $res->is_problem()</choicefunc>
82: </resource>
83: </state>
84:
85: <state name="CHOOSE_ACTION" title="Parameter Type">
1.19 wenzelju 86: <eval>return &mt('What parameter do you want to set for ' .
1.1 bowersj2 87: &{$helper->{DATA}->{'levelType'}}()
1.19 wenzelju 88: . '?');
1.1 bowersj2 89: </eval>
90: <choices variable="ACTION_TYPE">
91: <nextstate>CHOOSE_DATE</nextstate>
1.4 bowersj2 92: <choice computer="open_date" nextstate="CHOOSE_DATE">Set an <b>open date</b></choice>
93: <choice computer="due_date" nextstate="CHOOSE_DATE">Set a <b>due date</b></choice>
94: <choice computer="answer_date" nextstate="CHOOSE_DATE">Set an <b>answer open date</b></choice>
95: <choice computer="tries" nextstate="CHOOSE_TRIES">Set the <b>number of tries</b></choice>
1.6 bowersj2 96: <choice computer="weight" nextstate="CHOOSE_WEIGHT">Set the <b>problem weight</b></choice>
1.1 bowersj2 97: </choices>
98: </state>
99:
1.6 bowersj2 100: <state name="CHOOSE_WEIGHT" title="Set Problem Weight">
1.19 wenzelju 101: <eval>return &mt('What weight should be set for ' .
1.6 bowersj2 102: &{$helper->{DATA}->{'levelType'}}()
1.19 wenzelju 103: . '?').'<br />';
1.6 bowersj2 104: </eval>
105: <string nextstate="CHOOSE_STUDENT_LEVEL" variable="WEIGHT">
106: <validator>if ($val !~ /^[1234567890]+(\.[1234567890]+)?$/) {
1.18 bisitz 107: return &mt('[_1] is not an acceptable weight. Weight must be a positive number.','"'.$element->getValue().'"');
1.10 albertel 108: }
1.6 bowersj2 109: return undef;
110: </validator>
111: </string>
112: </state>
113:
114: <state name="CHOOSE_TRIES" title="Set Problem Tries">
1.19 wenzelju 115: <eval>return &mt('How many tries should be set for ' .
1.4 bowersj2 116: &{$helper->{DATA}->{'levelType'}}()
1.19 wenzelju 117: . '?').'<br />';
1.4 bowersj2 118: </eval>
119: <string nextstate="CHOOSE_STUDENT_LEVEL" variable="TRIES">
120: <validator>if ($val !~ /^[1234567890]+$/) {
1.18 bisitz 121: return &mt('[_1] is not an acceptable number of tries. Tries must be a positive number with no decimal point.','"'.$element->getValue().'"');}
1.4 bowersj2 122: return undef;
123: </validator>
124: </string>
125: </state>
126:
1.1 bowersj2 127: <state name="CHOOSE_DATE" title="Set Date">
128: <eval>
1.19 wenzelju 129: return &mt('What should the ' .
1.4 bowersj2 130: &{$helper->{DATA}->{'dateType'}}() .
1.19 wenzelju 131: ' be set to?').'<br /><br />';
1.1 bowersj2 132: </eval>
133: <date variable="PARM_DATE" hoursminutes='1'>
134: <nextstate>CHOOSE_STUDENT_LEVEL</nextstate>
135: </date>
136: </state>
137:
138: <state name="CHOOSE_STUDENT_LEVEL" title="Students Affected">
139: <eval>
1.19 wenzelju 140: return &mt('Set ' .
1.1 bowersj2 141: &{$helper->{DATA}->{'dateType'}}() .
1.8 sakharuk 142: ' for ' .
1.1 bowersj2 143: &{$helper->{DATA}->{'levelType'}}() .
1.19 wenzelju 144: ' for ...');
1.1 bowersj2 145: </eval>
146: <choices variable="TARGETS">
1.20 raeburn 147: <condition>
148: <clause>return 1 if ($env{'request.course.sec'} eq '')</clause>
149: <choice computer="course" nextstate="FINISH">
150: . . . for <b>all students</b> in the course</choice>
151: </condition>
1.1 bowersj2 152: <choice computer="section" nextstate="CHOOSE_SECTION">
153: . . . for a particular <b>section</b></choice>
1.16 albertel 154: <condition>
1.22 ! raeburn 155: <clause>return 1 if (($env{'request.course.groups'} ne '') || (&Apache::lonnet::allowed('mdg',$env{'request.course.id'}) && (&Apache::longroup::coursegroups())))</clause>
1.16 albertel 156: <choice computer="group" nextstate="CHOOSE_GROUP">
157: . . . for a particular <b>group</b></choice>
158: </condition>
1.1 bowersj2 159: <choice computer="student" nextstate="CHOOSE_STUDENT">
1.21 raeburn 160: . . . for an individual <b>student</b> or <b>user</b></choice>
1.1 bowersj2 161: </choices>
162: </state>
163:
164: <state name="CHOOSE_SECTION" title="Select Section">
165: <eval>
1.19 wenzelju 166: return &mt('Please select the section you wish to set the ' .
1.1 bowersj2 167: &{$helper->{DATA}->{'dateType'}}() .
1.19 wenzelju 168: ' for:').'<br />';</eval>
1.20 raeburn 169: <section variable="SECTION_NAME" nextstate="FINISH" onlysections="1" />
1.1 bowersj2 170: </state>
171:
1.15 raeburn 172: <state name="CHOOSE_GROUP" title="Select Group">
173: <eval>
1.19 wenzelju 174: return &mt('Please select the group you wish to set the ' .
1.15 raeburn 175: &{$helper->{DATA}->{'dateType'}}() .
1.19 wenzelju 176: ' for:').'<br />';</eval>
1.22 ! raeburn 177: <group variable="GROUP_NAME" nextstate="FINISH" grouponly="1" />
1.15 raeburn 178: </state>
179:
180:
1.21 raeburn 181: <state name="CHOOSE_STUDENT" title="Select User">
1.1 bowersj2 182: <eval>
1.21 raeburn 183: return &mt('Please select the person you wish to set the ' .
1.1 bowersj2 184: &{$helper->{DATA}->{'dateType'}}() .
1.19 wenzelju 185: ' for:').'<br />';</eval>
1.21 raeburn 186: <student variable="USER_NAME" nextstate="FINISH" coursepersonnel="1" sectiononly="1" />
1.1 bowersj2 187: </state>
188:
189: <state name="FINISH" title="Verify Selection">
190: <parmwizfinal />
191: </state>
192:
193: </helper>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>