Changeset 4036 for WAeUP_SRP/trunk
- Timestamp:
- 1 Apr 2009, 08:40:55 (16 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/WAeUPTables.py
r3989 r4036 1668 1668 ###) 1669 1669 1670 def getYearGroupAverage(self,session_id,level_id): ###( 1671 query = Eq('session_id',session_id) & Eq('level_id',level_id) 1672 course_results = self.course_results.evalAdvancedQuery(query) 1673 yga1 = 0 1674 counter1 = 0 1675 yga2 = 0 1676 counter2 = 0 1677 yga3 = 0 1678 counter3 = 0 1679 #import pdb;pdb.set_trace() 1680 for brain in course_results: 1681 try: 1682 if not float(brain.ca1) + float(brain.ca2) + float(brain.exam) > 0: 1683 continue 1684 code = brain.code 1685 res = self.courses_catalog.evalAdvancedQuery(Eq('code',code)) 1686 if res: 1687 course = res[0] 1688 # The courses_catalog contains strings and integers in its semester field. 1689 # Maybe this can be fixed by reindexing the catalog. The schema of course says 'CPS Int Field'. 1690 semester = str(course.semester) 1691 else: 1692 semester = '' 1693 if semester == '1': 1694 counter1 += 1 1695 yga1 += float(brain.ca1) + float(brain.ca2) + float(brain.exam) 1696 elif semester == '2': 1697 counter2 += 1 1698 yga2 += float(brain.ca1) + float(brain.ca2) + float(brain.exam) 1699 if semester == '3': 1700 counter3 += 1 1701 yga3 += float(brain.ca1) + float(brain.ca2) + float(brain.exam) 1702 except: 1703 continue 1704 if counter1: 1705 yga1 /= counter1 1706 yga1 = '%.2f' % yga1 1707 if counter2: 1708 yga2 /= counter2 1709 yga2 = '%.2f' % yga2 1710 if counter3: 1711 yga3 /= counter3 1712 yga3 = '%.2f' % yga3 1713 return yga1, yga2, yga3, counter1, counter2, counter3 1714 ###) 1715 1670 1716 def exportRemoveAllCourses(self,student_id,export=False,remove=False): ###( 1671 1717 "" -
WAeUP_SRP/trunk/skins/waeup_ois/academic_report_slip.pt
r4035 r4036 12 12 term_complete info/complete1; 13 13 term options/term; 14 sem_series python:(('Term One','normal1','complete1','score_calc_average_1' ),('Term Two','normal2','complete2','score_calc_average_2'),('Term Three','normal3','complete3','score_calc_average_3'));14 sem_series python:(('Term One','normal1','complete1','score_calc_average_1','yga1','counter1'),('Term Two','normal2','complete2','score_calc_average_2','yga2','counter2'),('Term Three','normal3','complete3','score_calc_average_3','yga3','counter3')); 15 15 sem python:sem_series[int(term)-1]; 16 16 "> … … 32 32 <td>Student's Average:</td><td tal:content="python:info[sem[3]]"></td> 33 33 </tr> 34 <tr> 35 <td>Year Group Average:</td><td> <span tal:content="python:info[sem[4]]" /> (<span tal:content="python:info[sem[5]]" /> students)</td> 36 </tr> 34 37 </table> 35 38 <br /> <br /> -
WAeUP_SRP/trunk/skins/waeup_ois/getStudyLevelInfo.py
r4035 r4036 141 141 info['score_calc_average_3'] = '%.2f' % score_calc_average_3 142 142 143 session_id = level_doc.session 144 yga1,yga2,yga3,counter1,counter2,counter3 = course_results.getYearGroupAverage(session_id,level_id) 145 info['yga1'] = yga1 146 info['yga2'] = yga2 147 info['yga3'] = yga3 148 info['counter1'] = counter1 149 info['counter2'] = counter2 150 info['counter3'] = counter3 143 151 144 152 #end customization
Note: See TracChangeset for help on using the changeset viewer.