题目完成用时,优化

beetlsql3-dev
Mlxa0324 2 years ago
parent 602e8fd747
commit 4e4cc5f6a7

@ -15090,8 +15090,8 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>87966</a:Creator>
<a:ModificationDate>1669379179</a:ModificationDate>
<a:Modifier>lx</a:Modifier>
<a:Comment>总用时(分钟</a:Comment>
<a:DataType>int(10)</a:DataType>
<a:Comment>总用时(</a:Comment>
<a:DataType>bigint(15)</a:DataType>
<a:Length>10</a:Length>
</o:Column>
<o:Column Id="o830">
@ -20440,8 +20440,8 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>87966</a:Creator>
<a:ModificationDate>1669368784</a:ModificationDate>
<a:Modifier>87966</a:Modifier>
<a:Comment>总用时(分钟</a:Comment>
<a:DataType>int(10)</a:DataType>
<a:Comment>总用时(</a:Comment>
<a:DataType>bigint(15)</a:DataType>
<a:Length>10</a:Length>
</o:Column>
<o:Column Id="o1234">

@ -15090,8 +15090,8 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>87966</a:Creator>
<a:ModificationDate>1669379179</a:ModificationDate>
<a:Modifier>lx</a:Modifier>
<a:Comment>总用时(分钟</a:Comment>
<a:DataType>int(10)</a:DataType>
<a:Comment>总用时(</a:Comment>
<a:DataType>bigint(15)</a:DataType>
<a:Length>10</a:Length>
</o:Column>
<o:Column Id="o830">
@ -20440,8 +20440,8 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>87966</a:Creator>
<a:ModificationDate>1669368784</a:ModificationDate>
<a:Modifier>87966</a:Modifier>
<a:Comment>总用时(分钟</a:Comment>
<a:DataType>int(10)</a:DataType>
<a:Comment>总用时(</a:Comment>
<a:DataType>bigint(15)</a:DataType>
<a:Length>10</a:Length>
</o:Column>
<o:Column Id="o1234">

@ -366,7 +366,7 @@ ALTER TABLE teacher_open_course_question_log ADD COLUMN question_analysis varcha
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_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 '总用时(分钟';
ALTER TABLE teacher_open_course_question_log ADD COLUMN teacher_open_course_question_log_finish_time bigint(15) default 1 COMMENT '总用时(';
ALTER TABLE teacher_open_course_question_log ADD COLUMN teacher_open_course_question_log_reply varchar(300) COMMENT '评语';
ALTER TABLE teacher_open_course_question_log ADD COLUMN question_log_add_type varchar(50) COMMENT '题目添加类型(枚举 QuestionLogAddTypeEnum';
@ -443,7 +443,7 @@ CREATE TABLE `general_question_log` (
`is_tuck` int(2) DEFAULT NULL COMMENT '是否收藏夹',
`is_error_favorite` int(2) DEFAULT NULL COMMENT '是否错题库',
`general_question_log_update_time` datetime COMMENT '修改时间',
`general_question_log_finish_time` int(10) default 1 COMMENT '总用时(分钟',
`general_question_log_finish_time` bigint(10) default 1 COMMENT '总用时(',
`general_question_log_reply` varchar(300) default 1 COMMENT '评语',
`question_log_add_type` varchar(50) COMMENT '题目添加类型(枚举 QuestionLogAddTypeEnum',
`org_id` bigint(20) DEFAULT NULL COMMENT '组织ID',

@ -125,7 +125,7 @@ public class GeneralQuestionLog extends BaseEntity{
private Date generalQuestionLogUpdateTime ;
//用时(分钟
//用时(
private Long generalQuestionLogFinishTime ;

@ -127,7 +127,7 @@ public class TeacherOpenCourseQuestionLog extends BaseEntity {
private Date teacherOpenCourseQuestionLogUpdateTime ;
//用时(分钟
//用时(
private Long teacherOpenCourseQuestionLogFinishTime ;

@ -108,18 +108,7 @@ public class TeacherOpenCourseQuestionLogScoreInfo extends BaseEntity {
/**
*
*/
// @FetchSql(value = "SELECT max(TIMEDIFF( t.teacher_open_course_question_log_update_time , t.teacher_open_course_question_log_add_time )) as finish_time " +
// "FROM teacher_open_course_question_log t " +
// "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 t.teacher_open_course_question_log_update_time IS NOT NULL "
// )
// private String finishTime;
@FetchSql(value = "SELECT max(ifnull(t.teacher_open_course_question_log_finish_time , 0)) as finish_time " +
@FetchSql(value = "SELECT max(TIMEDIFF( t.teacher_open_course_question_log_update_time , t.teacher_open_course_question_log_add_time )) as finish_time " +
"FROM teacher_open_course_question_log t " +
"WHERE t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" +
"@if(!isEmpty(studentId)) { \n" +
@ -129,6 +118,19 @@ public class TeacherOpenCourseQuestionLogScoreInfo extends BaseEntity {
"AND t.teacher_open_course_question_log_update_time IS NOT NULL "
)
private String finishTime;
// /**
// * 完成用时 的第二种实现
// */
// @FetchSql(value = "SELECT max(ifnull(t.teacher_open_course_question_log_finish_time , 0)) as finish_time " +
// "FROM teacher_open_course_question_log t " +
// "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 t.teacher_open_course_question_log_update_time IS NOT NULL "
// )
// private String finishTime;
public void setCorrectCount(Integer correctCount) {
this.correctCount = correctCount;

@ -229,14 +229,14 @@ public class TeacherOpenCourseQuestionSetting extends BaseEntity {
private String resourcesQuestionIdPlural;
/**
*
*
*/
@UpdateIgnore
@InsertIgnore
@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 and t.question_log_add_type = 'FINALLY_SUBMIT'")
private long finishTime;
private String finishTime;
/**
*

@ -48,7 +48,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.date.DateUnit.SECOND;
import static cn.hutool.core.util.ArrayUtil.join;
import static cn.jlw.util.CacheUserUtil.getStudent;
import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue;
@ -574,11 +574,11 @@ public class GeneralQuestionLogService extends CoreBaseService<GeneralQuestionLo
// 计算该题目学生的得分情况
questionLog.setStudentScore(isCorrectAnswer ? questionLog.getQuestionScore() : BigDecimal.valueOf(0));
// 完成时间
long finishTime = DateUtil.between(questionLog.getGeneralQuestionLogAddTime(), now, MINUTE);
long finishSecondTime = DateUtil.between(questionLog.getGeneralQuestionLogAddTime(), now, SECOND);
// 填充属性
questionLog.setGeneralQuestionLogUpdateTime(now);
questionLog.setGeneralQuestionLogFinishTime(finishTime);
questionLog.setGeneralQuestionLogFinishTime(finishSecondTime);
questionLog.setGeneralQuestionLogAnswer(answersText);
questionLog.setQuestionLogAddType(addType);
questionLog.setOrgId(student.getOrgId());

@ -43,7 +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.date.DateUnit.SECOND;
import static cn.hutool.core.util.ArrayUtil.join;
import static cn.jlw.util.CacheUserUtil.getStudent;
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUserId;
@ -382,14 +382,14 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
// 是否是正确答案
Boolean isCorrectAnswer = questionLog.getQuestionAnswer().equalsIgnoreCase(answersText);
// 完成时间,从生成试卷时候,开始计算
long finishTime = DateUtil.between(questionLog.getTeacherOpenCourseQuestionLogAddTime(), now, MINUTE);
long finishSecondTime = DateUtil.between(questionLog.getTeacherOpenCourseQuestionLogAddTime(), now, SECOND);
// 填充属性
questionLog.setTeacherOpenCourseQuestionLogAnswer(answersText);
// 计算该题目学生的得分情况
questionLog.setStudentScore(isCorrectAnswer ? questionLog.getQuestionScore() : BigDecimal.valueOf(0));
questionLog.setTeacherOpenCourseQuestionLogUpdateTime(now);
questionLog.setTeacherOpenCourseQuestionLogFinishTime(finishTime);
questionLog.setTeacherOpenCourseQuestionLogFinishTime(finishSecondTime);
questionLog.setQuestionLogAddType(addType);
questionLog.setOrgId(student.getOrgId());
questionLog.setUserId(student.getUserId());

@ -75,7 +75,7 @@ public class GeneralQuestionLogQuery extends PageParam {
private Boolean isErrorFavorite;
@Query(name = "修改时间", display = false)
private Date generalQuestionLogUpdateTime ;
@Query(name = "用时(分钟", display = false)
@Query(name = "用时(", display = false)
private Long generalQuestionLogFinishTime ;
@Query(name = "评语", display = false)
private String generalQuestionLogReply ;

@ -103,7 +103,7 @@ public class TeacherOpenCourseQuestionLogQuery extends PageParam {
private Date teacherOpenCourseQuestionLogUpdateTime ;
//用时(分钟
//用时(
private Long teacherOpenCourseQuestionLogFinishTime ;

Loading…
Cancel
Save