modify k/d error
This commit is contained in:
parent
64e03210cc
commit
e63d046626
@ -67,6 +67,7 @@ def getGrade(Ip, S):
|
||||
last_term_total_c_x_g = 0#sum(学分*绩点)
|
||||
last_term_GPA = 0
|
||||
last_lesson_name = ''
|
||||
last_lesson_kill = 0
|
||||
for item in data['data']['GradeList']:
|
||||
#如果学期改变
|
||||
if last_term != item['KSXNXQ']:
|
||||
@ -101,18 +102,20 @@ def getGrade(Ip, S):
|
||||
)
|
||||
if item['LessonInfo']['KCMC'] == last_lesson_name:
|
||||
if item['YXCJ'] >= 60:
|
||||
last_term_dead -= 1
|
||||
last_term_kill += 1
|
||||
last_lesson_kill += 1
|
||||
last_term_total_credit += item['XF']
|
||||
grade = (item['YXCJ'] - (item['YXCJ'] % 10) - 50) // 10
|
||||
grade += 0.5 if (item['YXCJ'] % 10 >= 5) else 0
|
||||
last_term_total_c_x_g += item['XF'] * grade
|
||||
else:
|
||||
last_lesson_name = item['YXCJ']
|
||||
if item['YXCJ'] < 60:
|
||||
last_term_dead += 1
|
||||
else:
|
||||
if last_lesson_kill > 0:
|
||||
last_term_kill += 1
|
||||
else:
|
||||
last_term_dead += 1
|
||||
last_lesson_kill = 0
|
||||
last_lesson_name = item['LessonInfo']['KCMC']
|
||||
if item['YXCJ'] >= 60:
|
||||
last_lesson_kill += 1
|
||||
last_term_total_credit += item['XF']
|
||||
grade = (item['YXCJ'] - (item['YXCJ'] % 10) - 50) // 10
|
||||
grade += 0.5 if (item['YXCJ'] % 10 >= 5) else 0
|
||||
@ -206,5 +209,5 @@ def getCurrentTime(Ip, S):
|
||||
data_cache = data['data'].pop('DateList')
|
||||
return {'errcode': 200, 'errmsg': 'ok', 'data': data_cache}
|
||||
|
||||
data = connection('2018002129','cust5313.')
|
||||
print(getGrade(data['ip'],data['s'])['data'])
|
||||
data = connection('2017002372','623910ert&')
|
||||
print(getGrade(data['ip'],data['s'])['data'])
|
Loading…
x
Reference in New Issue
Block a user