Ignore:
Timestamp:
24 Jan 2017, 09:32:47 (8 years ago)
Author:
Henrik Bettermann
Message:

Students must not see scores, cas and grades of their registered courses.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/students
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py

    r14385 r14453  
    675675    """ Page to display course tickets
    676676    """
    677     form_fields = grok.AutoFields(ICustomCourseTicket)
     677
     678    @property
     679    def show_results(self):
     680        isStudent = getattr(
     681            self.request.principal, 'user_type', None) == 'student'
     682        if isStudent:
     683            return False
     684        return True
     685
     686    @property
     687    def form_fields(self):
     688        if self.show_results:
     689            return grok.AutoFields(ICustomCourseTicket)
     690        else:
     691            return grok.AutoFields(ICustomCourseTicket).omit('score').omit('ca')
    678692
    679693class CustomCourseTicketManageFormPage(CourseTicketManageFormPage):
  • main/waeup.aaue/trunk/src/waeup/aaue/students/browser_templates/studylevelpage.pt

    r14000 r14453  
    2828      <th i18n:translate="">Cred.</th>
    2929      <th i18n:translate="">Requ.</th>
    30       <th i18n:translate="">Score</th>
    31       <th i18n:translate="">CA</th>
    32       <th i18n:translate="">Grade</th>
     30      <th i18n:translate="" tal:condition="view/show_results" >Score</th>
     31      <th i18n:translate="" tal:condition="view/show_results" >CA</th>
     32      <th i18n:translate="" tal:condition="view/show_results" >Grade</th>
    3333      <th i18n:translate="">CO</th>
    3434      <th i18n:translate="">Auto</th>
     
    4949      <td tal:condition="view/show_results" tal:content="value/ca|nothing">CA</td>
    5050      <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>
     51      <td tal:content="value/carry_over">CO</td>
    5252      <td tal:content="value/automatic">AUTO</td>
    5353    </tr>
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py

    r14384 r14453  
    833833        print "Sample PDF pg_course_registration_slip.pdf written to %s" % path
    834834
     835        # Students cant' view scores, cas and grades.
     836        self.browser.open(self.student_path + '/studycourse/100')
     837        self.assertFalse('Score' in self.browser.contents)
     838        self.assertFalse('CA' in self.browser.contents)
     839        self.assertFalse('Grade' in self.browser.contents)
     840        self.browser.getLink("COURSE1").click()
     841        self.browser.open(self.student_path + '/studycourse/100')
     842        self.assertFalse('Score' in self.browser.contents)
     843        self.assertFalse('CA' in self.browser.contents)
     844        self.assertFalse('Grade' in self.browser.contents)
     845
    835846    def test_student_2nd_semester_course_registration(self):
    836847        IWorkflowState(self.student).setState('school fee paid')
Note: See TracChangeset for help on using the changeset viewer.