EduploneTest/types EduploneTestMember.py,1.5,1.6 EduploneTestingEnvironment.py,1.18,1.19
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-serv13558/types
Modified Files:
EduploneTestMember.py EduploneTestingEnvironment.py
Log Message:
schemata for environment, feedback after completing the test
Index: EduploneTestMember.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneTest/types/EduploneTestMember.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** EduploneTestMember.py 13 Oct 2004 13:07:56 -0000 1.5
--- EduploneTestMember.py 8 Nov 2004 11:29:21 -0000 1.6
***************
*** 127,131 ****
else:
try:
- print self.answers[questionId][answerId]
return self.answers[questionId][answerId]
except:
--- 127,130 ----
Index: EduploneTestingEnvironment.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneTest/types/EduploneTestingEnvironment.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** EduploneTestingEnvironment.py 7 Nov 2004 20:42:09 -0000 1.18
--- EduploneTestingEnvironment.py 8 Nov 2004 11:29:21 -0000 1.19
***************
*** 74,79 ****
description_msgid='help_test_description',
i18n_domain='eduplone'),
! #schemata='Description'
),
BooleanField(
'public',
--- 74,93 ----
description_msgid='help_test_description',
i18n_domain='eduplone'),
! schemata='Text'
! ),
!
! TextField(
! 'feedback_txt',
! required=1,
! searchable = 1,
! widget=TextAreaWidget(label = u"Feedback",
! label_msgid='label_test_feedback_text',
! description = u"Exam feedback",
! description_msgid='help_test_feedback_text',
! i18n_domain='eduplone'),
! schemata='Text'
),
+
+
BooleanField(
'public',
***************
*** 84,88 ****
description_msgid='help_public_test',
i18n_domain='eduplone'),
! #schemata='Description'
),
BooleanField(
--- 98,102 ----
description_msgid='help_public_test',
i18n_domain='eduplone'),
! schemata='Settings'
),
BooleanField(
***************
*** 94,98 ****
description_msgid='help_validate_users',
i18n_domain='eduplone'),
! #schemata='Flow'
),
BooleanField(
--- 108,112 ----
description_msgid='help_validate_users',
i18n_domain='eduplone'),
! schemata='Settings'
),
BooleanField(
***************
*** 104,107 ****
--- 118,122 ----
description_msgid = "help_test_in_new_window",
i18n_domain = "eduplone"),
+ schemata="Settings"
),
BooleanField(
***************
*** 113,117 ****
description_msgid='help_show_score',
i18n_domain='eduplone'),
! # schemata='Description'
),
BooleanField(
--- 128,132 ----
description_msgid='help_show_score',
i18n_domain='eduplone'),
! schemata='Settings'
),
BooleanField(
***************
*** 123,127 ****
description_msgid='help_show_results',
i18n_domain='eduplone'),
! # schemata='Flow'
),
--- 138,142 ----
description_msgid='help_show_results',
i18n_domain='eduplone'),
! schemata='Settings'
),
***************
*** 133,137 ****
description_msgid='help_start_date',
i18n_domain='eduplone'),
! #schemata='Flow'
),
DateTimeField(
--- 148,152 ----
description_msgid='help_start_date',
i18n_domain='eduplone'),
! schemata='Settings'
),
DateTimeField(
***************
*** 142,146 ****
description_msgid='help_end_date',
i18n_domain='eduplone'),
! #schemata='Flow'
),
),
--- 157,161 ----
description_msgid='help_end_date',
i18n_domain='eduplone'),
! schemata='Settings'
),
),
***************
*** 270,277 ****
#if self.show_results.....
#return self.users[self.eduplone_userResults(getCurrentUser.getId())
! return self.REQUEST.response.redirect(self.users[self.getCurrentUser().getId()].absolute_url() + '/eduplone_userResults')
return self.sequence_getNext(questionid)
def _filteredAnswerValues(self, questionId):
"""For MatchingTasks, it is possible to have the selection-box
--- 285,296 ----
#if self.show_results.....
#return self.users[self.eduplone_userResults(getCurrentUser.getId())
! return self.REQUEST.response.redirect(self.absolute_url() + '/test_environment_feedback')
return self.sequence_getNext(questionid)
+
+
+ ##CLEAN THAT UP
+
def _filteredAnswerValues(self, questionId):
"""For MatchingTasks, it is possible to have the selection-box
***************
*** 299,311 ****
return result
! def _getPointsOfQuestion(self,questionId):
! """ naja, kann man sich auch schenken..."""
! return self[questionId].score
def _getCorrectAnswers(self, questionId): ##not needed anymore ?
""" """
- #! not nice for MatchingTask: if "challenge" is off,
- #there is one less possible answer than objectValues!
- #thus: _filteredAnswerValues
result={}
--- 318,330 ----
return result
! #def _getPointsOfQuestion(self,questionId):
! # """ naja, kann man sich auch schenken..."""
! # return self[questionId].score
!
! ##CLEAN THAT UP
!
def _getCorrectAnswers(self, questionId): ##not needed anymore ?
""" """
result={}
***************
*** 320,323 ****
--- 339,343 ----
return result
+
def _getCorrectAnswer(self, questionId, answerId):
""" """
***************
*** 329,343 ****
cAnswer=[]
! #if mType in ['eduplone FillGap']:
! # if objQ.getTask_type()=='Dropdown':
! # mType='eduplone Matching'
! # else:
! # mType=TextTask
! # return []
!
! if mType in ['eduplone SingleChoice']: #SingleChoice requires id of answer as uAnswer
cAnswer.append(objA.getId())
! if mType in ['eduplone MultiChoice', 'eduplone Matching', 'eduplone TrueFalse']: #MultiChoice requires id of answer as uAnswer
cAnswer.append(str(objA.getCorrectAnswer()))
--- 349,356 ----
cAnswer=[]
! if mType in ['eduplone SingleChoice']:
cAnswer.append(objA.getId())
! if mType in ['eduplone MultiChoice', 'eduplone Matching', 'eduplone TrueFalse']:
cAnswer.append(str(objA.getCorrectAnswer()))
***************
*** 355,358 ****
--- 368,372 ----
return cAnswer
+
def evalAnswer(self, questionId, answerId, uAnswer):
"""returns true (1), if answer is correct,
***************
*** 396,399 ****
--- 410,414 ----
return ret
+
def score_CalculateQuestion(self, questionId, userId):
""" calculates user-score for a single question
***************
*** 401,405 ****
(ScoreTotal / Alternatives) * CorrectAnswers
"""
-
if self.users[userId]._scoreOverride.has_key(questionId):
return self.users[userId]._scoreOverride[questionId]
--- 416,419 ----
***************
*** 420,424 ****
if self.evalAnswer(questionId, possibleAnswers[0].getId(), uAnswer):
return questionScore
-
return 0
--- 434,437 ----
***************
*** 470,482 ****
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 """
-
TotalScore=0
for obj in self.objectValues():
--- 483,497 ----
return totalscore
+
def getUserScoreInPercent(self, userId):
""" calculates user-score in percent """
score_total = self.getTotalAvailableScore()
! #score_user = round(self.score_CalculateTotal(userId), 2) # why round here?
! score_user = self.score_CalculateTotal(userId)
return float(score_user)/float(score_total) * 100
+
def getTotalAvailableScore(self):
""" sums up the available points """
TotalScore=0
for obj in self.objectValues():
***************
*** 486,492 ****
return str(TotalScore)
def testIsRunning(self):
! """
! Returns 1 if the test is running, 0 if not.
Uses start / stop times to evaluate.
Returns 1 if either start or stop time is not set.
--- 501,507 ----
return str(TotalScore)
+
def testIsRunning(self):
! """ Returns 1 if the test is running, 0 if not.
Uses start / stop times to evaluate.
Returns 1 if either start or stop time is not set.
***************
*** 507,513 ****
return 0
def applyForTest(self):
! """
! Method adds an 'eduplone TestMember' to the user folder. Then
it sets user's state to '1' (waiting for verification/dismissal)
"""
--- 522,528 ----
return 0
+
def applyForTest(self):
! """ Method adds an 'eduplone TestMember' to the user folder. Then
it sets user's state to '1' (waiting for verification/dismissal)
"""
-------------------------------------------------------
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