WeBWorK Main Forum

Help Modding Webwork

Help Modding Webwork

by Geoff Goehle -
Number of replies: 1
Hi all,

I'm trying to add "achievements" to Webwork, a la videogames. Basically I need to have a custom script prowl the sql database whenever a score is updated. I don't know where to add the hook for ths script though.

So my question is, what perl module updates the sql database whenever a student submits an answer?

In reply to Geoff Goehle

Re: Help Modding Webwork

by Michael Gage -
It's done in Problem.pm. A file that BADLY needs refactoring. :-)

It occurs in the subroutine "body"

around line 980

the actual storing operation
is done by $db->putUserProblem( data_in_problem_format)

in lines 946--1009 the data is prepared and error messages are reported.