add total_bixiu_credit * grade

This commit is contained in:
lijingwei233 2020-02-25 16:16:07 +08:00
parent 1fea048620
commit a1780a1756

@ -92,6 +92,10 @@ def getGrade(Ip, S):
last_lesson_name = ''
#flag,将是否通过延后一个循环
flag = True
#总必修学分
total_bixiu_credit = 0;
#总必修学分绩点
total_bixiu_c_x_g = 0;
#遍历课程
for item in split:
if not item['YXCJ']:
@ -104,6 +108,9 @@ def getGrade(Ip, S):
last_lesson_kill += 1
#贡献总学分绩点
last_term_c_x_g += item['XF'] * (item['YXCJ'] - 50) / 10
if item['KCXZ'] == '必修':
total_bixiu_c_x_g += item['XF'] * (item['YXCJ'] - 50) / 10
total_bixiu_credit += item['XF']
else:#如果不重名
if flag:#将else中的判断延后一个循环
flag = False
@ -140,6 +147,9 @@ def getGrade(Ip, S):
last_term_c_x_g = item['XF'] * (item['YXCJ'] - 50) / 10
#贡献通过次数
last_lesson_kill += 1
if item['KCXZ'] == '必修':
total_bixiu_c_x_g += item['XF'] * (item['YXCJ'] - 50) / 10
total_bixiu_credit += item['XF']
else:
last_term_c_x_g = 0
else:#如果是当前学期
@ -151,6 +161,9 @@ def getGrade(Ip, S):
last_lesson_kill += 1
#贡献学分绩点
last_term_c_x_g += item['XF'] * (item['YXCJ'] - 50) / 10
if item['KCXZ'] == '必修':
total_bixiu_c_x_g += item['XF'] * (item['YXCJ'] - 50) / 10
total_bixiu_credit += item['XF']
#加入学期成绩列表
last_term_grade_list.append({
'title': item['LessonInfo']['KCMC'],
@ -172,6 +185,7 @@ def getGrade(Ip, S):
'term_credit': last_term_credit,
'term_grade': last_term_grade_list
})
GradeStatistics['total_bixiu_GPA'] = total_bixiu_c_x_g / total_bixiu_credit;
#合并数据
data_cache = {
'total': GradeStatistics,