Changeset 9688


Ignore:
Timestamp:
19 Nov 2012, 18:19:35 (12 years ago)
Author:
Henrik Bettermann
Message:

Show GPA.

Location:
main/waeup.uniben/trunk/src/waeup/uniben/students
Files:
4 edited

Legend:

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

    r9686 r9688  
    191191            self.redirect(self.url(self.context))
    192192            return
    193         if self.total_credits > self.max_credits:
     193        if self.context.total_credits > self.max_credits:
    194194            self.flash(_('Maximum credits of ${a} exceeded.',
    195195                mapping = {'a':self.max_credits}))
  • main/waeup.uniben/trunk/src/waeup/uniben/students/browser_templates/studyleveleditpage.pt

    r9686 r9688  
    55    Course Tickets
    66    (Total Credits:
    7     <span i18n:name="total_credits" tal:replace="view/total_credits">TOTAL</span>)
     7    <span i18n:name="total_credits"
     8      tal:replace="view/context/total_credits">TOTAL</span>)
    89  </h3>
    910  <table class="display dataTableManage">
  • main/waeup.uniben/trunk/src/waeup/uniben/students/browser_templates/studylevelpage.pt

    r9686 r9688  
    2020      </td>
    2121      <td>
    22         <span tal:replace="view/total_credits">TOTAL</span>
     22        <span tal:replace="view/context/total_credits">TOTAL</span>
     23      </td>
     24    </tr>
     25    <tr>
     26      <td i18n:translate="">
     27        Momentary GPA:
     28      </td>
     29      <td>
     30        <span tal:replace="python: '%4.2f' % view.context.gpa">2.33</span>
    2331      </td>
    2432    </tr>
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py

    r9686 r9688  
    342342        # A level with one course ticket was created
    343343        self.assertEqual(self.student['studycourse']['100'].number_of_tickets, 1)
     344        self.student['studycourse']['100']['COURSE1'].score = 55
    344345        self.browser.getLink("100").click()
     346        # GPA has been properly calculated and is shown on the page
     347        self.assertTrue('3.00' in self.browser.contents)
     348        self.assertEqual(self.student['studycourse']['100'].gpa, 3.0)
     349        # Score is not shown but grade
    345350        self.assertTrue('<th>Grade</th>' in self.browser.contents)
    346351        self.assertFalse('<th>Score</th>' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.