Changeset 14700 for main/waeup.aaue/trunk/src/waeup/aaue
- Timestamp:
- 24 Jun 2017, 07:11:54 (8 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/interfaces.py
r14518 r14700 21 21 from zc.sourcefactory.basic import BasicSourceFactory 22 22 from waeup.kofa.interfaces import (SimpleKofaVocabulary, 23 ISessionConfiguration, academic_sessions_vocab) 23 ISessionConfiguration, academic_sessions_vocab, 24 ContextualDictSourceFactoryBase) 24 25 25 26 _ = MessageFactory = zope.i18nmessageid.MessageFactory('waeup.aaue') 27 28 class EnableScoreEditingGroupSource(ContextualDictSourceFactoryBase): 29 """A source for filtering groups of students 30 """ 31 DICT_NAME = 'ENABLE_SCORE_EDITING_GROUP_DICT' 26 32 27 33 # It's recommended to replicate all fields from the base package here. … … 254 260 ) 255 261 262 score_editing_enabled = schema.List( 263 title = _(u'Score editing enabled'), 264 value_type = schema.Choice( 265 source = EnableScoreEditingGroupSource(), 266 ), 267 required = False, 268 defaultFactory=list, 269 ) 270 256 271 257 272 def getSessionString(): -
main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py
r14697 r14700 815 815 grok.template('editscorespage') 816 816 817 def _searchCatalog(self, session): 818 cat = queryUtility(ICatalog, name='coursetickets_catalog') 819 coursetickets = cat.searchResults( 820 session=(session, session), 821 code=(self.context.code, self.context.code) 822 ) 823 try: 824 score_editing_enabled = grok.getSite()[ 825 'configuration'][str(session)].score_editing_enabled 826 except KeyError: 827 return [] 828 coursetickets_list = [ 829 i for i in coursetickets 830 if i.student.current_mode in score_editing_enabled] 831 return coursetickets_list 817 832 818 833 def _extract_uploadfile(self, uploadfile): -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r14661 r14700 218 218 219 219 def test_for_instalment_payments(self): 220 221 220 configuration_1 = createObject('waeup.SessionConfiguration') 222 221 configuration_1.academic_session = 2015 … … 364 363 # set value to change from 365 364 self.student['studycourse']['100']['COURSE1'].score = 55 365 self.app['configuration']['2004'].score_editing_enabled = ['ug_ft'] 366 366 self.browser.open(self.edit_scores_url) 367 367 upload_ctrl = self.browser.getControl(name='uploadfile:file') … … 381 381 self.browser.open(self.edit_prev_scores_url) 382 382 self.assertTrue('No student found' in self.browser.contents) 383 configuration = createObject('waeup.SessionConfiguration') 384 configuration.academic_session = 2003 385 self.app['configuration'].addSessionConfiguration(configuration) 386 self.app['configuration']['2003'].score_editing_enabled = ['ug_ft'] 383 387 self.student['studycourse']['100'].level_session = 2003 384 388 notify(grok.ObjectModifiedEvent(self.student['studycourse']['100']['COURSE1'])) … … 407 411 self.student['studycourse']['100']['COURSE1'].score = 55 408 412 self.student['studycourse']['100']['COURSE1'].ca = 11 413 self.app['configuration']['2004'].score_editing_enabled = ['ug_ft'] 409 414 pdf_url = '%s/coursetickets.pdf' % self.course_url 410 415 self.browser.open(pdf_url) … … 415 420 open(path, 'wb').write(self.browser.contents) 416 421 print "Sample PDF coursetickets.pdf written to %s" % path 422 423 def test_lecturers_do_only_see_selected_students(self): 424 # A course ticket slip can be downloaded 425 self.login_as_lecturer() 426 self.student['studycourse']['100']['COURSE1'].score = 55 427 self.student['studycourse']['100']['COURSE1'].ca = 11 428 self.browser.open(self.edit_scores_url) 429 self.assertTrue('No student found' in self.browser.contents) 430 self.app['configuration']['2004'].score_editing_enabled = ['ug_ft'] 431 self.browser.open(self.edit_scores_url) 432 self.assertFalse('No student found' in self.browser.contents) 433 self.assertTrue('TESTER, Anna' in self.browser.contents) 417 434 418 435 def test_transcripts(self): … … 1119 1136 self.app['faculties']['fac1']['dep1'].score_editing_disabled = False 1120 1137 self.app['configuration'].current_academic_session = 2004 1138 self.app['configuration']['2004'].score_editing_enabled = ['ug_ft'] 1121 1139 IWorkflowState(self.student).setState('courses validated') 1122 1140 self.browser.open( -
main/waeup.aaue/trunk/src/waeup/aaue/utils/utils.py
r14650 r14700 162 162 'ijmbe': 'IJMBE Preparation', 163 163 } 164 165 ENABLE_SCORE_EDITING_GROUP_DICT = STUDY_MODES_DICT 164 166 165 167 VERDICTS_DICT = {
Note: See TracChangeset for help on using the changeset viewer.