修改备注;

增加课程配置.json接口
beetlsql3-dev
Mlxa0324 2 years ago
parent 644ed9e03f
commit 9be8a446d2

@ -7871,7 +7871,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>Administrator</a:Creator>
<a:ModificationDate>1623837964</a:ModificationDate>
<a:Modifier>Administrator</a:Modifier>
<a:Comment>题型(1单选 2多选 3判断)</a:Comment>
<a:Comment>题型(1单选 2多选 3判断 4填空 5分析)</a:Comment>
<a:DataType>int(2)</a:DataType>
<a:Length>2</a:Length>
</o:Column>
@ -9964,7 +9964,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>Administrator</a:Creator>
<a:ModificationDate>1623859829</a:ModificationDate>
<a:Modifier>Administrator</a:Modifier>
<a:Comment>题型(1单选 2多选 3判断)</a:Comment>
<a:Comment>题型(1单选 2多选 3判断 4填空 5分析)</a:Comment>
<a:DataType>int(2)</a:DataType>
<a:Length>2</a:Length>
</o:Column>
@ -10951,7 +10951,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>Administrator</a:Creator>
<a:ModificationDate>1623861067</a:ModificationDate>
<a:Modifier>Administrator</a:Modifier>
<a:Comment>题型(1单选 2多选 3判断)</a:Comment>
<a:Comment>题型(1单选 2多选 3判断 4填空 5分析)</a:Comment>
<a:DataType>int(2)</a:DataType>
<a:Length>2</a:Length>
</o:Column>
@ -14955,7 +14955,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>87966</a:Creator>
<a:ModificationDate>1664982066</a:ModificationDate>
<a:Modifier>87966</a:Modifier>
<a:Comment>题型(1单选 2多选 3判断)</a:Comment>
<a:Comment>题型(1单选 2多选 3判断 4填空 5分析)</a:Comment>
<a:DataType>int(2)</a:DataType>
<a:Length>2</a:Length>
</o:Column>
@ -17163,7 +17163,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>lx</a:Creator>
<a:ModificationDate>1663937886</a:ModificationDate>
<a:Modifier>lx</a:Modifier>
<a:Comment>题型(1单选 2多选 3判断)</a:Comment>
<a:Comment>题型(1单选 2多选 3判断 4填空 5分析)</a:Comment>
<a:DataType>int(2)</a:DataType>
<a:Length>2</a:Length>
</o:Column>
@ -18363,7 +18363,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>lx</a:Creator>
<a:ModificationDate>1665199901</a:ModificationDate>
<a:Modifier>lx</a:Modifier>
<a:Comment>题型(1单选 2多选 3判断)</a:Comment>
<a:Comment>题型(1单选 2多选 3判断 4填空 5分析)</a:Comment>
<a:DataType>int(2)</a:DataType>
<a:Length>2</a:Length>
</o:Column>
@ -18714,7 +18714,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>lx</a:Creator>
<a:ModificationDate>1666665914</a:ModificationDate>
<a:Modifier>lx</a:Modifier>
<a:Comment>题型(1单选 2多选 3判断)</a:Comment>
<a:Comment>题型(1单选 2多选 3判断 4填空 5分析)</a:Comment>
<a:DataType>int(2)</a:DataType>
<a:Length>2</a:Length>
</o:Column>

