题目增加用时字段

beetlsql3-dev
Mlxa0324 2 years ago
parent c66c8e41ff
commit cd3d3291a3

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -365,6 +365,9 @@ ALTER TABLE resources_question_snapshot ADD COLUMN teacher_open_course_merge_res
ALTER TABLE teacher_open_course_question_log ADD COLUMN question_analysis varchar(1000) COMMENT '解析';
ALTER TABLE teacher_open_course_question_log ADD COLUMN is_tuck int(2) default 0 COMMENT '是否收藏夹';
ALTER TABLE teacher_open_course_question_log ADD COLUMN is_error_favorite int(2) default 0 COMMENT '是否错题库';
ALTER TABLE teacher_open_course_question_log ADD COLUMN teacher_open_course_question_log_create_time datetime COMMENT '创建时间';
ALTER TABLE teacher_open_course_question_log ADD COLUMN teacher_open_course_question_log_update_time datetime COMMENT '修改时间';
ALTER TABLE teacher_open_course_question_log ADD COLUMN teacher_open_course_question_log_finish_time int(10) default 1 COMMENT '总用时(分钟)';
-- 通用的题目配置
drop table if exists general_question_setting;
@ -438,6 +441,9 @@ CREATE TABLE `general_question_log` (
`question_analysis` varchar(1000) DEFAULT NULL COMMENT '解析',
`is_tuck` int(2) DEFAULT NULL COMMENT '是否收藏夹',
`is_error_favorite` int(2) DEFAULT NULL COMMENT '是否错题库',
`general_question_log_create_time` datetime COMMENT '创建时间',
`general_question_log_update_time` datetime COMMENT '修改时间',
`general_question_log_finish_time` int(10) default 1 COMMENT '总用时(分钟)',
`org_id` bigint(20) DEFAULT NULL COMMENT '组织ID',
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
PRIMARY KEY (`general_question_log_id`) USING BTREE

@ -115,6 +115,14 @@ public class GeneralQuestionLog extends BaseEntity{
//是否错题库
private Boolean isErrorFavorite ;
//修改时间
private Date generalQuestionLogUpdateTime ;
//用时(分钟)
private Long generalQuestionLogFinishTime ;
//组织ID

@ -118,6 +118,14 @@ public class TeacherOpenCourseQuestionLog extends BaseEntity{
private Boolean isErrorFavorite ;
//修改时间
private Date teacherOpenCourseQuestionLogUpdateTime ;
//用时(分钟)
private Long teacherOpenCourseQuestionLogFinishTime ;
//组织ID
private Long orgId ;

@ -218,6 +218,17 @@ public class TeacherOpenCourseQuestionSetting extends BaseEntity {
)
private String resourcesQuestionIdPlural;
/**
*
*/
@UpdateIgnore
@InsertIgnore
// 题目ID集合
@FetchSql("select max(ifnull(t.teacher_open_course_question_log_finish_time , 0)) from teacher_open_course_question_log t " +
"where t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# " +
"and t.teacher_open_course_question_log_status = 1 ")
private long finishTime;
public void setAvgSuccessCount(Integer avgSuccessCount) {
this.avgSuccessCount = avgSuccessCount;
tryToUpdateAvgSuccessRate();

@ -2,6 +2,7 @@ package com.ibeetl.jlw.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.ReUtil;
@ -42,6 +43,7 @@ import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import static cn.hutool.core.date.DateUnit.MINUTE;
import static cn.hutool.core.util.ArrayUtil.join;
import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue;
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUserId;
@ -533,6 +535,9 @@ public class GeneralQuestionLogService extends CoreBaseService<GeneralQuestionLo
List<GeneralQuestionLog> logList = generalQuestionLogDao.getValuesByQuery(questionLogQuery);
Assert.notEmpty(logList, "未查询到题目信息!");
// 当前时间
Date now = new Date();
// 处理答案和分数
logList.forEach(questionLog -> {
// 学生提交的答案
@ -544,6 +549,10 @@ public class GeneralQuestionLogService extends CoreBaseService<GeneralQuestionLo
// 计算该题目学生的得分情况
questionLog.setStudentScore(isCorrectAnswer ? questionLog.getQuestionScore() : BigDecimal.valueOf(0));
questionLog.setGeneralQuestionLogUpdateTime(now);
long finishTime = DateUtil.between(questionLog.getGeneralQuestionLogAddTime(), now, MINUTE);
questionLog.setGeneralQuestionLogFinishTime(finishTime);
});
// 学生做的题目的答案与日志关联

@ -2,6 +2,7 @@ package com.ibeetl.jlw.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.ReUtil;
@ -39,6 +40,7 @@ import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import static cn.hutool.core.date.DateUnit.MINUTE;
import static cn.hutool.core.util.ArrayUtil.join;
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUserId;
import static com.ibeetl.jlw.enums.ResourcesQuestionSnapshotFromTypeEnum.EXAM;
@ -337,6 +339,9 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
List<TeacherOpenCourseQuestionLog> logList = teacherOpenCourseQuestionLogDao.getValuesByQuery(questionLogQuery);
Assert.notEmpty(logList, "未查询到题目信息!");
// 当前时间
Date now = new Date();
// 处理答案和分数
logList.forEach(questionLog -> {
// 学生提交的答案
@ -348,6 +353,9 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
// 计算该题目学生的得分情况
questionLog.setStudentScore(isCorrectAnswer ? questionLog.getQuestionScore() : BigDecimal.valueOf(0));
questionLog.setTeacherOpenCourseQuestionLogUpdateTime(now);
long finishTime = DateUtil.between(questionLog.getTeacherOpenCourseQuestionLogAddTime(), now, MINUTE);
questionLog.setTeacherOpenCourseQuestionLogFinishTime(finishTime);
});
// 批量插入错题集错题库方法内部自带分数判断。内部方法更新log中的错题标记。

@ -70,6 +70,10 @@ public class GeneralQuestionLogQuery extends PageParam {
private Boolean isTuck;
@Query(name = "是否错题库", display = false)
private Boolean isErrorFavorite;
@Query(name = "修改时间", display = false)
private Date generalQuestionLogUpdateTime ;
@Query(name = "用时(分钟)", display = false)
private Long generalQuestionLogFinishTime ;
@Query(name = "组织ID", display = false)
private Long orgId;
@Query(name = "用户ID", display = false)
@ -112,6 +116,8 @@ public class GeneralQuestionLogQuery extends PageParam {
pojo.setQuestionAnalysis(this.getQuestionAnalysis());
pojo.setIsTuck(this.getIsTuck());
pojo.setIsErrorFavorite(this.getIsErrorFavorite());
pojo.setGeneralQuestionLogUpdateTime(this.getGeneralQuestionLogUpdateTime());
pojo.setGeneralQuestionLogFinishTime(this.getGeneralQuestionLogFinishTime());
pojo.setOrgId(this.getOrgId());
pojo.setUserId(this.getUserId());
return pojo;

@ -96,6 +96,14 @@ public class TeacherOpenCourseQuestionLogQuery extends PageParam {
private Boolean isErrorFavorite ;
//修改时间
private Date teacherOpenCourseQuestionLogUpdateTime ;
//用时(分钟)
private Long teacherOpenCourseQuestionLogFinishTime ;
private String teacherOpenCourseQuestionLogIdPlural;
private String teacherOpenCourseQuestionSettingIdPlural;
private String resourcesQuestionSnapshotIdPlural;
@ -134,7 +142,9 @@ public class TeacherOpenCourseQuestionLogQuery extends PageParam {
pojo.setQuestionAnswer(this.getQuestionAnswer());
pojo.setQuestionAnalysis(this.getQuestionAnalysis());
pojo.setIsTuck(this.getIsTuck());
pojo.setIsErrorFavorite(this.getIsErrorFavorite());
pojo.setTeacherOpenCourseQuestionLogUpdateTime(this.getTeacherOpenCourseQuestionLogUpdateTime());
pojo.setTeacherOpenCourseQuestionLogFinishTime(this.getTeacherOpenCourseQuestionLogFinishTime());
return pojo;
}

@ -94,6 +94,13 @@ queryByCondition
@if(!isEmpty(isTuck)){
and t.is_tuck =#isTuck#
@}
@if(!isEmpty(generalQuestionLogUpdateTime)){
and t.general_question_log_update_time =#generalQuestionLogUpdateTime#
@}
@if(!isEmpty(generalQuestionLogFinishTime)){
and t.general_question_log_finish_time =#generalQuestionLogFinishTime#
@}
@if(!isEmpty(isErrorFavorite)){
and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score)
@}
@ -205,6 +212,13 @@ queryByConditionQuery
@if(!isEmpty(isTuck)){
and t.is_tuck =#isTuck#
@}
@if(!isEmpty(generalQuestionLogUpdateTime)){
and t.general_question_log_update_time =#generalQuestionLogUpdateTime#
@}
@if(!isEmpty(generalQuestionLogFinishTime)){
and t.general_question_log_finish_time =#generalQuestionLogFinishTime#
@}
@if(!isEmpty(isErrorFavorite)){
and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score)
@}
@ -507,6 +521,13 @@ getGeneralQuestionLogValues
@if(!isEmpty(isTuck)){
and t.is_tuck =#isTuck#
@}
@if(!isEmpty(generalQuestionLogUpdateTime)){
and t.general_question_log_update_time =#generalQuestionLogUpdateTime#
@}
@if(!isEmpty(generalQuestionLogFinishTime)){
and t.general_question_log_finish_time =#generalQuestionLogFinishTime#
@}
@if(!isEmpty(isErrorFavorite)){
and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score)
@}
@ -610,6 +631,13 @@ getValuesByQuery
@if(!isEmpty(isTuck)){
and t.is_tuck =#isTuck#
@}
@if(!isEmpty(generalQuestionLogUpdateTime)){
and t.general_question_log_update_time =#generalQuestionLogUpdateTime#
@}
@if(!isEmpty(generalQuestionLogFinishTime)){
and t.general_question_log_finish_time =#generalQuestionLogFinishTime#
@}
@if(!isEmpty(isErrorFavorite)){
and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score)
@}
@ -719,6 +747,13 @@ getValuesByQueryNotWithPermission
@if(!isEmpty(isTuck)){
and t.is_tuck =#isTuck#
@}
@if(!isEmpty(generalQuestionLogUpdateTime)){
and t.general_question_log_update_time =#generalQuestionLogUpdateTime#
@}
@if(!isEmpty(generalQuestionLogFinishTime)){
and t.general_question_log_finish_time =#generalQuestionLogFinishTime#
@}
@if(!isEmpty(isErrorFavorite)){
and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score)
@}
@ -852,6 +887,13 @@ getExcelValues
@if(!isEmpty(isTuck)){
and t.is_tuck =#isTuck#
@}
@if(!isEmpty(generalQuestionLogUpdateTime)){
and t.general_question_log_update_time =#generalQuestionLogUpdateTime#
@}
@if(!isEmpty(generalQuestionLogFinishTime)){
and t.general_question_log_finish_time =#generalQuestionLogFinishTime#
@}
@if(!isEmpty(isErrorFavorite)){
and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score)
@}
@ -977,6 +1019,13 @@ getExcelValues
@if(!isEmpty(isTuck)){
and t.is_tuck =#isTuck#
@}
@if(!isEmpty(generalQuestionLogUpdateTime)){
and t.general_question_log_update_time =#generalQuestionLogUpdateTime#
@}
@if(!isEmpty(generalQuestionLogFinishTime)){
and t.general_question_log_finish_time =#generalQuestionLogFinishTime#
@}
@if(!isEmpty(isErrorFavorite)){
and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score)
@}
@ -1094,6 +1143,13 @@ studentScoreList
@if(!isEmpty(isTuck)){
and t.is_tuck =#isTuck#
@}
@if(!isEmpty(generalQuestionLogUpdateTime)){
and t.general_question_log_update_time =#generalQuestionLogUpdateTime#
@}
@if(!isEmpty(generalQuestionLogFinishTime)){
and t.general_question_log_finish_time =#generalQuestionLogFinishTime#
@}
@if(!isEmpty(isErrorFavorite)){
and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score)
@}

