Ignore:
Timestamp:
23 Feb 2017, 11:44:30 (8 years ago)
Author:
Henrik Bettermann
Message:

Add outstanding attribute to course tickets.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py

    r14337 r14574  
    658658            'student_id','reg_number','matric_number',
    659659            'mandatory', 'score', 'carry_over', 'automatic',
    660             'level_session',
     660            'outstanding', 'level_session',
    661661            'title', 'credits', 'passmark', 'semester'
    662662            ] + self.additional_fields
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r14247 r14574  
    598598        )
    599599
    600     gpa = schema.Int(
     600    gpa = schema.TextLine(
    601601        title = _(u'Unrectified GPA'),
    602602        required = False,
     
    664664        )
    665665
     666    outstanding = schema.Bool(
     667        title = _(u'Outstanding Course'),
     668        default = False,
     669        required = False,
     670        )
     671
    666672    score = schema.Int(
    667673        title = _(u'Score'),
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py

    r14572 r14574  
    7575        credits_counted = level_obj.gpa_params[1]
    7676        credits_passed = passed_params[2]
    77         level_gpa = format_float(level_obj.gpa, 3)
     77        level_gpa = format_float(level_obj.gpa_params[0], 3)
    7878        cum_credits_taken = level_obj.cumulative_params[1]
    7979        cum_credits_passed = level_obj.cumulative_params[4]
  • main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py

    r14531 r14574  
    2525from zope.component.interfaces import IFactory
    2626from zope.catalog.interfaces import ICatalog
    27 from zope.component import createObject, queryUtility
     27from zope.component import createObject, queryUtility, getUtility
    2828from zope.interface import implementedBy
    29 from waeup.kofa.interfaces import academic_sessions_vocab, VALIDATED
     29from waeup.kofa.interfaces import academic_sessions_vocab, VALIDATED, IKofaUtils
    3030from waeup.kofa.students.interfaces import (
    3131    IStudentStudyLevel, IStudentNavigation, ICourseTicket)
     
    7979        total = 0
    8080        for ticket in self.values():
    81             total += ticket.credits
     81            if not ticket.outstanding:
     82                total += ticket.credits
    8283        return total
    8384
     
    135136    @property
    136137    def gpa(self):
    137         return self.gpa_params[0]
     138        """Return string formatted gpa value.
     139        """
     140        format_float = getUtility(IKofaUtils).format_float
     141        return format_float(self.gpa_params[0], 2)
    138142
    139143    @property
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r14392 r14574  
    25762576        return
    25772577
     2578    def test_student_course_registration_outstanding(self):
     2579        self.course = createObject('waeup.Course')
     2580        self.course.code = 'COURSE2'
     2581        self.course.semester = 1
     2582        self.course.credits = 45
     2583        self.course.passmark = 40
     2584        self.app['faculties']['fac1']['dep1'].courses.addCourse(
     2585            self.course)
     2586        IWorkflowState(self.student).setState('school fee paid')
     2587        self.browser.open(self.login_path)
     2588        self.browser.getControl(name="form.login").value = self.student_id
     2589        self.browser.getControl(name="form.password").value = 'spwd'
     2590        self.browser.getControl("Login").click()
     2591        self.browser.open(self.student_path + '/studycourse/add')
     2592        self.browser.getControl("Create course list now").click()
     2593        self.assertEqual(self.student['studycourse']['100'].number_of_tickets, 1)
     2594        self.student['studycourse'].current_level = 200
     2595        self.browser.getLink("Study Course").click()
     2596        self.browser.getLink("Add course list").click()
     2597        self.assertMatches('...Add current level 200 (Year 2)...',
     2598                           self.browser.contents)
     2599        self.browser.getControl("Create course list now").click()
     2600        self.browser.getLink("200").click()
     2601        self.browser.getLink("Edit course list").click()
     2602        self.browser.getLink("here").click()
     2603        self.browser.getControl(name="form.course").value = ['COURSE2']
     2604        self.browser.getControl("Add course ticket").click()
     2605        # Carryover COURSE1 in level 200 already has 10 credits
     2606        self.assertMatches(
     2607            '...Total credits exceed 50...', self.browser.contents)
     2608        # If COURSE1 is outstanding, its credits won't be considered
     2609        self.student['studycourse']['200']['COURSE1'].outstanding = True
     2610        self.browser.getControl("Add course ticket").click()
     2611        self.assertMatches(
     2612            '...Successfully added COURSE2...', self.browser.contents)
     2613        return
     2614
    25782615    def test_postgraduate_student_access(self):
    25792616        self.certificate.study_mode = 'pg_ft'
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r14443 r14574  
    492492            'validated_by,validation_date,'
    493493            'student_id,number_of_tickets,certcode\r\n'
    494             '0.0,,,0,0,,,,0,\r\n'
     494            '0.00,,,0,0,,,,0,\r\n'
    495495            )
    496496        return
     
    510510            'validated_by,validation_date,'
    511511            'student_id,number_of_tickets,certcode\r\n'
    512             '0.0,100,2012,A,100,,,A111111,1,CERT1\r\n'
     512            '0.00,100,2012,A,100,,,A111111,1,CERT1\r\n'
    513513            )
    514514        return
     
    526526            'validated_by,validation_date,'
    527527            'student_id,number_of_tickets,certcode\r\n'
    528             '0.0,100,2012,A,100,,,A111111,1,CERT1\r\n'
     528            '0.00,100,2012,A,100,,,A111111,1,CERT1\r\n'
    529529            )
    530530        return
     
    541541            'validated_by,validation_date,'
    542542            'student_id,number_of_tickets,certcode\r\n'
    543             '0.0,100,2012,A,100,,,A111111,1,CERT1\r\n'
     543            '0.00,100,2012,A,100,,,A111111,1,CERT1\r\n'
    544544            )
    545545        return
     
    560560            'validated_by,validation_date,'
    561561            'student_id,number_of_tickets,certcode\r\n'
    562             '0.0,100,2012,A,100,,,A111111,1,CERT1\r\n'
     562            '0.00,100,2012,A,100,,,A111111,1,CERT1\r\n'
    563563            )
    564564        return
     
    579579            'validated_by,validation_date,'
    580580            'student_id,number_of_tickets,certcode\r\n'
    581             '0.0,100,2012,A,100,,,A111111,1,CERT1\r\n'
     581            '0.00,100,2012,A,100,,,A111111,1,CERT1\r\n'
    582582            )
    583583        return
     
    614614            result,
    615615            'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
    616             'mandatory,passmark,score,semester,title,student_id,certcode,'
     616            'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
    617617            'display_fullname\r\n'
    618             '0,0,,,,,,,0,,,,,,,\r\n'
     618            '0,0,,,,,,,0,0,,,,,,,\r\n'
    619619            )
    620620        return
     
    633633            result,
    634634            'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
    635             'mandatory,passmark,score,semester,title,student_id,certcode,'
     635            'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
    636636            'display_fullname\r\n'
    637             '1,1,CRS1,100,DEP1,FAC1,100,2012,0,100,,2,Course 1,A111111,CERT1,'
     637            '1,1,CRS1,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
    638638            'Anna M. Tester\r\n'
    639639            )
     
    650650            result,
    651651            'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
    652             'mandatory,passmark,score,semester,title,student_id,certcode,'
     652            'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
    653653            'display_fullname\r\n'
    654             '1,1,CRS1,100,DEP1,FAC1,100,2012,0,100,,2,Course 1,A111111,CERT1,'
     654            '1,1,CRS1,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
    655655            'Anna M. Tester\r\n'
    656656            )
     
    666666            result,
    667667            'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
    668             'mandatory,passmark,score,semester,title,student_id,certcode,'
     668            'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
    669669            'display_fullname\r\n'
    670             '1,1,CRS1,100,DEP1,FAC1,100,2012,0,100,,2,Course 1,A111111,CERT1,'
     670            '1,1,CRS1,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
    671671            'Anna M. Tester\r\n'
    672672            )
     
    686686            result,
    687687            'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
    688             'mandatory,passmark,score,semester,title,student_id,certcode,'
     688            'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
    689689            'display_fullname\r\n'
    690             '1,1,CRS1,100,DEP1,FAC1,100,2012,0,100,,2,Course 1,A111111,CERT1,'
     690            '1,1,CRS1,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
    691691            'Anna M. Tester\r\n'
    692692            )
     
    700700            result,
    701701            'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
    702             'mandatory,passmark,score,semester,title,student_id,certcode,'
     702            'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
    703703            'display_fullname\r\n'
    704             '1,1,CRS1,100,DEP1,FAC1,100,2012,0,100,,2,Course 1,A111111,CERT1,'
     704            '1,1,CRS1,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
    705705            'Anna M. Tester\r\n'
    706706            )
     
    711711            result,
    712712            'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
    713             'mandatory,passmark,score,semester,title,student_id,certcode,'
     713            'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
    714714            'display_fullname\r\n'
    715715            )
     
    724724            result,
    725725            'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
    726             'mandatory,passmark,score,semester,title,student_id,certcode,'
     726            'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
    727727            'display_fullname\r\n'
    728             '1,1,CRS1,100,DEP1,FAC1,110,2012,0,100,,2,Course 1,A111111,CERT1,'
     728            '1,1,CRS1,100,DEP1,FAC1,110,2012,0,0,100,,2,Course 1,A111111,CERT1,'
    729729            'Anna M. Tester\r\n'
    730730            )
Note: See TracChangeset for help on using the changeset viewer.