EduploneTest/types EduploneTestingEnvironment.py,1.10,1.11
Nils Haagen <[email protected]>
| Newsgroups | gmane.comp.web.zope.eduplone.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/eduplone/EduploneTest/types
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1084/types
Modified Files:
EduploneTestingEnvironment.py
Log Message:
automated scoring for free-text
Index: EduploneTestingEnvironment.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneTest/types/EduploneTestingEnvironment.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** EduploneTestingEnvironment.py 12 Oct 2004 10:53:23 -0000 1.10
--- EduploneTestingEnvironment.py 13 Oct 2004 10:31:02 -0000 1.11
***************
*** 372,375 ****
--- 372,377 ----
return uAnswer
+
+
def score_CalculateQuestion(self, questionId, userId):
""" calculates user-score for a single question
***************
*** 377,381 ****
(ScoreTotal / Alternatives) * CorrectAnswers
"""
! if self.users[userId]._scoreOverride.has_key(questionId):
return self.users[userId]._scoreOverride[questionId]
--- 379,383 ----
(ScoreTotal / Alternatives) * CorrectAnswers
"""
! if self.users[userId]._scoreOverride.has_key(questionId):
return self.users[userId]._scoreOverride[questionId]
***************
*** 384,395 ****
if len(possibleAnswers)==0 :
! print 'no Answers for qID ' + questionId
! return 0 #wo nix is, kan man auch nix auswerten....
uAnswer=self.users[userId].getAnswer(questionId)
-
if self[questionId].meta_type in ['eduplone TextTask']:#, 'eduplone FreeText']: #take FreeText out!
! print '-TextTask:'
if uAnswer.has_key(questionId):
uAnswer=uAnswer[questionId]
--- 386,396 ----
if len(possibleAnswers)==0 :
! return 0 #there is no answer for a question;
! #this should be checked, before actually running a test, i think...
uAnswer=self.users[userId].getAnswer(questionId)
if self[questionId].meta_type in ['eduplone TextTask']:#, 'eduplone FreeText']: #take FreeText out!
! ##print '-TextTask:'
if uAnswer.has_key(questionId):
uAnswer=uAnswer[questionId]
***************
*** 401,409 ****
if self[questionId].meta_type in ['eduplone FreeText']:
print '-FreeText'
! #alle begriffe muessen enthalten sein:
if self[questionId].meta_type in ['eduplone SingleChoice']:
! print '-SingleChoice'
if uAnswer.has_key(questionId):
if self[questionId][uAnswer[questionId]].getCorrectAnswer()==1: return questionScore
--- 402,423 ----
if self[questionId].meta_type in ['eduplone FreeText']:
print '-FreeText'
! correctAnswers=0
! for i in possibleAnswers: #answer-object
! inText=0
! for ii in i.getCorrectAnswer():#alternatives of correctAnswer (i.e. different spelling...)
! if ii in uAnswer[questionId]:
! inText=1
! correctAnswers += inText
!
! wrongAnswers=len(possibleAnswers)-correctAnswers
! return (float(questionScore)/float(len(possibleAnswers))) * correctAnswers
!
!
! if self[questionId].meta_type in ['eduplone FillGap']:
! print '-FillGap'
if self[questionId].meta_type in ['eduplone SingleChoice']:
! ##print '-SingleChoice'
if uAnswer.has_key(questionId):
if self[questionId][uAnswer[questionId]].getCorrectAnswer()==1: return questionScore
***************
*** 420,423 ****
--- 434,438 ----
return (float(questionScore)/float(len(possibleAnswers))) * correctAnswers
+
def score_CalculateTotal(self, userId):
""" calculates user-score for a single question """
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl