Changeset 5415


Ignore:
Timestamp:
10 Aug 2010, 11:54:40 (14 years ago)
Author:
Henrik Bettermann
Message:

Ignore terms with no results when calculating student's year average (score_calc_average_cum) (see schools #17).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_ois/getStudyLevelInfo.py

    r4487 r5415  
    144144info['score_calc_average_3'] =  '%.2f' % score_calc_average_3 
    145145
    146 score_calc_average_cum = (score_calc_average_1 + score_calc_average_2 + score_calc_average_3)/3
     146terms_completed = bool(score_calc_average_1) + bool(score_calc_average_2) + bool(score_calc_average_3)
     147
     148if terms_completed:
     149    score_calc_average_cum = (score_calc_average_1 + score_calc_average_2 + score_calc_average_3)/terms_completed
     150else:
     151    score_calc_average_cum = 0
    147152
    148153info['score_calc_average_cum'] = '%.2f' % score_calc_average_cum
Note: See TracChangeset for help on using the changeset viewer.