Changeset 14000 for main/waeup.aaue/trunk/src
- Timestamp:
- 30 Jun 2016, 09:23:19 (8 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py
r13997 r14000 29 29 from waeup.kofa.interfaces import IKofaUtils, academic_sessions_vocab 30 30 from waeup.kofa.students.interfaces import IStudentsUtils, IStudent 31 from waeup.kofa.students.workflow import PAID, REGISTERED 31 from waeup.kofa.students.workflow import PAID, REGISTERED, RETURNING 32 32 from waeup.kofa.students.studylevel import getGradeWeightFromScore 33 33 from waeup.kofa.students.browser import ( … … 212 212 'validation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 213 213 214 @property 215 def show_results(self): 216 isStudent = getattr( 217 self.request.principal, 'user_type', None) == 'student' 218 if isStudent and self.context.student.state != RETURNING \ 219 and self.context.student.current_level == self.context.level: 220 return False 221 return True 222 214 223 class CustomStudyLevelManageFormPage(StudyLevelManageFormPage): 215 224 """ Page to edit the student study level data … … 234 243 'phone', 'adm_code', 'sex', 'email', 'date_of_birth', 235 244 'department', 'current_mode', 'current_level', 'flash_notice') 245 246 @property 247 def show_results(self): 248 isStudent = getattr( 249 self.request.principal, 'user_type', None) == 'student' 250 return not isStudent \ 251 or self.context.student.current_level != self.context.level \ 252 or self.context.student.state == RETURNING 236 253 237 254 def update(self): … … 240 257 self.flash(_('Forbidden'), type="warning") 241 258 self.redirect(self.url(self.context)) 259 return 242 260 243 261 @property … … 305 323 Title = translate(_('Title'), target_language=portal_language) 306 324 Cred = translate(_('Cred.'), target_language=portal_language) 307 Score = translate(_('Score'), target_language=portal_language) 308 #CA = translate(_('CA'), target_language=portal_language) 309 Grade = translate(_('Grade'), target_language=portal_language) 325 if self.show_results: 326 Score = translate(_('Score'), target_language=portal_language) 327 #CA = translate(_('CA'), target_language=portal_language) 328 Grade = translate(_('Grade'), target_language=portal_language) 310 329 Signature = translate(_('Lecturer\'s Signature'), 'waeup.aaue', 311 330 target_language=portal_language) … … 321 340 [value for value in self.context.values() if value.semester == i], 322 341 key=lambda value: str(value.semester) + value.code)) 323 tableheader.append([(Code,'code', 2.0), 324 (Title,'title', 7), 325 (Cred, 'credits', 1.5), 326 (Score, 'score', 1.4), 327 #(CA, 'ca', 1.4), 328 (Grade, 'grade', 1.4), 329 (Signature, 'dummy', 3), 330 ]) 342 if self.show_results: 343 tableheader.append([(Code,'code', 2.0), 344 (Title,'title', 7), 345 (Cred, 'credits', 1.5), 346 (Score, 'score', 1.4), 347 #(CA, 'ca', 1.4), 348 (Grade, 'grade', 1.4), 349 (Signature, 'dummy', 3), 350 ]) 351 else: 352 tableheader.append([(Code,'code', 2.0), 353 (Title,'title', 7), 354 (Cred, 'credits', 1.5), 355 (Signature, 'dummy', 3), 356 ]) 331 357 if len(self.label.split('\n')) == 3: 332 358 topMargin = 1.9 -
main/waeup.aaue/trunk/src/waeup/aaue/students/browser_templates/studyleveleditpage.pt
r13937 r14000 18 18 <th i18n:translate="">Faculty</th> 19 19 <th i18n:translate="">Credits</th> 20 <th i18n:translate="">Score</th>21 <th i18n:translate="">CA</th>22 20 <th i18n:translate="">CO</th> 23 21 </tr> … … 38 36 <td tal:content="value/fcode">FACULTY</td> 39 37 <td tal:content="value/credits">CREDITS</td> 40 <td tal:content="value/score|nothing">SCORE</td>41 <td tal:content="value/ca|nothing">CA</td>42 38 <td tal:content="value/carry_over">CO</td> 43 39 </tr> -
main/waeup.aaue/trunk/src/waeup/aaue/students/browser_templates/studylevelpage.pt
r13834 r14000 46 46 <td tal:content="value/credits">CREDITS</td> 47 47 <td tal:content="value/mandatory">MANDATORY</td> 48 <td tal:con tent="value/score|nothing">SCORE</td>49 <td tal:con tent="value/ca|nothing">CA</td>50 <td tal:con tent="value/grade|nothing">GRADE</td>51 <td tal:con tent="value/carry_over">CO</td>48 <td tal:condition="view/show_results" tal:content="value/score|nothing">SCORE</td> 49 <td tal:condition="view/show_results" tal:content="value/ca|nothing">CA</td> 50 <td tal:condition="view/show_results" tal:content="value/grade|nothing">GRADE</td> 51 <td tal:condition="view/show_results" tal:content="value/carry_over">CO</td> 52 52 <td tal:content="value/automatic">AUTO</td> 53 53 </tr> -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r13964 r14000 441 441 self.browser.contents) 442 442 self.browser.getControl("Create course list now").click() 443 self.student['studycourse']['100']['COURSE1'].score = 987 443 444 self.browser.getLink("100").click() 445 # Course results can't be seen 446 self.assertFalse('987' in self.browser.contents) 444 447 self.browser.getLink("Edit course list").click() 448 self.assertFalse('987' in self.browser.contents) 445 449 self.browser.getControl("Register course list").click() 446 450 self.assertTrue('Course registration has ended. Please pay' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.