diff --git a/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseQuestionLogDao.java b/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseQuestionLogDao.java index e131914c..dcc39f88 100644 --- a/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseQuestionLogDao.java +++ b/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseQuestionLogDao.java @@ -1,6 +1,7 @@ package com.ibeetl.jlw.dao; import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionLog; +import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionLogScoreDetailsInfo; import com.ibeetl.jlw.web.query.TeacherOpenCourseQuestionLogQuery; import org.beetl.sql.core.engine.PageQuery; import org.beetl.sql.mapper.BaseMapper; @@ -31,6 +32,13 @@ public interface TeacherOpenCourseQuestionLogDao extends BaseMapper studentScoreList(PageQuery query); + /** + * 学生做题得分详情明细 + * @param query + * @return + */ + PageQuery studentScoreDetailsList(PageQuery query); + /** * 根据题目配置ID逻辑删除 * @param settingIds @@ -45,4 +53,11 @@ public interface TeacherOpenCourseQuestionLogDao extends BaseMapper getQuestionLogScoreDetailsInfo(PageQuery query); } diff --git a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionLog.java b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionLog.java index 604d66ad..8d8e85fe 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionLog.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionLog.java @@ -22,7 +22,7 @@ import java.util.Date; @Data @EqualsAndHashCode(callSuper=false) @Fetch -public class TeacherOpenCourseQuestionLog extends BaseEntity{ +public class TeacherOpenCourseQuestionLog extends BaseEntity { //学生做题日志ID @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class) diff --git a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionLogScoreDetailsInfo.java b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionLogScoreDetailsInfo.java new file mode 100644 index 00000000..d203b04c --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionLogScoreDetailsInfo.java @@ -0,0 +1,64 @@ +package com.ibeetl.jlw.entity; + +import com.ibeetl.admin.core.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 题目日志 详细得分信息 + * @author lx + */ +@Data +@EqualsAndHashCode(callSuper=false) +public class TeacherOpenCourseQuestionLogScoreDetailsInfo extends BaseEntity { + + /** + * 学生ID + */ + private Long studentId ; + /** + * 学生姓名 + */ + private String studentName ; + /** + * 学生编号 + */ + private String studentSn ; + /** + * 班级ID + */ + private Long classId; + /** + * 班级名称 + */ + private Long className; + /** + * 题目总数 + */ + private Long questionCount; + /** + * 完成数量 + */ + private Long finishCount; + /** + * 正确数量 + */ + private Long successCount; + /** + * 错误数量 + */ + private Long errorCount; + /** + * 正确率(最大100) + */ + private Float successRate; + /** + * 学生得分 + */ + private Float studentScore; + /** + * 完成进度 + */ + private Float finishProgress; + +} diff --git a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseQuestionLogService.java b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseQuestionLogService.java index 9047aecf..a773a01d 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseQuestionLogService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseQuestionLogService.java @@ -16,10 +16,7 @@ import com.ibeetl.admin.core.web.JsonReturnCode; import com.ibeetl.jlw.dao.ResourcesQuestionSnapshotDao; import com.ibeetl.jlw.dao.StudentDao; import com.ibeetl.jlw.dao.TeacherOpenCourseQuestionLogDao; -import com.ibeetl.jlw.entity.ResourcesQuestionSnapshot; -import com.ibeetl.jlw.entity.Student; -import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionLog; -import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionSetting; +import com.ibeetl.jlw.entity.*; import com.ibeetl.jlw.web.query.TeacherOpenCourseQuestionLogQuery; import com.ibeetl.jlw.web.query.TeacherOpenCourseQuestionSettingQuery; import lombok.extern.slf4j.Slf4j; @@ -539,4 +536,16 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService getQuestionLogScoreDetailsInfo(PageQuery query) { + return teacherOpenCourseQuestionLogDao.getQuestionLogScoreDetailsInfo(query); + } + } diff --git a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseQuestionLogController.java b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseQuestionLogController.java index 9d8bb2e2..19ba2827 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseQuestionLogController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseQuestionLogController.java @@ -15,6 +15,7 @@ import com.ibeetl.jlw.entity.Student; import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionLog; import com.ibeetl.jlw.service.TeacherOpenCourseQuestionLogService; import com.ibeetl.jlw.web.query.TeacherOpenCourseQuestionLogQuery; +import com.ibeetl.jlw.web.query.TeacherOpenCourseQuestionLogScoreDetailsInfoQuery; import lombok.SneakyThrows; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -228,6 +229,18 @@ public class TeacherOpenCourseQuestionLogController { return JsonResult.success(); } + + /** + * 查询分数详细信息 + * @param query 题目分数查询实体 + * @return + */ + @PostMapping(API + "/scoreDetailInfo.do") + public JsonResult scoreDetailInfo(TeacherOpenCourseQuestionLogScoreDetailsInfoQuery query) { + teacherOpenCourseQuestionLogService.getQuestionLogScoreDetailsInfo(query.getPageQuery()); + return JsonResult.success(); + } + /** * 查询错题集(错题库) * @return diff --git a/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseQuestionLogScoreDetailsInfoQuery.java b/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseQuestionLogScoreDetailsInfoQuery.java new file mode 100644 index 00000000..249f0990 --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseQuestionLogScoreDetailsInfoQuery.java @@ -0,0 +1,38 @@ +package com.ibeetl.jlw.web.query; + +import com.ibeetl.admin.core.web.query.PageParam; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import javax.validation.constraints.NotNull; + +/** + * 题目日志 详细得分信息 查询实体 + * @author lx + */ +@Data +@EqualsAndHashCode(callSuper=false) +public class TeacherOpenCourseQuestionLogScoreDetailsInfoQuery extends PageParam { + + /** + * 学号或姓名 + */ + private String studentOrName; + + /** + * 班级id + */ + private Long classId; + + /** + * 开课课程ID + */ + private Long teacherOpenCourseMergeCourseInfoId; + + /** + * 开课题目配置ID + */ + @NotNull(message = "ID不能为空") + private Long teacherOpenCourseQuestionSettingId; + +} diff --git a/web/src/main/resources/sql/jlw/teacherOpenCourseQuestionLog.md b/web/src/main/resources/sql/jlw/teacherOpenCourseQuestionLog.md index 39d93e7b..42c1cba7 100644 --- a/web/src/main/resources/sql/jlw/teacherOpenCourseQuestionLog.md +++ b/web/src/main/resources/sql/jlw/teacherOpenCourseQuestionLog.md @@ -683,4 +683,43 @@ getValuesByQueryNotWithPermission @} +getQuestionLogScoreDetailsInfo +=== +* 查询学生详细得分信息,查询分数详细信息 + select + t.student_id, + ta.student_name, + ta.student_sn, + ta.class_id, + tb.class_name, + count(distinct(t.resources_question_snapshot_id)) as question_count, + sum(case when t.teacher_open_course_question_log_update_time is not null then 1 else 0 end) as finish_count, + sum(case when t.teacher_open_course_question_log_update_time is not null and t.question_score = t.student_score then 1 else 0 end) as success_count, + sum(case when t.teacher_open_course_question_log_update_time is not null and t.question_score <> t.student_score then 1 else 0 end) as error_count, + sum(case when t.teacher_open_course_question_log_update_time is not null and t.question_score = t.student_score then 1 else 0 end) / IF(count(distinct(t.resources_question_snapshot_id)) = 0, 1, count(distinct(t.resources_question_snapshot_id))) * 100 as success_rate, + sum(case when t.teacher_open_course_question_log_update_time is not null and t.question_score = t.student_score then t.question_score else ifnull(t.student_score, 0) end) as student_score, + sum(case when t.teacher_open_course_question_log_update_time is not null then 1 else 0 end) / IF(count(distinct(t.resources_question_snapshot_id)) = 0, 1, count(distinct(t.resources_question_snapshot_id))) finish_progress + from + teacher_open_course_question_log t + left join resources_question_snapshot tc on tc.resources_question_snapshot_id = t.resources_question_snapshot_id + left join student ta on ta.student_id = t.student_id and ta.student_status = 1 + left join school_class tb on tb.class_id = ta.class_id and tb.class_status = 1 + where + 1 = 1 + and t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# + @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ + and tc.teacher_open_course_merge_course_info_id = #teacherOpenCourseMergeCourseInfoId# + @} + @if(!isEmpty(studentOrName)){ + and (ta.student_name like #'%'+studentOrName+'%'# or ta.student_sn like #'%'+studentOrName+'%'#) + @} + @if(!isEmpty(classId)){ + and ta.class_id =#classId# + @} + GROUP BY + t.student_id, + ta.student_name, + ta.student_sn, + ta.class_id, + tb.class_name