开课学生详细得分情况

beetlsql3-dev
Mlxa0324 2 years ago
parent 62a3c6dfef
commit f967688ec4

@ -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<TeacherOpenC
PageQuery<TeacherOpenCourseQuestionLog> studentScoreList(PageQuery query);
/**
*
* @param query
* @return
*/
PageQuery<TeacherOpenCourseQuestionLog> studentScoreDetailsList(PageQuery query);
/**
* ID
* @param settingIds
@ -45,4 +53,11 @@ public interface TeacherOpenCourseQuestionLogDao extends BaseMapper<TeacherOpenC
@Update
void deleteBySettingIds(String settingIds);
/**
*
*
* @param query
* @return
*/
PageQuery<TeacherOpenCourseQuestionLogScoreDetailsInfo> getQuestionLogScoreDetailsInfo(PageQuery query);
}

@ -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)

@ -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;
}

@ -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<Teacher
updateBatchTemplate(logSet);
}
/**
*
*
*
* @param query
* @return
*/
public PageQuery<TeacherOpenCourseQuestionLogScoreDetailsInfo> getQuestionLogScoreDetailsInfo(PageQuery query) {
return teacherOpenCourseQuestionLogDao.getQuestionLogScoreDetailsInfo(query);
}
}

@ -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

@ -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;
}

@ -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

Loading…
Cancel
Save