--- loncom/html/adm/helper/parameter.helper 2003/07/23 19:26:01 1.5 +++ loncom/html/adm/helper/parameter.helper 2015/08/15 20:12:04 1.20 @@ -1,11 +1,12 @@ - + # '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", - 'tries' => 'number of tries' + 'tries' => 'number of tries', + 'weight' => 'problem weight' ); my %levelTypeHash = ('whole_course' => "all problems in the course", 'map' => 'the selected folder', @@ -25,9 +26,11 @@ -

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

+ +

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 @@ -48,13 +51,13 @@ 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) @@ -72,7 +75,7 @@ Select the problem you wish to set the parameter for: - + CHOOSE_ACTION return $res->is_map || $res->is_problem() return $res->is_problem() @@ -80,9 +83,9 @@ - return 'What parameter do you want to set for ' . + return &mt('What parameter do you want to set for ' . &{$helper->{DATA}->{'levelType'}}() - . '?'; + . '?'); CHOOSE_DATE @@ -90,19 +93,32 @@ Set a due date Set an answer open date Set the number of tries + Set the problem weight - - return 'How many tries should be set for ' . + + 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 '"' . $element->getValue() . '" is not '. - 'an acceptable number of tries. Tries must be a postive number ' . - 'with no decimal point.';} + return &mt('[_1] is not an acceptable number of tries. Tries must be a positive number with no decimal point.','"'.$element->getValue().'"');} return undef; @@ -110,9 +126,9 @@ - return 'What should the ' . + return &mt('What should the ' . &{$helper->{DATA}->{'dateType'}}() . - ' be set to?

'; + ' be set to?').'

';
CHOOSE_STUDENT_LEVEL @@ -121,17 +137,25 @@ - return 'Set ' . + return &mt('Set ' . &{$helper->{DATA}->{'dateType'}}() . - 'for ' . + ' 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 @@ -139,17 +163,26 @@ - 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:').'
';
+

+ + + + + return &mt('Please select the group you wish to set the ' . &{$helper->{DATA}->{'dateType'}}() . - ' for:
';
-
+ ' for:').'
'; + + - return 'Please select the student you wish to set the ' . + return &mt('Please select the student you wish to set the ' . &{$helper->{DATA}->{'dateType'}}() . - ' for:
';
+ ' for:').'
';