phptest-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phptest-users] a 'more than one answer' question


From: Brandon Tallent
Subject: Re: [Phptest-users] a 'more than one answer' question
Date: Tue, 11 Feb 2003 08:28:25 -0800 (PST)

Hi Tom, 

The cShortAnswer file i sent you was from a heavily
modified version of phptest, so I don't think it will
work well with the stock version.  Basically I
realized that in order to support new question types,
I had to move the scoring function for each individual
question type into the qtype class file.  This allowed
more flexibility so that questions could be answered
differently.  For instance, for the cshortanswer
question we needed to check that the users answer
matched _any_ of the alternate answers instead of
matching just one.  So my modified ctest.inc.php looks
like this around that area:

$q = pt_inst_qclass($row->question_type_id);
$points += $q->score($question_id,
stripslashes($answer));

The first line instantiates the proper question class.
 The second line calls the score function of the
question class.  I setup the score function so that it
returns the number of points that should be granted
for that question.  I did it that way because of a
request for someone to have a multiple checkbox
question.  This person wanted to have partial points
based on how many checkboxes were correct.  Anyway
that should be enough to get you going if you're
trying to use that shortanswer question type.  

As for help, yes I would like some :)  But not at the
moment.  The problem is that I've got a bunch of
different stuff going on and don't have much time to
devote to phptest right now.  That normally wouldnt be
a big deal except that we should both be working off
of the same cvs tree to avoid problems with the
sources getting out of sync.  I haven't updated to cvs
for a long time because I started a major rewrite of
all of the code to use templates to seperate the html
from the buisness logic.  It turns out it's a major
pain in the ass to do which is why I've been putting
it off for awhile :)  Once I get all of the code
updated and working again in cvs I'll give you cvs
access and we can go from there.


Brandon



--- TW <address@hidden> wrote:
> Hi Brandon,
> 
>  Say, I was playing around with the scripts you sent
> me the other day with
> your more than one answer stuff. How is the
> cShortAnswer field tied into the
> test.php? It seems not to be other than it jumps
> from grade function to
> score function and back to grade -- is this correct?
> looks like I might be
> missing a variable or two you might have added? but
> it doesn't work for me -
> but then I have a really customized setup of phptest
> so I'm trying to track
> down the problem.
> BTW if your looking for some help on this (per your
> last e-mail I got) I'd
> be more than happy to help out. I wrote you an
> e-mail awhile ago but not
> sure if you got it? We were having some funky server
> problems a week or so
> ago so I couldn't tell if it actually got sent, it
> seemed like it.
> I'll stick up a working demo of what I've been doing
> with PT, I think you'll
> like it. Be a few days though before I go public
> with it.... Anyways, yack
> at ya later dude...
> 
> Cheerios!
> 
> TW
> 
> 
> _______________________________________________
> Phptest-users mailing list
> address@hidden
>
http://mail.nongnu.org/mailman/listinfo/phptest-users


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]