考证辅导

beetlsql3-dev
Mlxa0324
parent 897b166542
commit 1a0b13f98f

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -363,7 +363,7 @@ ALTER TABLE teacher_open_course_merge_schedule_session ADD COLUMN teacher_open_c
-- 回显用
ALTER TABLE resources_question_snapshot ADD COLUMN teacher_open_course_merge_resources_question_id bigint COMMENT '开课题目ID';
ALTER TABLE teacher_open_course_question_log ADD COLUMN question_analysis varchar(1000) COMMENT '解析';
ALTER TABLE teacher_open_course_question_log ADD COLUMN question_mark int(2) default 0 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 '是否错题库';
-- 通用的题目配置
@ -371,7 +371,7 @@ drop table if exists general_question_setting;
CREATE TABLE `general_question_setting` (
`general_question_setting_id` bigint(20) NOT NULL COMMENT '通用题目设置ID',
`bussiness_id` bigint(20) NOT NULL COMMENT '业务ID',
`bussiness_type` bigint(20) NOT NULL COMMENT '业务类型',
`bussiness_type` varchar(50) NOT NULL COMMENT '业务类型(枚举 QuestionBussinessTypeEnum',
`general_question_setting_school_class_ids` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '班级ID集合逗号隔开',
`general_question_setting_do_count` int(11) DEFAULT NULL COMMENT '作答次数',
`general_question_setting_question_no_order` int(11) DEFAULT NULL COMMENT '题目乱序(同一大题内)',
@ -412,13 +412,14 @@ CREATE TABLE `general_resources_question_snapshot` (
`user_id` bigint(20) DEFAULT NULL COMMENT '后台用户ID',
`org_id` bigint(20) DEFAULT NULL COMMENT '组织机构ID',
PRIMARY KEY (`general_resources_question_snapshot_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='资源管理 - 题库管理-通用快照';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='资源管理-题库管理-通用快照';
drop table if exists general_question_log;
CREATE TABLE `general_question_log` (
`general_question_log_id` bigint(20) NOT NULL COMMENT '学生做题日志ID',
`general_question_setting_id` bigint(20) DEFAULT NULL COMMENT '通用题目配置ID',
`general_resources_question_snapshot_id` bigint(20) DEFAULT NULL COMMENT '题目快照ID',
`general_resources_question_log_type` varchar(50) DEFAULT NULL COMMENT '题目日志类型(枚举 GeneralResourcesQuestionLogTypeEnum',
`general_question_log_answer` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '学生提交的答案',
`general_question_log_upload_file` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '附件,学生端上传附件(单文件)',
`general_question_log_add_time` datetime DEFAULT NULL COMMENT '创建时间',

@ -18,20 +18,35 @@ import java.util.Map;
// 实际可以不用加Repository注解调用的地方注入时候Idea会报红看着难受
@Repository
@SqlResource("jlw.generalQuestionLog")
public interface GeneralQuestionLogDao extends BaseMapper<GeneralQuestionLog>{
public interface GeneralQuestionLogDao extends BaseMapper<GeneralQuestionLog> {
PageQuery<GeneralQuestionLog> queryByCondition(PageQuery query);
PageQuery<GeneralQuestionLog> queryByConditionQuery(PageQuery query);
@Update
void deleteGeneralQuestionLogByIds(String ids);
@Update
void logicDeleteGeneralQuestionLogBySettingIds(String settingIds);
void logicdeleteBySettingIds(String settingIds);
@Update
void deleteBySettingIds(String settingIds);
@Update
void deleteByIds(String ids);
@Update
int updateGivenByIds(GeneralQuestionLogQuery generalQuestionLogQuery);
List<GeneralQuestionLog> getByIds(String ids);
List<GeneralQuestionLog> getValuesByQuery(GeneralQuestionLogQuery generalQuestionLogQuery);
List<GeneralQuestionLog> getValuesByQueryNotWithPermission(GeneralQuestionLogQuery generalQuestionLogQuery);
List<Map<String,Object>>getExcelValues(GeneralQuestionLogQuery generalQuestionLogQuery);
List<Map<String, Object>> getExcelValues(GeneralQuestionLogQuery generalQuestionLogQuery);
PageQuery<TeacherOpenCourseQuestionLog> studentScoreList(PageQuery query);
}

@ -21,7 +21,7 @@ public interface GeneralQuestionSettingDao extends BaseMapper<GeneralQuestionSet
PageQuery<GeneralQuestionSetting> queryByCondition(PageQuery query);
PageQuery<GeneralQuestionSetting> queryByConditionQuery(PageQuery query);
@Update
void logicDeleteGeneralQuestionLogBySettingIds(String ids);
void logicdeleteBySettingIds(String ids);
@Update
void deleteByIds(String ids);
@Update

@ -24,7 +24,7 @@ public interface GeneralResourcesQuestionSnapshotDao extends BaseMapper<GeneralR
@Update
void deleteGeneralResourcesQuestionSnapshotByIds(String ids);
@Update
int deleteByTeacherOpenCourseQuestionSettingIds(String settingIds);
int deleteBySettingIds(String settingIds);
@Update
int updateGivenByIds(GeneralResourcesQuestionSnapshotQuery generalResourcesQuestionSnapshotQuery);
List<GeneralResourcesQuestionSnapshot> getByIds(String ids);

@ -47,7 +47,7 @@ public interface ResourcesQuestionSnapshotDao extends BaseMapper<ResourcesQuesti
* @param settingIds
*/
@Update
void deleteByTeacherOpenCourseQuestionSettingIds(String settingIds);
void deleteBySettingIds(String settingIds);
List<ResourcesQuestionSnapshot> getValuesByQueryNotWithPermission(ResourcesQuestionSnapshotQuery resourcesQuestionSnapshotQuery);
}

@ -36,12 +36,13 @@ public interface TeacherOpenCourseQuestionLogDao extends BaseMapper<TeacherOpenC
* @param settingIds
*/
@Update
void logicDeleteTeacherOpenCourseQuestionLogBySettingIds(String settingIds);
void logicDeleteBySettingIds(String settingIds);
/**
* ID
* @param settingIds
*/
@Update
void deleteByTeacherOpenCourseQuestionSettingIds(String settingIds);
void deleteBySettingIds(String settingIds);
}

@ -35,5 +35,5 @@ public interface TeacherOpenCourseQuestionLogWrongDao extends BaseMapper<Teacher
* @param settingIds
*/
@Update
void deleteByTeacherOpenCourseQuestionSettingIds(String settingIds);
void deleteBySettingIds(String settingIds);
}

@ -20,7 +20,7 @@ public interface TeacherOpenCourseQuestionSettingDao extends BaseMapper<TeacherO
PageQuery<TeacherOpenCourseQuestionSetting> queryByCondition(PageQuery query);
PageQuery<TeacherOpenCourseQuestionSetting> queryByConditionQuery(PageQuery query);
@Update
void deleteTeacherOpenCourseQuestionSettingByIds(String ids);
void logicDeleteBySettingIds(String ids);
@Update
void deleteByIds(String ids);
@Update

@ -3,6 +3,7 @@ package com.ibeetl.jlw.entity;
import com.ibeetl.admin.core.annotation.Dict;
import com.ibeetl.admin.core.entity.BaseEntity;
import com.ibeetl.admin.core.util.ValidateConfig;
import com.ibeetl.jlw.enums.GeneralResourcesQuestionLogTypeEnum;
import lombok.*;
import lombok.experimental.Accessors;
import org.beetl.sql.annotation.entity.AssignID;
@ -33,7 +34,11 @@ public class GeneralQuestionLog extends BaseEntity{
//通用题目配置ID
private Long generalQuestionSettingId ;
//题目日志类型(枚举 GeneralResourcesQuestionLogTypeEnum
private GeneralResourcesQuestionLogTypeEnum generalResourcesQuestionLogType ;
//题目快照ID
private Long generalResourcesQuestionSnapshotId ;

@ -1,13 +1,13 @@
package com.ibeetl.jlw.entity;
import cn.hutool.core.util.EnumUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ibeetl.admin.core.annotation.Dict;
import com.ibeetl.admin.core.entity.BaseEntity;
import com.ibeetl.admin.core.util.ValidateConfig;
import com.ibeetl.jlw.enums.ResourcesQuestionTypeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.ObjectUtils;
import org.beetl.sql.annotation.entity.AssignID;
import org.beetl.sql.fetch.annotation.Fetch;
@ -128,7 +128,7 @@ public class TeacherOpenCourseQuestionLog extends BaseEntity{
public void setQuestionType(Integer questionType) {
this.questionType = questionType;
if (ObjectUtils.isNotEmpty(questionType)) {
if (ObjectUtil.isNotEmpty(questionType)) {
this.set("questionTypeText", EnumUtil.likeValueOf(ResourcesQuestionTypeEnum.class, questionType).getText());
}
}

@ -0,0 +1,22 @@
package com.ibeetl.jlw.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.beetl.sql.annotation.entity.EnumMapping;
/**
*
*/
@Getter
@AllArgsConstructor
@EnumMapping("name")
public enum GeneralResourcesQuestionLogTypeEnum {
FROM_WRONG("从错题库"),
// 开课(暂时没用到)
FROM_QUESTION_SETTING("从题目配置");
private String text;
}

@ -45,6 +45,7 @@ import java.util.stream.Collectors;
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;
import static com.ibeetl.jlw.enums.ResourcesQuestionSnapshotFromTypeEnum.EXAM;
import static java.util.stream.Collectors.groupingBy;
/**
@ -93,9 +94,17 @@ public class GeneralQuestionLogService extends CoreBaseService<GeneralQuestionLo
}
}
public void logicDeleteGeneralQuestionLogBySettingIds(String settingIds){
public void logicdeleteBySettingIds(String settingIds){
try {
generalQuestionLogDao.logicDeleteGeneralQuestionLogBySettingIds(settingIds);
generalQuestionLogDao.logicdeleteBySettingIds(settingIds);
} catch (Exception e) {
throw new PlatformException("批量删除通用做题日志失败", e);
}
}
public void deleteBySettingIds(String settingIds){
try {
generalQuestionLogDao.deleteBySettingIds(settingIds);
} catch (Exception e) {
throw new PlatformException("批量删除通用做题日志失败", e);
}
@ -545,9 +554,11 @@ public class GeneralQuestionLogService extends CoreBaseService<GeneralQuestionLo
* ID
*
* @param studentId
* @param setting
* @param resourcesQuestionSnapshots
*/
public void preSubmitStudentQuestionLog(@NotBlank(message = "学生ID不能为空") final Long studentId,
@NotBlank(message = "题目配置ID不能为空!") final Long generalQuestionSettingId,
@NotNull(message = "题目配置不能为空!") final GeneralQuestionSetting setting,
@NotEmpty(message = "题目快照列表不能为空!") List<GeneralResourcesQuestionSnapshot> resourcesQuestionSnapshots) {
if (CollectionUtil.isEmpty(resourcesQuestionSnapshots)) {
@ -557,7 +568,13 @@ public class GeneralQuestionLogService extends CoreBaseService<GeneralQuestionLo
// generalQuestionSettingId类似试卷ID题目日志里会出现重复的试卷ID
// 逻辑删除之前的题目日志,防止学生做题统计数据异常
// 保证试卷是最新的
logicDeleteGeneralQuestionLogBySettingIds(String.valueOf(generalQuestionSettingId));
// 考试逻辑删除记录,作业或者章节测试都是直接删除记录。
if (setting.getGeneralQuestionSettingType().equals(EXAM)) {
logicdeleteBySettingIds(setting.getGeneralQuestionSettingId().toString());
}
else {
deleteBySettingIds(setting.getGeneralQuestionSettingId().toString());
}
// 断言
Assert.notBlank(resourcesQuestionSnapshots.get(0).getQuestionAnswer(), "题目快照选项不能为空!");
@ -567,7 +584,7 @@ public class GeneralQuestionLogService extends CoreBaseService<GeneralQuestionLo
generalQuestionLogs.forEach(questionLog -> {
// 题目的答案,如果最后一位是逗号,则删除掉
String questionAnswer = ReUtil.replaceAll(questionLog.getQuestionAnswer(), "\\,$", "");
questionLog.setGeneralQuestionSettingId(generalQuestionSettingId);
questionLog.setGeneralQuestionSettingId(setting.getGeneralQuestionSettingId());
questionLog.setGeneralQuestionLogStatus(1);
questionLog.setStudentId(studentId);
questionLog.setGeneralQuestionLogAddTime(new Date());

@ -19,6 +19,7 @@ import com.ibeetl.jlw.dao.GeneralResourcesQuestionSnapshotDao;
import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.entity.dto.QuestionSettingDTO;
import com.ibeetl.jlw.enums.GlobalPushStatusEnum;
import com.ibeetl.jlw.enums.QuestionBussinessTypeEnum;
import com.ibeetl.jlw.enums.ResourcesQuestionSnapshotFromTypeEnum;
import com.ibeetl.jlw.enums.ResourcesQuestionTypeEnum;
import com.ibeetl.jlw.web.query.GeneralQuestionSettingQuery;
@ -89,9 +90,9 @@ public class GeneralQuestionSettingService extends CoreBaseService<GeneralQuesti
}
}
public void logicDeleteGeneralQuestionLogBySettingIds(String ids){
public void logicdeleteBySettingIds(String ids){
try {
generalQuestionSettingDao.logicDeleteGeneralQuestionLogBySettingIds(ids);
generalQuestionSettingDao.logicdeleteBySettingIds(ids);
} catch (Exception e) {
throw new PlatformException("批量删除通用题目配置失败", e);
}
@ -377,7 +378,7 @@ public class GeneralQuestionSettingService extends CoreBaseService<GeneralQuesti
//TODO 保存
GeneralQuestionSetting generalQuestionSetting = new GeneralQuestionSetting();
generalQuestionSetting.setBussinessId(Long.parseLong(bussinessId));
generalQuestionSetting.setBussinessType(Long.parseLong(bussinessType));
generalQuestionSetting.setBussinessType(EnumUtil.likeValueOf(QuestionBussinessTypeEnum.class, bussinessType));
generalQuestionSetting.setGeneralQuestionSettingSchoolClassIds(generalQuestionSettingSchoolClassIds);
generalQuestionSetting.setGeneralQuestionSettingDoCount(Integer.parseInt(generalQuestionSettingDoCount));
generalQuestionSetting.setGeneralQuestionSettingQuestionNoOrder(Integer.parseInt(generalQuestionSettingQuestionNoOrder));
@ -390,7 +391,7 @@ public class GeneralQuestionSettingService extends CoreBaseService<GeneralQuesti
generalQuestionSetting.setGeneralQuestionSettingType(EnumUtil.likeValueOf(ResourcesQuestionSnapshotFromTypeEnum.class, generalQuestionSettingType));
generalQuestionSetting.setGeneralQuestionSettingRequire(generalQuestionSettingRequire);
generalQuestionSetting.setGeneralQuestionSettingFile(generalQuestionSettingFile);
generalQuestionSetting.setGeneralQuestionSettingPushStatus(cn.hutool.core.util.EnumUtil.likeValueOf(GlobalPushStatusEnum.class, generalQuestionSettingPushStatus));
generalQuestionSetting.setGeneralQuestionSettingPushStatus(EnumUtil.likeValueOf(GlobalPushStatusEnum.class, generalQuestionSettingPushStatus));
generalQuestionSetting.setGeneralQuestionSettingStatus(Integer.parseInt(generalQuestionSettingStatus));
generalQuestionSetting.setGeneralQuestionSettingAddTime(TimeTool.getTime(generalQuestionSettingAddTime));
generalQuestionSetting.setOrgId(coreUser.getOrgId());
@ -442,12 +443,8 @@ public class GeneralQuestionSettingService extends CoreBaseService<GeneralQuesti
// 常量 True的Integer表现
final Integer TRUE_CONST = 1;
List<GeneralResourcesQuestionSnapshot> resourcesQuestionSnapshots;
GeneralQuestionSetting homework = getInfo(generalQuestionSettingId);
Assert.notNull(homework, "未查询到来源ID对应的题目");
GeneralQuestionSettingQuery settingQuery = new GeneralQuestionSettingQuery();
settingQuery.setGeneralQuestionSettingId(generalQuestionSettingId);
GeneralQuestionSetting hwSetting = getInfo(settingQuery);
GeneralQuestionSetting hwSetting = getInfo(generalQuestionSettingId);
Assert.notNull(hwSetting, "未查询到来源ID对应的题目");
// 章节练习,则跳过次数验证;
// 其他类型,都需要验证作答次数
@ -497,7 +494,7 @@ public class GeneralQuestionSettingService extends CoreBaseService<GeneralQuesti
// 学生身份屏蔽答案,且记录在做题日志表中,这里不为空的判断有点多余
if (student != null) {
// 做题日志关联学生, 初步提交做题日志信息,不包含学生提交的答案和得分情况
generalQuestionLogService.preSubmitStudentQuestionLog(student.getStudentId(), generalQuestionSettingId, resourcesQuestionSnapshots);
generalQuestionLogService.preSubmitStudentQuestionLog(student.getStudentId(), hwSetting, resourcesQuestionSnapshots);
// 学生身份,需要屏蔽答案,再丢给前端
resourcesQuestionSnapshots.forEach(GeneralResourcesQuestionSnapshot::hideAnswer);
}

@ -79,9 +79,9 @@ public class GeneralResourcesQuestionSnapshotService extends CoreBaseService<Gen
throw new PlatformException("批量删除通用题目快照失败", e);
}
}
public void deleteByTeacherOpenCourseQuestionSettingIds(String ids){
public void deleteBySettingIds(String ids){
try {
generalResourcesQuestionSnapshotDao.deleteByTeacherOpenCourseQuestionSettingIds(ids);
generalResourcesQuestionSnapshotDao.deleteBySettingIds(ids);
} catch (Exception e) {
throw new PlatformException("批量删除通用题目快照失败", e);
}

@ -96,9 +96,9 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService<ResourcesQ
* (ID)
* @param settingIds
*/
public void deleteByTeacherOpenCourseQuestionSettingIds(String settingIds){
public void deleteBySettingIds(String settingIds){
try {
resourcesQuestionSnapshotDao.deleteByTeacherOpenCourseQuestionSettingIds(settingIds);
resourcesQuestionSnapshotDao.deleteBySettingIds(settingIds);
} catch (Exception e) {
throw new PlatformException("批量删除题目快照失败", e);
}
@ -203,7 +203,7 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService<ResourcesQ
// 题目设置,来动态获取题目
if(ObjectUtil.isNotEmpty(questionSettingOptions)) {
// 在插入之前,先清空列表。这种情况下,支持题目配置还在,重置题目列表的操作。
deleteByTeacherOpenCourseQuestionSettingIds(teacherOpenCourseQuestionSettingId.toString());
deleteBySettingIds(teacherOpenCourseQuestionSettingId.toString());
// 数据库动态设置分数,并获取题目列表
List<ResourcesQuestionSnapshot> insertList = getOpenResourcesQuestionSnapListBySettingOptions(
@ -225,7 +225,7 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService<ResourcesQ
@Nullable Collection<QuestionSettingDTO> questionSettingOptions, Map<Long, Long> courseInfoIdPair) {
// 在插入之前,先清空列表。这种情况下,支持题目配置还在,重置题目列表的操作。
deleteByTeacherOpenCourseQuestionSettingIds(teacherOpenCourseQuestionSettingId.toString());
deleteBySettingIds(teacherOpenCourseQuestionSettingId.toString());
// 题目设置,来动态获取题目
if(ObjectUtil.isNotEmpty(questionSettingOptions)) {
@ -522,7 +522,7 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService<ResourcesQ
if (ObjectUtil.isNotEmpty(valuesByQuery)) {
Set<Long> settingIdSet = valuesByQuery.stream()
.map(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingId).collect(Collectors.toSet());
deleteByTeacherOpenCourseQuestionSettingIds(join(settingIdSet.toArray(), ","));
deleteBySettingIds(join(settingIdSet.toArray(), ","));
}
}

@ -41,6 +41,7 @@ import java.util.stream.Collectors;
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;
import static java.util.stream.Collectors.groupingBy;
/**
@ -95,17 +96,17 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
* ID
* @param settingIds
*/
public void deleteByTeacherOpenCourseQuestionSettingIds(String settingIds) {
public void deleteBySettingIds(String settingIds) {
try {
teacherOpenCourseQuestionLogDao.deleteByTeacherOpenCourseQuestionSettingIds(settingIds);
teacherOpenCourseQuestionLogDao.deleteBySettingIds(settingIds);
} catch (Exception e) {
throw new PlatformException("批量删除题目日志失败", e);
}
}
public void logicDeleteTeacherOpenCourseQuestionLogBySettingIds(String settingIds){
public void logicDeleteBySettingIds(String settingIds){
try {
teacherOpenCourseQuestionLogDao.logicDeleteTeacherOpenCourseQuestionLogBySettingIds(settingIds);
teacherOpenCourseQuestionLogDao.logicDeleteBySettingIds(settingIds);
} catch (Exception e) {
throw new PlatformException("批量删除题目日志失败", e);
}
@ -362,7 +363,7 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
* @param studentId
*/
public void preSubmitStudentQuestionLog(@NotBlank(message = "学生ID不能为空") final Long studentId,
@NotBlank(message = "题目配置ID不能为空") final Long teacherOpenCourseQuestionSettingId,
@NotBlank(message = "题目配置ID不能为空") TeacherOpenCourseQuestionSetting setting,
@NotEmpty(message = "题目快照列表不能为空!") List<ResourcesQuestionSnapshot> resourcesQuestionSnapshots) {
if (CollectionUtil.isEmpty(resourcesQuestionSnapshots)) {
@ -372,7 +373,14 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
// teacherOpenCourseQuestionSettingId类似试卷ID题目日志里会出现重复的试卷ID
// 逻辑删除之前的题目日志,防止学生做题统计数据异常
// 保证试卷是最新的
logicDeleteTeacherOpenCourseQuestionLogBySettingIds(String.valueOf(teacherOpenCourseQuestionSettingId));
// 考试逻辑删除记录,作业或者章节测试都是直接删除记录。
Long teacherOpenCourseQuestionSettingId = setting.getTeacherOpenCourseQuestionSettingId();
if (setting.getTeacherOpenCourseQuestionSettingType().equals(EXAM)) {
logicDeleteBySettingIds(teacherOpenCourseQuestionSettingId.toString());
}
else {
deleteBySettingIds(teacherOpenCourseQuestionSettingId.toString());
}
// 断言
Assert.notBlank(resourcesQuestionSnapshots.get(0).getQuestionAnswer(), "题目快照选项不能为空!");

@ -86,9 +86,9 @@ public class TeacherOpenCourseQuestionLogWrongService extends CoreBaseService<Te
* ID
* @param settingIds
*/
public void deleteByTeacherOpenCourseQuestionSettingIds(String settingIds) {
public void deleteBySettingIds(String settingIds) {
try {
teacherOpenCourseQuestionLogWrongDao.deleteByTeacherOpenCourseQuestionSettingIds(settingIds);
teacherOpenCourseQuestionLogWrongDao.deleteBySettingIds(settingIds);
} catch (Exception e) {
throw new PlatformException("批量删除错题集失败", e);
}

@ -101,12 +101,12 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
public void deleteSettingAndSnapByIds(@NotEmpty String settingIds) {
teacherOpenCourseQuestionSettingDao.deleteByIds(settingIds);
resourcesQuestionSnapshotService.deleteByTeacherOpenCourseQuestionSettingIds(settingIds);
resourcesQuestionSnapshotService.deleteBySettingIds(settingIds);
}
public void logicDeleteTeacherOpenCourseQuestionSetting(String ids){
public void logicDeleteBySettingIds(String ids){
try {
teacherOpenCourseQuestionSettingDao.deleteTeacherOpenCourseQuestionSettingByIds(ids);
teacherOpenCourseQuestionSettingDao.logicDeleteBySettingIds(ids);
} catch (Exception e) {
throw new PlatformException("批量删除题目配置失败", e);
}
@ -513,11 +513,11 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
String settingIds = join(",", idList);
if (ObjectUtil.isNotEmpty(settingIds)) {
// 删除子表的数据(题目快照)
resourcesQuestionSnapshotService.deleteByTeacherOpenCourseQuestionSettingIds(settingIds);
resourcesQuestionSnapshotService.deleteBySettingIds(settingIds);
// 删除子表的数据(题目配置)
teacherOpenCourseQuestionLogService.deleteByTeacherOpenCourseQuestionSettingIds(settingIds);
teacherOpenCourseQuestionLogService.deleteBySettingIds(settingIds);
// 删除子表的数据(错题库)
teacherOpenCourseQuestionLogWrongService.deleteByTeacherOpenCourseQuestionSettingIds(settingIds);
teacherOpenCourseQuestionLogWrongService.deleteBySettingIds(settingIds);
}
}
@ -635,12 +635,8 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
// 常量 True的Integer表现
final Integer TRUE_CONST = 1;
List<ResourcesQuestionSnapshot> resourcesQuestionSnapshots;
TeacherOpenCourseQuestionSetting homework = getInfo(teacherOpenCourseQuestionSettingId);
Assert.notNull(homework, "未查询到来源ID对应的题目");
TeacherOpenCourseQuestionSettingQuery settingQuery = new TeacherOpenCourseQuestionSettingQuery();
settingQuery.setTeacherOpenCourseQuestionSettingId(teacherOpenCourseQuestionSettingId);
TeacherOpenCourseQuestionSetting hwSetting = getInfo(settingQuery);
TeacherOpenCourseQuestionSetting hwSetting = getInfo(teacherOpenCourseQuestionSettingId);
Assert.notNull(hwSetting, "未查询到来源ID对应的题目");
// 章节练习,则跳过次数验证;
// 其他类型,都需要验证作答次数
@ -690,7 +686,7 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
// 学生身份屏蔽答案,且记录在做题日志表中,这里不为空的判断有点多余
if (student != null) {
// 做题日志关联学生, 初步提交做题日志信息,不包含学生提交的答案和得分情况
teacherOpenCourseQuestionLogService.preSubmitStudentQuestionLog(student.getStudentId(), teacherOpenCourseQuestionSettingId, resourcesQuestionSnapshots);
teacherOpenCourseQuestionLogService.preSubmitStudentQuestionLog(student.getStudentId(), hwSetting, resourcesQuestionSnapshots);
// 学生身份,需要屏蔽答案,再丢给前端
resourcesQuestionSnapshots.forEach(ResourcesQuestionSnapshot::hideAnswer);
}

@ -151,7 +151,7 @@ public class GeneralQuestionSettingController{
*/
@PostMapping(API + "/logicDelete.do")
public JsonResult logicDeleteDo(String ids) {
generalQuestionSettingService.logicDeleteGeneralQuestionLogBySettingIds(ids);
generalQuestionSettingService.logicdeleteBySettingIds(ids);
return JsonResult.success();
}

@ -130,7 +130,7 @@ public class TeacherOpenCourseQuestionSettingController{
*/
@PostMapping(API + "/logicDelete.do")
public JsonResult logicDeleteDo(String ids) {
teacherOpenCourseQuestionSettingService.logicDeleteTeacherOpenCourseQuestionSetting(ids);
teacherOpenCourseQuestionSettingService.logicDeleteBySettingIds(ids);
return JsonResult.success();
}
@ -261,7 +261,7 @@ public class TeacherOpenCourseQuestionSettingController{
@Function("teacherOpenCourseQuestionSetting.delete")
@ResponseBody
public JsonResult logicDelete(String ids) {
teacherOpenCourseQuestionSettingService.logicDeleteTeacherOpenCourseQuestionSetting(ids);
teacherOpenCourseQuestionSettingService.logicDeleteBySettingIds(ids);
return JsonResult.success();
}

@ -4,6 +4,7 @@ import cn.jlw.validate.ValidateConfig;
import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.web.query.PageParam;
import com.ibeetl.jlw.entity.GeneralQuestionLog;
import com.ibeetl.jlw.enums.GeneralResourcesQuestionLogTypeEnum;
import lombok.*;
import lombok.experimental.Accessors;
@ -11,6 +12,9 @@ import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import static cn.hutool.core.util.ObjectUtil.defaultIfNull;
import static com.ibeetl.jlw.enums.GeneralResourcesQuestionLogTypeEnum.FROM_QUESTION_SETTING;
/**
*
*/
@ -26,6 +30,8 @@ public class GeneralQuestionLogQuery extends PageParam {
private Long generalQuestionLogId;
@Query(name = "通用题目配置ID", display = false)
private Long generalQuestionSettingId;
@Query(name = "题目日志类型(枚举 GeneralResourcesQuestionLogTypeEnum", display = false)
private GeneralResourcesQuestionLogTypeEnum generalResourcesQuestionLogType ;
@Query(name = "题目快照ID", display = false)
private Long generalResourcesQuestionSnapshotId;
@Query(name = "学生提交的答案", display = false)
@ -85,6 +91,7 @@ public class GeneralQuestionLogQuery extends PageParam {
public GeneralQuestionLog pojo(){
GeneralQuestionLog pojo = new GeneralQuestionLog();
pojo.setGeneralQuestionLogId(this.getGeneralQuestionLogId());
pojo.setGeneralResourcesQuestionLogType(defaultIfNull(this.getGeneralResourcesQuestionLogType(), FROM_QUESTION_SETTING));
pojo.setGeneralQuestionSettingId(this.getGeneralQuestionSettingId());
pojo.setGeneralResourcesQuestionSnapshotId(this.getGeneralResourcesQuestionSnapshotId());
pojo.setGeneralQuestionLogAnswer(this.getGeneralQuestionLogAnswer());

@ -19,6 +19,9 @@ queryByCondition
@if(!isEmpty(generalQuestionSettingId)){
and t.general_question_setting_id =#generalQuestionSettingId#
@}
@if(!isEmpty(generalResourcesQuestionLogType)){
and t.general_resources_question_log_type =#generalResourcesQuestionLogType#
@}
@if(!isEmpty(generalQuestionSettingIdPlural)){
and find_in_set(t.general_question_setting_id,#generalQuestionSettingIdPlural#)
@}
@ -127,6 +130,9 @@ queryByConditionQuery
@if(!isEmpty(generalQuestionSettingId)){
and t.general_question_setting_id =#generalQuestionSettingId#
@}
@if(!isEmpty(generalResourcesQuestionLogType)){
and t.general_resources_question_log_type =#generalResourcesQuestionLogType#
@}
@if(!isEmpty(generalQuestionSettingIdPlural)){
and find_in_set(t.general_question_setting_id,#generalQuestionSettingIdPlural#)
@}
@ -225,13 +231,20 @@ deleteGeneralQuestionLogByIds
update general_question_log set general_question_log_status = 2 where find_in_set(general_question_log_id,#ids#)
logicDeleteGeneralQuestionLogBySettingIds
logicdeleteBySettingIds
===
* 根据题目配置IDs批量删除假删除
update general_question_log set general_question_log_status = 2 where find_in_set(general_question_setting_id,#settingIds#)
deleteBySettingIds
===
* 根据题目配置IDs批量删除假删除
delete from general_question_log where find_in_set(general_question_setting_id,#settingIds#)
deleteByIds
===
@ -276,6 +289,13 @@ updateGivenByIds
general_question_log_answer = #generalQuestionLogAnswer# ,
@}
@}
@if(contain("generalResourcesQuestionLogType",_given)){
@if(isEmpty(generalResourcesQuestionLogType)){
general_resources_question_log_type = null ,
@}else{
general_resources_question_log_type = #generalResourcesQuestionLogType# ,
@}
@}
@if(contain("generalQuestionLogUploadFile",_given)){
@if(isEmpty(generalQuestionLogUploadFile)){
general_question_log_upload_file = null ,
@ -428,6 +448,9 @@ getGeneralQuestionLogValues
@if(!isEmpty(generalQuestionSettingId)){
and t.general_question_setting_id =#generalQuestionSettingId#
@}
@if(!isEmpty(generalResourcesQuestionLogType)){
and t.general_resources_question_log_type =#generalResourcesQuestionLogType#
@}
@if(!isEmpty(generalResourcesQuestionSnapshotId)){
and t.general_resources_question_snapshot_id =#generalResourcesQuestionSnapshotId#
@}
@ -512,6 +535,9 @@ getValuesByQuery
@if(!isEmpty(generalQuestionSettingId)){
and t.general_question_setting_id =#generalQuestionSettingId#
@}
@if(!isEmpty(generalResourcesQuestionLogType)){
and t.general_resources_question_log_type =#generalResourcesQuestionLogType#
@}
@if(!isEmpty(generalQuestionSettingIdPlural)){
and find_in_set(t.general_question_setting_id,#generalQuestionSettingIdPlural#)
@}
@ -618,6 +644,9 @@ getValuesByQueryNotWithPermission
@if(!isEmpty(generalQuestionSettingId)){
and t.general_question_setting_id =#generalQuestionSettingId#
@}
@if(!isEmpty(generalResourcesQuestionLogType)){
and t.general_resources_question_log_type =#generalResourcesQuestionLogType#
@}
@if(!isEmpty(generalQuestionSettingIdPlural)){
and find_in_set(t.general_question_setting_id,#generalQuestionSettingIdPlural#)
@}
@ -748,6 +777,9 @@ getExcelValues
@if(!isEmpty(generalQuestionSettingId)){
and t.general_question_setting_id =#generalQuestionSettingId#
@}
@if(!isEmpty(generalResourcesQuestionLogType)){
and t.general_resources_question_log_type =#generalResourcesQuestionLogType#
@}
@if(!isEmpty(generalQuestionSettingIdPlural)){
and find_in_set(t.general_question_setting_id,#generalQuestionSettingIdPlural#)
@}
@ -870,6 +902,9 @@ getExcelValues
@if(!isEmpty(generalQuestionSettingId)){
and t.general_question_setting_id =#generalQuestionSettingId#
@}
@if(!isEmpty(generalResourcesQuestionLogType)){
and t.general_resources_question_log_type =#generalResourcesQuestionLogType#
@}
@if(!isEmpty(generalQuestionSettingIdPlural)){
and find_in_set(t.general_question_setting_id,#generalQuestionSettingIdPlural#)
@}
@ -987,6 +1022,9 @@ studentScoreList
@if(!isEmpty(generalQuestionSettingId)){
and t.general_question_setting_id =#generalQuestionSettingId#
@}
@if(!isEmpty(generalResourcesQuestionLogType)){
and t.general_resources_question_log_type =#generalResourcesQuestionLogType#
@}
@if(!isEmpty(generalQuestionSettingIdPlural)){
and find_in_set(t.general_question_setting_id,#generalQuestionSettingIdPlural#)
@}

@ -180,7 +180,7 @@ queryByConditionQuery
@}
logicDeleteGeneralQuestionLogBySettingIds
logicdeleteBySettingIds
===
* 批量删除(假删除)

@ -177,7 +177,7 @@ deleteGeneralResourcesQuestionSnapshotByIds
delete from general_resources_question_snapshot where find_in_set(general_resources_question_snapshot_id,#ids#)
deleteByTeacherOpenCourseQuestionSettingIds
deleteBySettingIds
===
* 批量删除通过题目配置IDs

@ -185,7 +185,7 @@ deleteResourcesQuestionSnapshotByIds
delete from resources_question_snapshot where find_in_set(resources_question_snapshot_id,#ids#)
deleteByTeacherOpenCourseQuestionSettingIds
deleteBySettingIds
===
* 批量删除(通过题目配置ID)

@ -334,7 +334,7 @@ deleteTeacherOpenCourseQuestionLogByIds
update teacher_open_course_question_log set teacher_open_course_question_log_status = 2 where find_in_set(teacher_open_course_question_log_id,#ids#)
logicDeleteTeacherOpenCourseQuestionLogBySettingIds
logicDeleteBySettingIds
===
* 根据题目配置ID批量删除假删除
@ -349,7 +349,7 @@ deleteByIds
delete from teacher_open_course_question_log where find_in_set(teacher_open_course_question_log_id,#ids#)
deleteByTeacherOpenCourseQuestionSettingIds
deleteBySettingIds
===
* 根据题目配置ID 批量(真删除)

@ -210,7 +210,7 @@ deleteByIds
delete from teacher_open_course_question_log_wrong where find_in_set(teacher_open_course_question_log_wrong_id,#ids#)
deleteByTeacherOpenCourseQuestionSettingIds
deleteBySettingIds
===
* 批量删除(通过题目配置ID)

@ -176,7 +176,7 @@ queryByConditionQuery
deleteTeacherOpenCourseQuestionSettingByIds
logicDeleteBySettingIds
===
* 批量删除(假删除)

Loading…
Cancel
Save