HowTo write a filter | topic started 4/27/2003; 1:13:43 PM last post 4/27/2003; 1:13:43 PM |
Michael Gage - HowTo write a filter 4/27/2003; 1:13:43 PM (reads: 669, responses: 0) |
How to write a filterA filter is a short subroutine with the following structure. It accepts an AnswerHash, followed by a hash of options. It returns an AnswerHash $ans_hash = filter($ans_hash, %options); See the AnswerHash.pm file for a list of entries which can be expected to be found in an AnswerHash, such as 'student_ans', 'score' and so forth. Other entries may be present for specialized answer evaluators. The hope is that a well designed set of filters can easily be combined to form a new answer_evaluator and that this method will produce answer evaluators which are are more robust than the method of copying existing answer evaluators and modifying them. Here is an outline of how a filter is constructed: sub filter{ |