WeBWorK Main Forum

Examples of custom graders for programming classes that test submitted code snippets?

Examples of custom graders for programming classes that test submitted code snippets?

by Christian Seberino -
Number of replies: 6

I'd like to try using WebWork to "grade" some programming assignments.

I'm envisioning students pasting small snippets of code into a textbox

and a custom grader I have specified be used to

1. run the program

2. compare the output to required output

Anyone done such a thing? Are there examples somewhere?

Thanks!

Chris

In reply to Christian Seberino

Re: Examples of custom graders for programming classes that test submitted code snippets?

by Arnold Pizer -
Hi,


Not sure if they are still active.

Arnie
In reply to Arnold Pizer

Re: Examples of custom graders for programming classes that test submitted code snippets?

by Christian Seberino -
Anyone aware of docs on custom graders for WebWork? I think I'd rather write my own as I don't know if this component is still supported.

I googled for "webwork custom graders" but nothing came up.

Sincerely,

Chris
In reply to Christian Seberino

Re: Examples of custom graders for programming classes that test submitted code snippets?

by Michael Gage -
Try

http://webwork.maa.org/wiki/PopUpListsLong
http://webwork.maa.org/wiki/Matching1
http://webwork.maa.org/wiki/WeightedGrader

and for example code:

http://webwork.maa.org/pod/pg_TRUNK/macros/PGgraders.pl.html

http://webwork.maa.org/pod/pg_TRUNK/macros/PGasu.pl.html


You may want to grab the actual PGgraders.pl and PGasu.pl files from 
github or svn to see how the graders are coded.


In reply to Michael Gage

Re: Examples of custom graders for programming classes that test submitted code snippets?

by Christian Seberino -
In reply to Christian Seberino

Re: Examples of custom graders for programming classes that test submitted code snippets?

by Arnold Pizer -
Hi,

I think you want to write a custom answer evaluator rather than (or in addition to) a custom grader.  An answer evaluator (or checker) takes an individual answer and returns a correctness value (usually 0 or 1).  A problem grader then takes all these values (for problems with multiple answers), results of previous attempts on the problem, and maybe other factors (e.g. time to due date for reduced credit) and produces a value in the range [0,1]. This value is then multiplied by the "weight" of the problem (default is 1 but you can set this to whatever you want in the Hmwk editor) and this is the current grade for the problem.

Mike gave you some references. You can find some more older examples in the Library Browser (subject:WeBWork, chapter:Demos).  For a newer style answer evaluator see http://webwork.maa.org/wiki/CustomAnswerCheckers

Arnie
In reply to Arnold Pizer

Re: Examples of custom graders for programming classes that test submitted code snippets?

by Christian Seberino -
Thanks. This is exactly what I meant and needed!

cs