Skip to content

Commit 24ec4c9

Browse files
committed
Fix an error that makes the NoReducedCred achievement item unusable.
The `can_use` method of the `NoReducedCred.pm` achiievent item returns 0 unless the condition for which it can be used is true, and then there is no follow up return value for the case that the condition is true. As a result the method always returns a false value. Thus the achievement item can never be used. Since the result of the `can_use` method is used in a purely boolean fashion it should just return the condition result.
1 parent 0974272 commit 24ec4c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/WeBWorK/AchievementItems/NoReducedCred.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ sub new ($class) {
1919
}
2020

2121
sub can_use ($self, $set, $records) {
22-
return 0
23-
unless $set->assignment_type eq 'default'
22+
return
23+
$set->assignment_type eq 'default'
2424
&& $set->enable_reduced_scoring
2525
&& $set->reduced_scoring_date
2626
&& $set->reduced_scoring_date < $set->due_date

0 commit comments

Comments
 (0)