Skip to content

Gateway quiz submission screen incorrectly displays quiz total for quizzes with 0-point items #1201

@awmorp

Description

@awmorp

When a gateway quiz has a problem with a weight of 0, the score is not correctly reported on the submission screen:
image
In this example, the submission screen shows "Your score on this test is 2/2" when it should be 1/1.

Looks like the bug is in these lines, which assume a default weight of 1:

my $pv = ( $_->value() ) ? $_->value() : 1;

my $pValue = $problems[$i]->value() ? $problems[$i]->value() : 1;

Having problems with weight 0 is useful for displaying instructions at the start of the quiz, for instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions