Ignore:
Timestamp:
3 Feb 2009, 08:12:10 (16 years ago)
Author:
Henrik Bettermann
Message:

resolve 2 and 3 of ticket Schools #7

File:
1 edited

Legend:

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

    r3820 r3902  
    9797
    9898complete1 = 0
     99score_calc_average_1 = 0
    99100for r in normal1:
    100    if r['grade'] and r['atl']:
    101        complete1 += 1
     101    if r['grade'] and r['atl']:
     102        complete1 += 1
     103        score_calc_average_1 += r['score_calc']
    102104if len(normal1) == complete1:
    103105    complete1 =  True
    104106else:
    105107    complete1 = False
     108if len(normal1):
     109    score_calc_average_1 /= len(normal1)   
    106110info['complete1'] = complete1     
     111info['score_calc_average_1'] = score_calc_average_1 
    107112
    108113complete2 = 0
     114score_calc_average_2 = 0
    109115for r in normal1:
    110    if r['grade'] and r['atl']:
    111        complete2 += 1
     116    if r['grade'] and r['atl']:
     117        score_calc_average_2 += r['score_calc']
     118        complete2 += 1
    112119if len(normal2) == complete2:
    113120    complete2 =  True
    114121else:
    115122    complete2 = False
     123if len(normal2):
     124    score_calc_average_2 /= len(normal2)
    116125info['complete2'] = complete2
     126info['score_calc_average_2'] = score_calc_average_2 
    117127
    118128complete3 = 0
     129score_calc_average_3 = 0
    119130for r in normal1:
    120    if r['grade'] and r['atl']:
    121        complete3 += 1
     131    if r['grade'] and r['atl']:
     132        complete3 += 1
     133        score_calc_average_3 += r['score_calc']
    122134if len(normal3) == complete3:
    123135    complete3 =  True
    124136else:
    125137    complete3 = False
     138if len(normal3):
     139    score_calc_average_3 /= len(normal3)   
    126140info['complete3'] = complete3
     141info['score_calc_average_3'] = score_calc_average_3 
    127142
    128143
Note: See TracChangeset for help on using the changeset viewer.