|
|
|
@ -44,8 +44,12 @@ public class TeacherOpenCourseQuestionLogScoreInfo extends BaseEntity {
|
|
|
|
|
|
|
|
|
|
// 题目总数量
|
|
|
|
|
|
|
|
|
|
@FetchSql("select count(1) from resources_question_snapshot t " +
|
|
|
|
|
"where t.question_status = 1 " +
|
|
|
|
|
@FetchSql("select count(1) from teacher_open_course_question_log t " +
|
|
|
|
|
"where 1 = 1 " +
|
|
|
|
|
"and t.teacher_open_course_question_log_status = 1 \n" +
|
|
|
|
|
"@if(!isEmpty(studentId)) { \n" +
|
|
|
|
|
"and t.student_id = #studentId# \n" +
|
|
|
|
|
"@} \n" +
|
|
|
|
|
"and t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# "
|
|
|
|
|
)
|
|
|
|
|
private int questionTotalCount;
|
|
|
|
@ -53,51 +57,46 @@ public class TeacherOpenCourseQuestionLogScoreInfo extends BaseEntity {
|
|
|
|
|
// 答对数量
|
|
|
|
|
|
|
|
|
|
@FetchSql("select count(1) from teacher_open_course_question_log t " +
|
|
|
|
|
"left join resources_question_snapshot ta on ta.resources_question_snapshot_id = t.resources_question_snapshot_id " +
|
|
|
|
|
"where 1 = 1 " +
|
|
|
|
|
"and t.teacher_open_course_question_log_status = 1 \n" +
|
|
|
|
|
"and ta.question_status = 1 \n" +
|
|
|
|
|
"and t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" +
|
|
|
|
|
"@if(!isEmpty(studentId)) { \n" +
|
|
|
|
|
"and t.student_id = #studentId# \n" +
|
|
|
|
|
"@} \n" +
|
|
|
|
|
"and t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# " +
|
|
|
|
|
"and (CONCAT(t.teacher_open_course_question_log_answer, ',') = ta.question_answer or t.teacher_open_course_question_log_answer = ta.question_answer)"
|
|
|
|
|
"and t.teacher_open_course_question_log_answer = t.question_answer "
|
|
|
|
|
)
|
|
|
|
|
private int correctCount;
|
|
|
|
|
|
|
|
|
|
// 答错数量
|
|
|
|
|
@FetchSql("select count(1) from teacher_open_course_question_log t " +
|
|
|
|
|
"left join resources_question_snapshot ta on ta.resources_question_snapshot_id = t.resources_question_snapshot_id " +
|
|
|
|
|
"where t.teacher_open_course_question_log_status = 1 \n" +
|
|
|
|
|
"where t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" +
|
|
|
|
|
"@if(!isEmpty(studentId)) { \n" +
|
|
|
|
|
"and t.student_id = #studentId# \n" +
|
|
|
|
|
"@} \n" +
|
|
|
|
|
"and t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# " +
|
|
|
|
|
"and CONCAT(t.teacher_open_course_question_log_answer, ',') != ta.question_answer"
|
|
|
|
|
"and t.teacher_open_course_question_log_answer != t.question_answer "
|
|
|
|
|
)
|
|
|
|
|
private int wrongCount;
|
|
|
|
|
|
|
|
|
|
// 总得分
|
|
|
|
|
@FetchSql("select sum(IFNULL(ta.question_score, 0)) as total_score " +
|
|
|
|
|
@FetchSql("select sum(IFNULL(t.question_score, 0)) as total_score " +
|
|
|
|
|
"from teacher_open_course_question_log t " +
|
|
|
|
|
"left join resources_question_snapshot ta on ta.resources_question_snapshot_id = t.resources_question_snapshot_id " +
|
|
|
|
|
"where t.teacher_open_course_question_log_status = 1 \n" +
|
|
|
|
|
"where t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" +
|
|
|
|
|
"@if(!isEmpty(studentId)) { \n" +
|
|
|
|
|
"and t.student_id = #studentId# \n" +
|
|
|
|
|
"@} \n" +
|
|
|
|
|
"and t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# " +
|
|
|
|
|
"and CONCAT(t.teacher_open_course_question_log_answer, ',') != ta.question_answer"
|
|
|
|
|
"and t.teacher_open_course_question_log_answer = t.question_answer "
|
|
|
|
|
)
|
|
|
|
|
private float totalScore;
|
|
|
|
|
|
|
|
|
|
// 正确率 最大100
|
|
|
|
|
// 自动计算得到
|
|
|
|
|
private int correctRate;
|
|
|
|
|
private float correctRate;
|
|
|
|
|
|
|
|
|
|
@FetchSql(value = "SELECT t.* " +
|
|
|
|
|
"FROM teacher_open_course_question_log t " +
|
|
|
|
|
"LEFT JOIN resources_question_snapshot ta ON ta.resources_question_snapshot_id = t.resources_question_snapshot_id " +
|
|
|
|
|
"WHERE t.teacher_open_course_question_log_status = 1 \n" +
|
|
|
|
|
"WHERE t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" +
|
|
|
|
|
"@if(!isEmpty(studentId)) { \n" +
|
|
|
|
|
"and t.student_id = #studentId# \n" +
|
|
|
|
|
"@} \n" +
|
|
|
|
@ -132,8 +131,8 @@ public class TeacherOpenCourseQuestionLogScoreInfo extends BaseEntity {
|
|
|
|
|
// 计算正确率, 取小数点后2位数
|
|
|
|
|
// 计算规则:正确率 = 正确数量 / (正确数量 + 错误数量) * 100
|
|
|
|
|
this.setCorrectRate(NumberUtil
|
|
|
|
|
.round(NumberUtil.div(getCorrectCount(), sumTotalCount) * 100, 0)
|
|
|
|
|
.intValue());
|
|
|
|
|
.round(NumberUtil.div(getCorrectCount(), sumTotalCount) * 100, 2)
|
|
|
|
|
.floatValue());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|