@ -7907,7 +7907,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>Administrator</a:Creator>
<a:ModificationDate>1623837964</a:ModificationDate>
<a:Modifier>Administrator</a:Modifier>
<a:Comment>题型(1单选 2多选 3判断)</a:Comment>
<a:Comment>题型(1单选 2多选 3判断 4填空 5分析)</a:Comment>
<a:DataType>int(2)</a:DataType>
<a:Length>2</a:Length>
</o:Column>
@ -10000,7 +10000,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>Administrator</a:Creator>
<a:ModificationDate>1623859829</a:ModificationDate>
<a:Modifier>Administrator</a:Modifier>
<a:Comment>题型(1单选 2多选 3判断)</a:Comment>
<a:Comment>题型(1单选 2多选 3判断 4填空 5分析)</a:Comment>
<a:DataType>int(2)</a:DataType>
<a:Length>2</a:Length>
</o:Column>
@ -10987,7 +10987,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>Administrator</a:Creator>
<a:ModificationDate>1623861067</a:ModificationDate>
<a:Modifier>Administrator</a:Modifier>
<a:Comment>题型(1单选 2多选 3判断)</a:Comment>
<a:Comment>题型(1单选 2多选 3判断 4填空 5分析)</a:Comment>
<a:DataType>int(2)</a:DataType>
<a:Length>2</a:Length>
</o:Column>
@ -14991,7 +14991,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>87966</a:Creator>
<a:ModificationDate>1664982066</a:ModificationDate>
<a:Modifier>87966</a:Modifier>
<a:Comment>题型(1单选 2多选 3判断)</a:Comment>
<a:Comment>题型(1单选 2多选 3判断 4填空 5分析)</a:Comment>
<a:DataType>int(2)</a:DataType>
<a:Length>2</a:Length>
</o:Column>
@ -17199,7 +17199,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>lx</a:Creator>
<a:ModificationDate>1663937886</a:ModificationDate>
<a:Modifier>lx</a:Modifier>
<a:Comment>题型(1单选 2多选 3判断)</a:Comment>
<a:Comment>题型(1单选 2多选 3判断 4填空 5分析)</a:Comment>
<a:DataType>int(2)</a:DataType>
<a:Length>2</a:Length>
</o:Column>
@ -18399,7 +18399,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>lx</a:Creator>
<a:ModificationDate>1665199901</a:ModificationDate>
<a:Modifier>lx</a:Modifier>
<a:Comment>题型(1单选 2多选 3判断)</a:Comment>
<a:Comment>题型(1单选 2多选 3判断 4填空 5分析)</a:Comment>
<a:DataType>int(2)</a:DataType>
<a:Length>2</a:Length>
</o:Column>
@ -18750,7 +18750,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Creator>lx</a:Creator>
<a:ModificationDate>1666665914</a:ModificationDate>
<a:Modifier>lx</a:Modifier>
<a:Comment>题型(1单选 2多选 3判断)</a:Comment>
<a:Comment>题型(1单选 2多选 3判断 4填空 5分析)</a:Comment>
<a:DataType>int(2)</a:DataType>
<a:Length>2</a:Length>
</o:Column>

