Ignore:
Timestamp:
19 Nov 2012, 11:16:54 (12 years ago)
Author:
Henrik Bettermann
Message:

Calculate grade and weight from score and show on courseticketpage only if score attribute is set.

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

Legend:

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

    r9641 r9684  
    752752        self.browser.getLink("COURSE1").click()
    753753        self.browser.getLink("Manage").click()
    754         self.browser.getControl(name="form.score").value = '10'
     754        #self.browser.getControl(name="form.score").value = '10'
    755755        self.browser.getControl("Save").click()
    756756        self.assertTrue('Form has been saved' in self.browser.contents)
     757        # Grade and weight have been determined
     758        self.browser.open(self.studycourse_path + '/100/COURSE1')
     759        self.assertFalse('Grade' in self.browser.contents)
     760        self.assertFalse('Weight' in self.browser.contents)
     761        self.student['studycourse']['100']['COURSE1'].score = 55
     762        self.browser.open(self.studycourse_path + '/100/COURSE1')
     763        self.assertTrue('Grade' in self.browser.contents)
     764        self.assertTrue('Weight' in self.browser.contents)
     765        self.assertEqual(self.student['studycourse']['100']['COURSE1'].grade, 'C')
     766        self.assertEqual(self.student['studycourse']['100']['COURSE1'].weight, 3)
    757767        # Carry-over courses will be collected when next level is created
    758768        self.browser.open(self.student_path + '/studycourse/manage')
    759769        # Add next level
     770        self.student['studycourse']['100']['COURSE1'].score = 10
    760771        self.browser.getControl(name="addlevel").value = ['200']
    761772        self.browser.getControl(name="level_session").value = ['2005']
     
    764775        self.assertMatches(
    765776            '...: Study Level 200 (Year 2)...', self.browser.contents)
    766         # COURSE1 has score 0 and thus will become a carry-over course
     777        # If COURSE1 has score 10 it becomes a carry-over course
    767778        # in level 200
    768779        self.assertEqual(
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r9574 r9684  
    303303            'automatic,carry_over,code,credits,dcode,fcode,level,mandatory,'
    304304            'passmark,score,semester,title,student_id,certcode\r\n'
    305             '0,0,,,,,,0,,0,,,,\r\n'
     305            '0,0,,,,,,0,,,,,,\r\n'
    306306            )
    307307        return
     
    321321            'automatic,carry_over,code,credits,dcode,fcode,level,mandatory,'
    322322            'passmark,score,semester,title,student_id,certcode\r\n'
    323             '1,1,CRS1,100,DEP1,FAC1,100,0,100,0,2,Course 1,A111111,CERT1\r\n'
     323            '1,1,CRS1,100,DEP1,FAC1,100,0,100,,2,Course 1,A111111,CERT1\r\n'
    324324            )
    325325        return
     
    336336            'automatic,carry_over,code,credits,dcode,fcode,level,mandatory,'
    337337            'passmark,score,semester,title,student_id,certcode\r\n'
    338             '1,1,CRS1,100,DEP1,FAC1,100,0,100,0,2,Course 1,A111111,CERT1\r\n'
     338            '1,1,CRS1,100,DEP1,FAC1,100,0,100,,2,Course 1,A111111,CERT1\r\n'
    339339            )
    340340        return
     
    350350            'automatic,carry_over,code,credits,dcode,fcode,level,mandatory,'
    351351            'passmark,score,semester,title,student_id,certcode\r\n'
    352             '1,1,CRS1,100,DEP1,FAC1,100,0,100,0,2,Course 1,A111111,CERT1\r\n'
     352            '1,1,CRS1,100,DEP1,FAC1,100,0,100,,2,Course 1,A111111,CERT1\r\n'
    353353            )
    354354        return
Note: See TracChangeset for help on using the changeset viewer.