Forum archive 2000-2006

Gavin LaRose - fun_cmp, OR, and empty answers

Gavin LaRose - fun_cmp, OR, and empty answers

by Arnold Pizer -
Number of replies: 0
inactiveTopicfun_cmp, OR, and empty answers topic started 5/4/2004; 12:33:47 PM
last post 5/4/2004; 2:06:44 PM
userGavin LaRose - fun_cmp, OR, and empty answers  blueArrow
5/4/2004; 12:33:47 PM (reads: 602, responses: 1)
Hi all,

Well, I tried to post this and it bailed.  Take two.  I have an answer evaluator that uses fun_cmp() to compare a student answer with the two answers y1 = A f(t) + B g(t) and y2 = A g(t) + B f(t), then OR()s the resulting AnswerHashs and returns the result.  I thought this showed up on the discussion list sometime before this, but I can't find it now.

The odd thing is that when the problem is loaded with no answers entered, there's an "unintialized value" error coming from AnswerHash.pm line 411, which is

$out_hash->{preview_text_string} = join("   ", $self->{preview_text_string}, $rh_ans2->{preview_text_string} );

($self and $rh_ans2 are the AnswerHashs from evaluating the student answer against fun_cmp()).  Replacing this with

$out_hash->{preview_text_string} = join("   ", (defined( $self->{preview_text_string} ) ? $self->{preview_text_string} : ''), (defined( $rh_ans2->{preview_text_string} ) ? $rh_ans2->{preview_text_string} : '') );

resolves the problem.

It seems odd that there would be a problem with this in the OR() but not in fun_cmp() itself.  Or maybe I'm just more tired than I thought.

In any event, comments and thoughts are welcome.

Gavin

<| Post or View Comments |>


userJohn Jones - Re: fun_cmp, OR, and empty answers  blueArrow
5/4/2004; 2:06:44 PM (reads: 764, responses: 0)
The answer evaluator pc_evaluator was originally designed to give varying amounts of partial credit for different answers.  It turned out to be more useful for things like an alternative way of taking the or of several answer evaluators.  Searching the list for pc_evaluator should turn up the previous threads.

John

<| Post or View Comments |>