EduploneTest/types EduploneTestingEnvironment.py,1.15,1.16

Claudia Disque <[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-serv838/types

Modified Files:
	EduploneTestingEnvironment.py 
Log Message:
new: eduplone_testingResults_global.pt and minor fixes and minor fixes

Index: EduploneTestingEnvironment.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneTest/types/EduploneTestingEnvironment.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** EduploneTestingEnvironment.py	14 Oct 2004 09:12:48 -0000	1.15
--- EduploneTestingEnvironment.py	27 Oct 2004 20:02:12 -0000	1.16
***************
*** 376,381 ****
          return uAnswer
  
- 
- 
      def score_CalculateQuestion(self, questionId, userId):
          """ calculates user-score for a single question
--- 376,379 ----
***************
*** 383,386 ****
--- 381,385 ----
              (ScoreTotal / Alternatives) * CorrectAnswers
          """
+         
  	if self.users[userId]._scoreOverride.has_key(questionId):
              return self.users[userId]._scoreOverride[questionId]
***************
*** 390,394 ****
  
          if len(possibleAnswers)==0 :
!             return 0 #there is no answer for a question; 
  		     #this should be checked, before actually running a test, i think...
  
--- 389,393 ----
  
          if len(possibleAnswers)==0 :
!             return 0 #there is no answer for a question;
  		     #this should be checked, before actually running a test, i think...
  
***************
*** 411,415 ****
  		for ii in i.getCorrectAnswer():#alternatives of correctAnswer (i.e. different spelling...)
  		    if uAnswer.has_key(questionId):
! 			if ii in uAnswer[questionId]: 
  			    inText=1
  		correctAnswers += inText
--- 410,414 ----
  		for ii in i.getCorrectAnswer():#alternatives of correctAnswer (i.e. different spelling...)
  		    if uAnswer.has_key(questionId):
! 			if ii in uAnswer[questionId]:
  			    inText=1
  		correctAnswers += inText
***************
*** 444,449 ****
  
  
- 
- 
      def score_CalculateTotal(self, userId):
          """ calculates user-score for a single question """
--- 443,446 ----
***************
*** 453,456 ****
--- 450,459 ----
          return totalscore
  
+     def getUserScoreInPercent(self, userId):
+         """ calculates user-score in percent """
+         score_total = self.getTotalAvailableScore()
+         score_user = round(self.score_CalculateTotal(userId), 2)
+         return float(score_user)/float(score_total) * 100
+ 
      def getTotalAvailableScore(self):
          """ sums up the available points """
***************
*** 472,476 ****
  	test_start_time = self.getStarttime().timeTime()
  	test_stop_time = self.getStoptime().timeTime()
! 	
  	if test_start_time == None and current_time < test_stop_time:
  	    return 1
--- 475,479 ----
  	test_start_time = self.getStarttime().timeTime()
  	test_stop_time = self.getStoptime().timeTime()
! 
  	if test_start_time == None and current_time < test_stop_time:
  	    return 1



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.