def __init__(self, gradation, exam_id, base_student): self.gradation = gradation # self.gradation = Gradation() self.exam_id = exam_id self.exam_nick = self.get_exam_nick() self.base_student = base_student self.school_table = table_config.get_school_sum_table(table_config.QA_CODE) if base_student == Exam.SPECIAL: self.class_table = table_config.get_class_sum_table(table_config.QA_ZK_CODE) elif base_student == Exam.CURRENT: self.class_table = table_config.get_class_sum_table(table_config.QA_CODE) self.school_ids = self.get_school_ids() self.school_names = self.get_school_names() self.school_types = self.get_school_types() self.class_ids = self.get_class_ids() self.class_names = self.get_class_names() self.exam_ids = [] self.exam_nicks = [] self.exam_diff_ids = [] self.exam_diff_names = [] self.exam_subject_dimen_description = [] self.exam_diff_subject_dimen_desctiption = [] for subject_id in gradation.subject_ids: self.exam_ids.append(self.get_exam_ids(subject_id)) self.exam_nicks.append(self.get_exam_nicks(subject_id)) self.exam_diff_ids.append(self.get_exam_diff_ids(subject_id)) self.exam_diff_names.append(self.get_exam_diff_names(subject_id)) self.exam_subject_dimen_description.append( qam_dao.get_dimen_description_by_exam(self.exam_id, subject_id)) self.exam_diff_subject_dimen_desctiption.append( qam_dao.get_dimen_description_by_exams(self.get_exam_ids(subject_id), subject_id)) self.distribution_ids = [] self.distribution_names = [] self.subject_distribution_type = [] distribution = Distribution(self.exam_nick, "总分") self.count = distribution.get_count() self.subject_totals = [] total = Total(self.exam_nick, "总分") self.subject_totals.append(total.get_total()) self.subject_distribution_type.append(distribution.get_distributions()[0]) self.distribution_ids.append(distribution.get_ids()) self.distribution_names.append(distribution.get_names()) for subject_name in gradation.subject_names: distribution.subject_name = subject_name self.distribution_ids.append(distribution.get_ids()) self.subject_distribution_type.append(distribution.get_distributions()[0]) self.distribution_names.append(distribution.get_names()) self.subject_totals.append(total.get_total())
def __init__(self, value): self.value = value # self.value = Value() self.exam = value.exam self.gradation = value.gradation self.base_student = self.exam.base_student self.exam_subject_dimen_description = [] self.exam_diff_subject_dimen_desctiption = [] for subject_id in value.gradation.subject_ids: self.exam_subject_dimen_description.append( qam_dao.get_dimen_description_by_exam(self.exam.exam_id, subject_id)) self.exam_diff_subject_dimen_desctiption.append( qam_dao.get_dimen_description_by_exams(self.exam.get_exam_ids(subject_id), subject_id))
def school_dimen_ratio_table(subject_id, index): subject_where.set_value(subject_id) dimen_description = qam_dao.get_dimen_description_by_exam(exam_where, subject_where) dimen_length = len(dimen_description) dimen_avg_item = item_config.DIMEN_RATIO_ITEMS[0:dimen_length] if base_student == report_config.SPECIAL: table_code = table_config.QA_ZK elif base_student == report_config.CURRENT: table_code = table_config.QA district_rows = get_district_subject_rows(dimen_avg_item, table_code, subject_id) school_rows = get_school_subject_rows(dimen_avg_item, table_code, subject_id) result = [district_rows[0], district_rows[district_ids.index(school_types[index])], school_rows[index]] dimen_description.insert(0, "学校") result.insert(0, dimen_description) return result
def district_dimen_avg_table(base_student, subject_id): subject_where.set_value(subject_id) dimen_description = qam_dao.get_dimen_description_by_exam(exam_where, subject_where) dimen_length = len(dimen_description) dimen_avg_item = item_config.DIMEN_AVG_ITEMS[0:dimen_length] if base_student == report_config.SPECIAL: table_code = table_config.QA_ZK elif base_student == report_config.CURRENT: table_code = table_config.QA district_rows = get_district_subject_rows(dimen_avg_item, table_code, subject_id) school_rows = get_school_subject_rows(dimen_avg_item, table_code, subject_id) result = district_rows + school_rows dimen_description.insert(0, "学校") result.insert(0, dimen_description) return result
def school_exam_dimen_avg_table(subject_id, index): subject_where.set_value(subject_id) dimen_description = qam_dao.get_dimen_description_by_exam(exam_where, subject_where) dimen_length = len(dimen_description) dimen_item = item_config.DIMEN_AVG_ITEMS[0:dimen_length] if base_student == report_config.SPECIAL: table_code = table_config.QA_ZK elif base_student == report_config.CURRENT: table_code = table_config.QA school_values = get_exam_subject_values(dimen_item, table_code, school_ids[index], subject_id) start, end = qam_dao.get_subject_exam_start_end(exam, subject_id) exam_nicks = all_exam_nicks[start:end + 1] result = list_util.combine_values_by_col(exam_nicks, school_values) dimen_description.insert(0, "知识块(平均分)") result.insert(0, dimen_description) return result
def class_dimen_ratio_table(school_id, class_id, subject_id): subject_where.set_value(subject_id) dimen_description = qam_dao.get_dimen_description_by_exam(exam_where, subject_where) dimen_length = len(dimen_description) dimen_item = item_config.DIMEN_RATIO_ITEMS[0:dimen_length] if base_student == report_config.SPECIAL: table_code = table_config.QA_ZK elif base_student == report_config.CURRENT: table_code = table_config.QA district_rows = get_district_subject_items_rows(dimen_item, table_code, subject_id) school_rows = get_school_subject_items_rows(dimen_item, table_code, subject_id) class_values = get_class_subject_items_values(dimen_item, table_code, subject_id) class_row = ['班级'] + class_values[get_class_index(school_id, class_id)] school_row = school_rows[get_school_index(school_id)] district_row = district_rows[0] result = [class_row, school_row, district_row] dimen_description.insert(0, "知识块(类别)") result.insert(0, dimen_description) return result