WeBWorK Main Forum

Partial Credit for Blank Answers

Partial Credit for Blank Answers

by Alec Helm -
Number of replies: 1

Hello,


I have a gateway/quiz I am trying to set up in blackboard for which I would like students to get partial credit for answers they leave blank. The assignment is multiple choice. Is there any way to have the grader automatically do this in WebWork? I considered having an answer to the problem be 'leave blank', but as the assignment is timed I would prefer not to do this since some students may not reach all the problems in time. We are using version 2.17


Alternatively, can WebWork produce a file for the homework set that would let me know for each student how they answered every question? If so, I would happily just process that file to get scores, and override the automatic scoring from WebWork.

In reply to Alec Helm

Re: Partial Credit for Blank Answers

by Danny Glin -

You can do this with a custom answer checker, as in the sample below.  Note that by default WeBWorK doesn't check blank answers, so you need to include the "->withPreFilter('erase')" at the end to tell WeBWorK to still pass empty answers to the checker.

This was tested in 2.19, but I believe everything should work with 2.17.

Also note that this will only work in test mode, since all answers are submitted at once.  If this is used in an assignment, then the student would only get the partial credit for questions where they clicked submit without choosing an answer.

DOCUMENT();


loadMacros(

    "PGstandard.pl",    # Standard macros for PG language

    "PGML.pl",          # PGML markup and Math Objects

    "parserRadioButtons.pl",

    "PGcourse.pl",      # Customization file for the course

);


$rb = RadioButtons(

    [ [ "Right", "Wrong1", "Wrong2", "Wrong3" ], "None of the above" ], 0)

    ->cmp(

        checker => sub {

            my ($correct, $student, $ansHash) = @_;

            if ($correct == $student) {

                return 1;

        } elsif ($student eq '') {

                return 0.3;

        } else {

                return 0;

            }

        }

)->withPreFilter('erase');


BEGIN_PGML

[_]{$rb}

END_PGML


ENDDOCUMENT();