@ -47,7 +47,7 @@ CREATE TABLE `resources_question_snapshot` (
`resources_question_snapshot_id` bigint(20) NOT NULL COMMENT '题目快照ID',
`teacher_open_course_question_setting_id` bigint(20) NOT NULL COMMENT '开课题目配置ID',
`teacher_open_course_merge_course_info_id` bigint(20) DEFAULT NULL COMMENT '开课课程ID',
`question_type` int(2) DEFAULT NULL COMMENT '题型(1单选 2多选 3判断)',
`question_type` int(2) DEFAULT NULL COMMENT '题型(1单选 2多选 3判断 4填空 5分析)',
`question_score` decimal(3,1) DEFAULT NULL COMMENT '分值',
`question_stem` varchar(3000) DEFAULT NULL COMMENT '题干',
`question_option_a` varchar(1000) DEFAULT NULL COMMENT '选项A',
@ -186,7 +186,7 @@ create table teacher_open_course_merge_resources_question
teacher_open_course_merge_resources_question_id bigint unsigned not null comment 'ID',
teacher_open_course_id bigint comment '开课ID',
teacher_open_course_merge_course_info_id bigint comment '开课课程ID',
question_type int(2) comment '题型(1单选 2多选 3判断)',
question_type int(2) comment '题型(1单选 2多选 3判断 4填空 5分析)',
question_score decimal(3,1) comment '分值',
question_stem varchar(3000) comment '题干',
question_option_a varchar(1000) comment '选项A',
@ -365,3 +365,50 @@ 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 '是否收藏';
-- 通用的题目配置
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 '业务类型',
`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 '题目乱序(同一大题内)',
`general_question_setting_option_no_order` int(11) DEFAULT NULL COMMENT '选项乱序(限单选、多选)',
`general_question_setting_end_show_qa` int(11) DEFAULT NULL COMMENT '答卷后显示答案解析',
`general_question_setting_end_show_true_false` int(11) DEFAULT NULL COMMENT '答卷后显示答案对错',
`general_question_setting_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '题目-名称',
`general_question_start_time` datetime DEFAULT NULL COMMENT '题目开始时间',
`general_question_end_time` datetime DEFAULT NULL COMMENT '题目结束时间',
`general_question_setting_type` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '类型 枚举ResourcesQuestionSnapshotFromTypeEnum',
`general_question_setting_require` varchar(4000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '题目要求',
`general_question_setting_file` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '附件,老师上传附件(单文件)',
`general_question_setting_push_status` int(11) DEFAULT NULL COMMENT '发布状态。 1发布2未发布',
`general_question_setting_status` int(11) DEFAULT NULL COMMENT '状态 1正常 2删除',
`general_question_setting_add_time` datetime DEFAULT NULL COMMENT '创建时间',
`org_id` bigint(20) DEFAULT NULL COMMENT '组织ID',
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
PRIMARY KEY (`general_question_setting_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='系统通用-题目-设置';
drop table if exists general_resources_question_snapshot;
CREATE TABLE `general_resources_question_snapshot` (
`general_resources_question_snapshot_id` bigint(20) NOT NULL COMMENT '通用题目快照ID',
`general_question_setting_id` bigint(20) NOT NULL COMMENT '通用题目配置ID',
`business_course_info_id` bigint(20) DEFAULT NULL COMMENT '业务课程ID',
`business_course_info_type` bigint(20) DEFAULT NULL COMMENT '业务课程类型',
`question_type` int(2) DEFAULT NULL COMMENT '题型(1单选 2多选 3判断 4填空 5分析)',
`question_score` decimal(3,1) DEFAULT NULL COMMENT '分值',
`question_stem` varchar(3000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '题干',
`question_option_a` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '选项A',
`question_option_b` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '选项B',
`question_option_c` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '选项C',
`question_option_d` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '选项D',
`question_option_e` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '选项E',
`question_answer` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '答案(单选是一个 多选是多个 判断是对错)',
`question_analysis` varchar(3000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '解析',
`question_status` int(2) DEFAULT NULL COMMENT '题目状态 1上架 2下架',
`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='资源管理 - 题库管理-通用快照';

@ -524,7 +524,7 @@ CREATE TABLE `competition_task_one_question` (
`competition_task_one_question_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
`competition_id` bigint(20) NULL DEFAULT NULL COMMENT '大赛ID用于出题的原卷',
`competition_students_id` bigint(20) NULL DEFAULT NULL COMMENT '参赛学生ID',
`question_type` int(11) NULL DEFAULT NULL COMMENT '题型(1单选 2多选 3判断)',
`question_type` int(11) NULL DEFAULT NULL COMMENT '题型(1单选 2多选 3判断 4填空 5分析)',
`question_score` decimal(3, 1) NULL DEFAULT NULL COMMENT '分值',
`question_stem` varchar(3000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '题干',
`question_option_a` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '选项A',
@ -4875,7 +4875,7 @@ CREATE TABLE `exam_task_one_question` (
`exam_task_one_question_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
`exam_id` bigint(20) NULL DEFAULT NULL COMMENT '考试ID用于出题的原卷',
`exam_students_id` bigint(20) NULL DEFAULT NULL COMMENT '参考学生ID',
`question_type` int(11) NULL DEFAULT NULL COMMENT '题型(1单选 2多选 3判断)',
`question_type` int(11) NULL DEFAULT NULL COMMENT '题型(1单选 2多选 3判断 4填空 5分析)',
`question_score` decimal(3, 1) NULL DEFAULT NULL COMMENT '分值',
`question_stem` varchar(3000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '题干',
`question_option_a` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '选项A',
@ -27435,7 +27435,7 @@ DROP TABLE IF EXISTS `resources_question`;
CREATE TABLE `resources_question` (
`resources_question_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
`course_info_id` bigint(20) NULL DEFAULT NULL COMMENT '课程ID',
`question_type` int(11) NULL DEFAULT NULL COMMENT '题型(1单选 2多选 3判断)',
`question_type` int(11) NULL DEFAULT NULL COMMENT '题型(1单选 2多选 3判断 4填空 5分析)',
`question_score` decimal(3, 1) NULL DEFAULT NULL COMMENT '分值',
`question_stem` varchar(3000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '题干',
`question_option_a` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '选项A',
@ -28676,7 +28676,7 @@ create table teacher_open_course_question_log
teacher_open_course_question_log_status int comment '状态1正常 2删除',
student_id bigint comment '学生ID',
student_score decimal(3,1) comment '学生得分',
question_type int(2) comment '题型(1单选 2多选 3判断)',
question_type int(2) comment '题型(1单选 2多选 3判断 4填空 5分析)',
question_score decimal(3,1) comment '分值',
question_stem varchar(3000) comment '题干',
question_option_a varchar(1000) comment '选项A',
@ -28711,7 +28711,7 @@ create table teacher_open_course_question_log_wrong
teacher_open_course_question_log_add_time datetime comment '创建时间',
teacher_open_course_question_log_status int comment '状态1正常 2删除',
student_id bigint comment '学生ID',
question_type int(2) comment '题型(1单选 2多选 3判断)',
question_type int(2) comment '题型(1单选 2多选 3判断 4填空 5分析)',
question_score decimal(3,1) comment '分值',
question_stem varchar(3000) comment '题干',
question_option_a varchar(1000) comment '选项A',

@ -6,6 +6,8 @@ import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.ReflectUtil;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.lang.reflect.Field;
import java.util.*;
@ -81,6 +83,11 @@ public class ResourcesQuestionOptionEntity {
Assert.notBlank(questionAnswer, "答案不能为空!");
Assert.notBlank(prefix, "选项的属性前缀不能为空!");
// 遍历当前对象的所有属性,不包含父类
Field[] fieldsDirectly = ReflectUtil.getFieldsDirectly(obj.getClass(), false);
// 验证指定字段是否存在
verifyFieldExists(fieldsDirectly, answerFieldName, prefix);
// Map的简单封装
ResourcesQuestionOptionEntity optionEntity = new ResourcesQuestionOptionEntity();
@ -90,9 +97,8 @@ public class ResourcesQuestionOptionEntity {
// 记录属性名中的最后一位字符记录ABCDEF....
List<String> lastLetterFieldNameList = new ArrayList<>(6);
// 遍历当前对象的所有属性,不包含父类
for (Field field : ReflectUtil.getFieldsDirectly(obj.getClass(), false)) {
// 属性遍历操作
for (Field field : fieldsDirectly) {
// 选项questionOption 开头的属性
if (field.getName().startsWith(prefix)) {
// 反射,来获取当前属性最后一个字母:选项
@ -140,4 +146,30 @@ public class ResourcesQuestionOptionEntity {
// 乱序后的正确答案赋值
ReflectUtil.setFieldValue(obj, answerFieldName, join(answer, ","));
}
/**
*
* @param fieldsDirectly
* @param answerFieldName
* @param prefix
*/
private static void verifyFieldExists(@NotEmpty Field[] fieldsDirectly, @NotBlank String answerFieldName, @NotBlank String prefix) {
// 验证对象中,指定的属性值是否存在
boolean fileNameAnyMatch = Arrays.stream(fieldsDirectly).anyMatch(item -> item.getName().startsWith(answerFieldName));
boolean filePrefixNameAnyMatch = Arrays.stream(fieldsDirectly).anyMatch(item -> item.getName().startsWith(prefix));
Assert.isTrue(fileNameAnyMatch, "未匹配到答案字段!");
Assert.isTrue(filePrefixNameAnyMatch, "未匹配到选项答案,至少保证有一个答案!");
}
/**
*
* @param clazz
* @param answerFieldName
* @param prefix
*/
private static void verifyFieldExists(Class<?> clazz, String answerFieldName, String prefix) {
Field[] fields = ReflectUtil.getFieldsDirectly(clazz, false);
verifyFieldExists(fields, answerFieldName, prefix);
}
}

@ -12,7 +12,7 @@ import java.math.BigDecimal;
* - --
* gen by Spring Boot2 Admin 2022-10-05
*/
public class ResourcesQuestionSnapshot extends BaseEntity{
public class ResourcesQuestionSnapshot extends BaseEntity {
//题目快照ID
@NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class)

@ -10,7 +10,6 @@ import cn.jlw.util.ToolUtils;
import cn.jlw.validate.ValidateConfig;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.admin.core.web.JsonResult;
@ -45,7 +44,7 @@ import java.util.*;
import java.util.stream.Collectors;
import static cn.hutool.core.text.CharSequenceUtil.join;
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
import static cn.jlw.util.CacheUserUtil.getStudent;
import static com.ibeetl.jlw.entity.ResourcesQuestionOptionEntity.shuffleOrderOptions;
import static com.ibeetl.jlw.enums.GlobalPushStatusEnum.UN_PUSH;
import static com.ibeetl.jlw.enums.ResourcesQuestionSnapshotFromTypeEnum.CHAPTER_EXERCISE;
@ -216,7 +215,7 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
public TeacherOpenCourseQuestionSetting getInfo (Long teacherOpenCourseQuestionSettingId){
TeacherOpenCourseQuestionSettingQuery teacherOpenCourseQuestionSettingQuery = new TeacherOpenCourseQuestionSettingQuery();
teacherOpenCourseQuestionSettingQuery.setTeacherOpenCourseQuestionSettingId(teacherOpenCourseQuestionSettingId);
teacherOpenCourseQuestionSettingQuery.setTeacherOpenCourseQuestionSettingStatusPlural("1,2");//需要根据实际情况来
teacherOpenCourseQuestionSettingQuery.setTeacherOpenCourseQuestionSettingStatusPlural("1");//需要根据实际情况来
List<TeacherOpenCourseQuestionSetting> list = teacherOpenCourseQuestionSettingDao.getValuesByQuery(teacherOpenCourseQuestionSettingQuery);
if(null != list && list.size()>0){
return list.get(0);
@ -616,14 +615,13 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
@NotNull(message = "类型不能为空!") ResourcesQuestionSnapshotFromTypeEnum fromTypeEnum) {
// 获取学生ID
CoreUser coreUser = getUser();
final Student student = studentDao.getByUserId(coreUser.getId());
final Student student = getStudent();
Assert.notNull(student, "非学生身份,无法获取题目!");
Assert.isTrue(!fromTypeEnum.equals(HOMEWORK_FILE), "作业-附件类型 不需要获取题目快照!");
// 常量 True的Integer表现
final Integer TRUE_CONST = 1;
List<ResourcesQuestionSnapshot> resourcesQuestionSnapshots = new ArrayList<>();
List<ResourcesQuestionSnapshot> resourcesQuestionSnapshots;
TeacherOpenCourseQuestionSetting homework = getInfo(teacherOpenCourseQuestionSettingId);
Assert.notNull(homework, "未查询到来源ID对应的题目");
@ -631,9 +629,6 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
settingQuery.setTeacherOpenCourseQuestionSettingId(teacherOpenCourseQuestionSettingId);
TeacherOpenCourseQuestionSetting hwSetting = getInfo(settingQuery);
ResourcesQuestionSnapshotQuery questionSnapshotQuery = new ResourcesQuestionSnapshotQuery();
questionSnapshotQuery.setTeacherOpenCourseQuestionSettingId(teacherOpenCourseQuestionSettingId);
// 章节练习,则跳过次数验证;
// 其他类型,都需要验证作答次数
if (!EnumUtil.contains(fromTypeEnum, CHAPTER_EXERCISE)) {
@ -648,16 +643,17 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
Assert.isTrue(doCount < teacherOpenCourseQuestionSettingSettingDoCount, "已超过最大作答次数!");
}
ResourcesQuestionSnapshotQuery questionSnapshotQuery = new ResourcesQuestionSnapshotQuery();
questionSnapshotQuery.setTeacherOpenCourseQuestionSettingId(teacherOpenCourseQuestionSettingId);
// 答卷后显示答案解析
if (TRUE_CONST.equals(hwSetting.getTeacherOpenCourseQuestionSettingEndShowQa())) {
// TODO 逻辑不要在这里写
/** 实现 {@link TeacherOpenCourseQuestionLogService#questionAnalysis(TreeSet)} */
/** 实现 {@link TeacherOpenCourseQuestionLogService#questionAnalysis} */
}
// 答卷后显示答案对错
if (TRUE_CONST.equals(hwSetting.getTeacherOpenCourseQuestionSettingEndShowTrueFalse())) {
// TODO 逻辑不要在这里写
/** 实现 {@link TeacherOpenCourseQuestionLogService#questionAnalysis(TreeSet)} */
/** 实现 {@link TeacherOpenCourseQuestionLogService#questionAnalysis} */
}
// 题目乱序(同一大题内)
@ -667,6 +663,8 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
// 题目查询
resourcesQuestionSnapshots = resourcesQuestionSnapshotDao.getValuesByQuery(questionSnapshotQuery);
//
resourcesQuestionSnapshots = ObjectUtil.defaultIfNull(resourcesQuestionSnapshots, new ArrayList<>());
// 选项乱序(限单选、多选)
if (TRUE_CONST.equals(hwSetting.getTeacherOpenCourseQuestionSettingOptionNoOrder())) {
@ -676,8 +674,8 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
});
}
// 学生身份屏蔽答案,且记录在做题日志表中
if (coreUser.isStudent()) {
// 学生身份屏蔽答案,且记录在做题日志表中,这里不为空的判断有点多余
if (student != null) {
// 做题日志关联学生, 初步提交做题日志信息,不包含学生提交的答案和得分情况
teacherOpenCourseQuestionLogService.preSubmitStudentQuestionLog(student.getStudentId(), teacherOpenCourseQuestionSettingId, resourcesQuestionSnapshots);
// 学生身份,需要屏蔽答案,再丢给前端

@ -486,7 +486,7 @@ public class TeacherOpenCourseMergeCourseInfoController{
* @return
*/
@GetMapping(API + "/getTreeById.do")
public JsonResult getTreeById(Long teacherOpenCourseMergeCourseInfoId) {
public JsonResult getTreeByIdDo(Long teacherOpenCourseMergeCourseInfoId) {
return JsonResult.success(teacherOpenCourseMergeCourseInfoService.getTreeById(teacherOpenCourseMergeCourseInfoId));
}
@ -498,7 +498,7 @@ public class TeacherOpenCourseMergeCourseInfoController{
* @return
*/
@PostMapping(API + "/getTreeByTeacherOpenCourseId.do")
public JsonResult getTreeByTeacherOpenCourseId(Long teacherOpenCourseId) {
public JsonResult getTreeByTeacherOpenCourseIdDo(Long teacherOpenCourseId) {
Assert.notNull(getUser(), "请登录后再操作");
return JsonResult.success(teacherOpenCourseMergeCourseInfoService.getTreeByTeacherOpenCourseId(teacherOpenCourseId));
}
@ -511,6 +511,46 @@ public class TeacherOpenCourseMergeCourseInfoController{
* @return
*/
@PostMapping(API + "/getTreeLocalCacheByTeacherOpenCourseId.do")
public JsonResult getTreeLocalCacheByTeacherOpenCourseIdDo(Long teacherOpenCourseId) {
Assert.notNull(getUser(), "请登录后再操作");
return JsonResult.success(teacherOpenCourseMergeCourseInfoService.getTreeLocalCacheByTeacherOpenCourseId(teacherOpenCourseId));
}
/**
*
*
* @param teacherOpenCourseMergeCourseInfoId ID
* @return
*/
@GetMapping(MODEL + "/getTreeById.json")
@Function("teacherOpenCourseMergeCourseInfo.query")
public JsonResult getTreeById(Long teacherOpenCourseMergeCourseInfoId) {
return JsonResult.success(teacherOpenCourseMergeCourseInfoService.getTreeById(teacherOpenCourseMergeCourseInfoId));
}
/**
*
*
*
* @param teacherOpenCourseId ID
* @return
*/
@PostMapping(MODEL + "/getTreeByTeacherOpenCourseId.json")
@Function("teacherOpenCourseMergeCourseInfo.query")
public JsonResult getTreeByTeacherOpenCourseId(Long teacherOpenCourseId) {
Assert.notNull(getUser(), "请登录后再操作");
return JsonResult.success(teacherOpenCourseMergeCourseInfoService.getTreeByTeacherOpenCourseId(teacherOpenCourseId));
}
/**
*
*
*
* @param teacherOpenCourseId ID
* @return
*/
@PostMapping(MODEL + "/getTreeLocalCacheByTeacherOpenCourseId.json")
@Function("teacherOpenCourseMergeCourseInfo.query")
public JsonResult getTreeLocalCacheByTeacherOpenCourseId(Long teacherOpenCourseId) {
Assert.notNull(getUser(), "请登录后再操作");
return JsonResult.success(teacherOpenCourseMergeCourseInfoService.getTreeLocalCacheByTeacherOpenCourseId(teacherOpenCourseId));

@ -108,7 +108,6 @@ public class TeacherOpenCourseQuestionSettingController{
@PostMapping(API + "/questionDetail.do")
public JsonResult questionDetail(Long teacherOpenCourseQuestionSettingId,
ResourcesQuestionSnapshotFromTypeEnum fromTypeEnum, @SCoreUser CoreUser coreUser) {
Assert.isTrue(coreUser.isStudent(), "非学生身份,无法获取题目!");
return JsonResult.success(teacherOpenCourseQuestionSettingService.questionDetail(teacherOpenCourseQuestionSettingId, fromTypeEnum));
}

@ -46,7 +46,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
{
field : 'questionType',
title : '题型(1单选 2多选 3判断)',
title : '题型(1单选 2多选 3判断 4填空 5分析)',
},
{

@ -46,7 +46,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
{
field : 'questionType',
title : '题型(1单选 2多选 3判断)',
title : '题型(1单选 2多选 3判断 4填空 5分析)',
},
{

@ -33,7 +33,7 @@ layui.define(['form', 'laydate', 'table'], function (exports) {
},
{
field: 'questionType', align: "center", width: 80,
title: '题型', templet: function (d) {//(1单选 2多选 3判断)
title: '题型', templet: function (d) {//(1单选 2多选 3判断 4填空 5分析)
return d.questionType == 1 ? '单选' : d.questionType == 2 ? '多选' : d.questionType == 3 ? '判断' : '-';
}
},

@ -57,7 +57,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
},
{
field : 'questionType',
title : '题型(1单选 2多选 3判断)',
title : '题型(1单选 2多选 3判断 4填空 5分析)',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['questionType'])?false:sx_['questionType'],

@ -57,7 +57,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
},
{
field : 'questionType',
title : '题型(1单选 2多选 3判断)',
title : '题型(1单选 2多选 3判断 4填空 5分析)',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['questionType'])?false:sx_['questionType'],

@ -92,7 +92,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
},
{
field : 'questionType',
title : '题型(1单选 2多选 3判断)',
title : '题型(1单选 2多选 3判断 4填空 5分析)',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['questionType'])?false:sx_['questionType'],

@ -20,7 +20,7 @@
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">题型(1单选 2多选 3判断)</label>
<label class="layui-form-label">题型(1单选 2多选 3判断 4填空 5分析)</label>
<div class="layui-input-inline">
<input type="text" name="questionType" class="layui-input" >
</div>

@ -20,7 +20,7 @@
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">题型(1单选 2多选 3判断)</label>
<label class="layui-form-label">题型(1单选 2多选 3判断 4填空 5分析)</label>
<div class="layui-input-inline">
<input type="text" id="questionType" name="questionType" value="${competitionTaskOneQuestion.questionType}" class="layui-input" >
</div>

@ -736,7 +736,7 @@
},
{
field : 'questionType',align:"center",
title : '题型', templet: function (d) {//(1单选 2多选 3判断)
title : '题型', templet: function (d) {//(1单选 2多选 3判断 4填空 5分析)
return d.questionType == 1?'单选':d.questionType == 2?'多选':d.questionType == 3?'判断':'-';
}
},

@ -20,7 +20,7 @@
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">题型(1单选 2多选 3判断)</label>
<label class="layui-form-label">题型(1单选 2多选 3判断 4填空 5分析)</label>
<div class="layui-input-inline">
<input type="text" name="questionType" class="layui-input" >
</div>

@ -20,7 +20,7 @@
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">题型(1单选 2多选 3判断)</label>
<label class="layui-form-label">题型(1单选 2多选 3判断 4填空 5分析)</label>
<div class="layui-input-inline">
<input type="text" id="questionType" name="questionType" value="${examTaskOneQuestion.questionType}" class="layui-input" >
</div>

@ -10,7 +10,7 @@
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">题型(1单选 2多选 3判断)</label>
<label class="layui-form-label">题型(1单选 2多选 3判断 4填空 5分析)</label>
<div class="layui-input-inline">
<input type="text" id="questionType" name="questionType" value="${resourcesQuestion.questionType}" class="layui-input" >
</div>

@ -21,7 +21,7 @@
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">题型(1单选 2多选 3判断)</label>
<label class="layui-form-label">题型(1单选 2多选 3判断 4填空 5分析)</label>
<div class="layui-input-inline">
<input type="text" id="questionType" name="questionType" value="${resourcesQuestionSnapshot.questionType}" class="layui-input" >
</div>

@ -21,7 +21,7 @@
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">题型(1单选 2多选 3判断)</label>
<label class="layui-form-label">题型(1单选 2多选 3判断 4填空 5分析)</label>
<div class="layui-input-inline">
<input type="text" id="questionType" name="questionType" value="${resourcesQuestionSnapshot.questionType}" class="layui-input" >
</div>

@ -22,7 +22,7 @@
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">题型(1单选 2多选 3判断)</label>
<label class="layui-form-label">题型(1单选 2多选 3判断 4填空 5分析)</label>
<div class="layui-input-inline">
<input type="text" id="questionType" name="questionType" value="${teacherOpenCourseMergeResourcesQuestion.questionType}" class="layui-input" >
</div>

@ -22,7 +22,7 @@
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">题型(1单选 2多选 3判断)</label>
<label class="layui-form-label">题型(1单选 2多选 3判断 4填空 5分析)</label>
<div class="layui-input-inline">
<input type="text" id="questionType" name="questionType" value="${teacherOpenCourseMergeResourcesQuestion.questionType}" class="layui-input" >
</div>

@ -59,7 +59,7 @@
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">题型(1单选 2多选 3判断)</label>
<label class="layui-form-label">题型(1单选 2多选 3判断 4填空 5分析)</label>
<div class="layui-input-inline">
<input type="text" id="questionType" name="questionType" value="${teacherOpenCourseQuestionLogWrong.questionType}" class="layui-input" >
</div>

@ -59,7 +59,7 @@
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">题型(1单选 2多选 3判断)</label>
<label class="layui-form-label">题型(1单选 2多选 3判断 4填空 5分析)</label>
<div class="layui-input-inline">
<input type="text" id="questionType" name="questionType" value="${teacherOpenCourseQuestionLogWrong.questionType}" class="layui-input" >
</div>

Loading…
Cancel
Save