Ignore:
Timestamp:
26 Aug 2008, 07:18:47 (17 years ago)
Author:
Henrik Bettermann
Message:

implement cgpa and cascore

Location:
WAeUP_SRP/unilorin/waeup_custom
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/unilorin/waeup_custom/getStudyLevelInfo.py

    r3476 r3628  
    8585
    8686max_credits = 58
    87 info['without_score'] = without_score = False
    88 
     87info['without_score'] = False
     88info['without_cascore'] = False
    8989
    9090
  • WAeUP_SRP/unilorin/waeup_custom/getTranscriptInfo.py

    r3620 r3628  
    5454
    5555year_counter = 0
     56cgpa = 0
     57c_total_credits = 0
    5658for year in year_courses:
    5759    gpa = 0
     
    6163            gpa += int(course['weight']) * int(course['credits'])
    6264            total_credits += int(course['credits'])
     65    cgpa += gpa
     66    c_total_credits += total_credits
    6367    if gpa and total_credits:
    6468        year_details[year_counter]['total_credits'] = total_credits
     
    6670    else:
    6771        year_details[year_counter]['total_credits'] = 0
    68         year_details[year_counter]['gpa'] = 0   
     72        year_details[year_counter]['gpa'] = 0
     73
     74    if cgpa and c_total_credits:
     75        year_details[year_counter]['c_total_credits'] = c_total_credits
     76        year_details[year_counter]['cgpa'] = "%4.2f" % (float(cgpa)/int(c_total_credits))
     77    else:
     78        year_details[year_counter]['c_total_credits'] = 0
     79        year_details[year_counter]['cgpa'] = 0
     80
    6981    year.sort(cmp=lambda x,y: cmp("%(semester)s%(code)s" % x,
    7082                                         "%(semester)s%(code)s" % y))
  • WAeUP_SRP/unilorin/waeup_custom/transcript_view.pt

    r3620 r3628  
    7373        <table>
    7474          <tr tal:condition="details/total_credits" >
    75             <th>Total Credits:</th>
     75            <th width='200pt'>Total Credits:</th>
    7676            <td tal:content="details/total_credits" />
    7777          </tr>
     
    8080            <td><span tal:content="details/gpa" /></td>
    8181          </tr>
     82          <tr>
     83            <th>Cumulative Total Credits:</th>
     84            <td tal:content="details/c_total_credits" />
     85          </tr>
     86          <tr tal:condition="details/cgpa">
     87            <th>CGPA:</th>
     88            <td><span tal:content="details/cgpa" /></td>
     89          </tr>         
    8290        </table>     
    8391
Note: See TracChangeset for help on using the changeset viewer.