Ignore:
Timestamp:
7 Nov 2012, 08:27:23 (12 years ago)
Author:
Henrik Bettermann
Message:

Add 'show students' button to CoursePage?.

Lecturers can now list all students in course but they can neither access the students nor the respective course tickets. A CourseTicketPrincipalRoleManager? does not yet exist. And we have to discuss what lecturers are supposed to see. In my opinion, lecturers must no see student data.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/browser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py

    r9545 r9565  
    6262
    6363from waeup.kofa.students.catalog import search as searchstudents
     64from waeup.kofa.students.catalog import StudentQueryResultItem
    6465from waeup.kofa.university.catalog import search
    6566from waeup.kofa.university.vocabularies import course_levels
     
    18901891    """
    18911892    grok.context(ICertificate)
    1892     grok.require('waeup.showStudents')
    18931893    grok.name('showcertstudents')
    1894     pnav = 1
    1895     label = _('Students')
    18961894
    18971895    @property
     
    18991897        hitlist = searchstudents(query=self.context.code,
    19001898            searchtype='certcode', view=self)
     1899        return hitlist
     1900
     1901class ShowStudentsInCoursePage(ShowStudentsInDepartmentPage):
     1902    """Page that lists all students studying a certificate.
     1903    """
     1904    grok.context(ICourse)
     1905    grok.name('showcoursestudents')
     1906
     1907    @property
     1908    def getStudents(self):
     1909        hitlist = []
     1910        cat = queryUtility(ICatalog, name='coursetickets_catalog')
     1911        results = cat.searchResults(code=(self.context.code, self.context.code))
     1912        for result in results:
     1913            hitlist.append(StudentQueryResultItem(result.student, view=self))
    19011914        return hitlist
    19021915
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py

    r9274 r9565  
    452452    text = _('Manage certificate')
    453453
     454class ShowCourseStudentsActionButton(ManageActionButton):
     455    """ 'Show students' button in course.
     456    """
     457    grok.context(ICourse)
     458    grok.view(CoursePage)
     459    grok.require('waeup.showStudents')
     460    icon = 'actionicon_student.png'
     461    text = _('Show students')
     462    target = 'showcoursestudents'
     463
    454464class ShowCertificateStudentsActionButton(ManageActionButton):
    455465    """ 'Show students' button for certificates.
Note: See TracChangeset for help on using the changeset viewer.