--- loncom/html/adm/helper/parameter.helper 2003/05/29 16:38:01 1.3 +++ loncom/html/adm/helper/parameter.helper 2015/08/16 00:21:28 1.21 @@ -1,9 +1,13 @@ - + + # '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', + 'weight' => 'problem weight' + ); my %levelTypeHash = ('whole_course' => "all problems in the course", 'map' => 'the selected folder', 'resource' => 'the selected problem'); @@ -22,13 +26,19 @@ -

This wizard will allow you to set open, due, and - answer dates for problems. You will be asked to - select a problem, what kind of date you want to set, - and for whom the date should be effective.

-

After the wizard is done, you will be shown where in - the advanced interface you would have gone to change +

This helper will assist you in setting the open, due, + and answer dates for problems, setting the problem + weights, or in setting the number of tries for + problems.

+ +

You will be asked to select which problems you wish to + set the parameters for, then what parameter you + wish to set, then you will select whom the setting + affects.

+ +

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.

@@ -38,22 +48,22 @@
- Which problems do you wish to change a date for? + Which problems do you wish to set a parameter for? - Every problem in the course + Course default for all problems - Every problem in a particular folder + Every problem in a particular folder (overrides course default) - One particular problem + One particular problem (overrides folder and course defaults) - Select the folder you wish to set the date for: + Select the folder you wish to set the parameter for: CHOOSE_ACTION @@ -63,9 +73,9 @@ - Select the problem you wish to change the date for: + Select the problem you wish to set the parameter for: - + CHOOSE_ACTION return $res->is_map || $res->is_problem() return $res->is_problem() @@ -73,23 +83,52 @@ - return 'What parameters do you want to set for ' . + return &mt('What parameter do you want to set for ' . &{$helper->{DATA}->{'levelType'}}() - . '?'; + . '?'); CHOOSE_DATE - Set an open date - Set a due date - Set an answer open date + Set an open date + Set a due date + Set an answer open date + Set the number of tries + Set the problem weight + + return &mt('What weight should be set for ' . + &{$helper->{DATA}->{'levelType'}}() + . '?').'
'; +
+ + if ($val !~ /^[1234567890]+(\.[1234567890]+)?$/) { + return &mt('[_1] is not an acceptable weight. Weight must be a positive number.','"'.$element->getValue().'"'); + } + return undef; + + +
+ + + return &mt('How many tries should be set for ' . + &{$helper->{DATA}->{'levelType'}}() + . '?').'
'; +
+ + if ($val !~ /^[1234567890]+$/) { + return &mt('[_1] is not an acceptable number of tries. Tries must be a positive number with no decimal point.','"'.$element->getValue().'"');} + return undef; + + +
+ - return 'What should the ' . - &{$helper->{DATA}->{'dateType'}}() . - ' be set to?

'; + return &mt('What should the ' . + &{$helper->{DATA}->{'dateType'}}() . + ' be set to?').'

';
CHOOSE_STUDENT_LEVEL @@ -98,36 +137,53 @@ - return 'Set ' . + return &mt('Set ' . &{$helper->{DATA}->{'dateType'}}() . - ' of ' . + ' for ' . &{$helper->{DATA}->{'levelType'}}() . - ' for. . .'; + ' for ...'); - - . . . for all students in the course + + return 1 if ($env{'request.course.sec'} eq '') + + . . . for all students in the course + . . . for a particular section + + return 1 if (&Apache::longroup::coursegroups()) + + . . . for a particular group + - . . . for an individual student + . . . for an individual student or user - return 'Please select the section you wish to set the ' . + return &mt('Please select the section you wish to set the ' . &{$helper->{DATA}->{'dateType'}}() . - ' for:
';
-
+ ' for:').'
'; +
- + + + return &mt('Please select the group you wish to set the ' . + &{$helper->{DATA}->{'dateType'}}() . + ' for:').'
';
+ +
+ + + - return 'Please select the student you wish to set the ' . + return &mt('Please select the person you wish to set the ' . &{$helper->{DATA}->{'dateType'}}() . - ' for:
';
- + ' for:').'
'; +