@ -87,6 +87,13 @@ queryByCondition
@if(!isEmpty(isTuck)){
and t.is_tuck =#isTuck#
@}
@if(!isEmpty(teacherOpenCourseQuestionLogUpdateTime)){
and t.teacher_open_course_question_log_update_time =#teacherOpenCourseQuestionLogUpdateTime#
@}
@if(!isEmpty(teacherOpenCourseQuestionLogFinishTime)){
and t.teacher_open_course_question_log_finish_time =#teacherOpenCourseQuestionLogFinishTime#
@}
@if(!isEmpty(isErrorFavorite)){
and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score)
@}
@ -191,6 +198,13 @@ queryByConditionQuery
@if(!isEmpty(isTuck)){
and t.is_tuck =#isTuck#
@}
@if(!isEmpty(teacherOpenCourseQuestionLogUpdateTime)){
and t.teacher_open_course_question_log_update_time =#teacherOpenCourseQuestionLogUpdateTime#
@}
@if(!isEmpty(teacherOpenCourseQuestionLogFinishTime)){
and t.teacher_open_course_question_log_finish_time =#teacherOpenCourseQuestionLogFinishTime#
@}
@if(!isEmpty(isErrorFavorite)){
and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score)
@}
@ -303,6 +317,13 @@ studentScoreList
@if(!isEmpty(isTuck)){
and t.is_tuck =#isTuck#
@}
@if(!isEmpty(teacherOpenCourseQuestionLogUpdateTime)){
and t.teacher_open_course_question_log_update_time =#teacherOpenCourseQuestionLogUpdateTime#
@}
@if(!isEmpty(teacherOpenCourseQuestionLogFinishTime)){
and t.teacher_open_course_question_log_finish_time =#teacherOpenCourseQuestionLogFinishTime#
@}
@if(!isEmpty(isErrorFavorite)){
and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score)
@}
@ -490,6 +511,13 @@ getTeacherOpenCourseQuestionLogValues
@if(!isEmpty(isTuck)){
and t.is_tuck =#isTuck#
@}
@if(!isEmpty(teacherOpenCourseQuestionLogUpdateTime)){
and t.teacher_open_course_question_log_update_time =#teacherOpenCourseQuestionLogUpdateTime#
@}
@if(!isEmpty(teacherOpenCourseQuestionLogFinishTime)){
and t.teacher_open_course_question_log_finish_time =#teacherOpenCourseQuestionLogFinishTime#
@}
@if(!isEmpty(isErrorFavorite)){
and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score)
@}
@ -554,6 +582,13 @@ getValuesByQuery
@if(!isEmpty(isTuck)){
and t.is_tuck =#isTuck#
@}
@if(!isEmpty(teacherOpenCourseQuestionLogUpdateTime)){
and t.teacher_open_course_question_log_update_time =#teacherOpenCourseQuestionLogUpdateTime#
@}
@if(!isEmpty(teacherOpenCourseQuestionLogFinishTime)){
and t.teacher_open_course_question_log_finish_time =#teacherOpenCourseQuestionLogFinishTime#
@}
@if(!isEmpty(isErrorFavorite)){
and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score)
@}
@ -624,6 +659,13 @@ getValuesByQueryNotWithPermission
@if(!isEmpty(isTuck)){
and t.is_tuck =#isTuck#
@}
@if(!isEmpty(teacherOpenCourseQuestionLogUpdateTime)){
and t.teacher_open_course_question_log_update_time =#teacherOpenCourseQuestionLogUpdateTime#
@}
@if(!isEmpty(teacherOpenCourseQuestionLogFinishTime)){
and t.teacher_open_course_question_log_finish_time =#teacherOpenCourseQuestionLogFinishTime#
@}
@if(!isEmpty(isErrorFavorite)){
and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score)
@}

Loading…
Cancel
Save