|
|
|
@ -18,6 +18,7 @@ import com.ibeetl.jlw.entity.dto.QuestionSettingDTO;
|
|
|
|
|
import com.ibeetl.jlw.entity.dto.TeacherOpenCourseQuestionTestSimpleInfoDTO;
|
|
|
|
|
import com.ibeetl.jlw.entity.vo.TeacherOpenCourseQuestionTestDetailVO;
|
|
|
|
|
import com.ibeetl.jlw.entity.vo.TeacherOpenCourseQuestionTestSimpleInfoVO;
|
|
|
|
|
import com.ibeetl.jlw.enums.GlobalUpStatusEnum;
|
|
|
|
|
import com.ibeetl.jlw.enums.QuestionLogAddTypeEnum;
|
|
|
|
|
import com.ibeetl.jlw.web.query.ResourcesQuestionSnapshotQuery;
|
|
|
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseQuestionSettingQuery;
|
|
|
|
@ -45,6 +46,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
import static cn.hutool.core.util.ArrayUtil.join;
|
|
|
|
|
import static cn.hutool.core.util.ObjectUtil.defaultIfNull;
|
|
|
|
|
import static cn.jlw.util.CacheUserUtil.getStudent;
|
|
|
|
|
import static com.ibeetl.admin.core.util.StreamUtils.listJoin;
|
|
|
|
|
import static com.ibeetl.jlw.enums.QuestionLogAddTypeEnum.FINALLY_SUBMIT;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -95,6 +97,23 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService<ResourcesQ
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能描述: <br>
|
|
|
|
|
* 通过对应的开课题目库ID,批量修改题目快照状态
|
|
|
|
|
*
|
|
|
|
|
* @param ids
|
|
|
|
|
* @param upStatusEnum
|
|
|
|
|
* @Author: 87966
|
|
|
|
|
* @Date: 2023/2/26 20:09
|
|
|
|
|
*/
|
|
|
|
|
public void updateQuestionStatusByTeacherOpenCourseMergeResourcesQuestionIds(String ids, GlobalUpStatusEnum upStatusEnum){
|
|
|
|
|
try {
|
|
|
|
|
resourcesQuestionSnapshotDao.updateQuestionStatusByTeacherOpenCourseMergeResourcesQuestionIds(ids, upStatusEnum);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new PlatformException("批量修改题目快照的题目状态失败", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 批量删除(通过题目配置ID)
|
|
|
|
|
* @param settingIds
|
|
|
|
@ -390,12 +409,12 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService<ResourcesQ
|
|
|
|
|
* 根据题目类型配置。从开课题库
|
|
|
|
|
* 获取题目快照列表。并配置题目配置ID
|
|
|
|
|
*
|
|
|
|
|
* @param teacherOpenCourseQuestionSettingId
|
|
|
|
|
* @param questionSettingId
|
|
|
|
|
* @param questionSettingOptions
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public List<ResourcesQuestionSnapshot> getOpenResourcesQuestionSnapListBySettingOptions (
|
|
|
|
|
@NotNull(message = "开课题目配置ID不能为空!") final Long teacherOpenCourseQuestionSettingId,
|
|
|
|
|
@NotNull(message = "开课题目配置ID不能为空!") final Long questionSettingId,
|
|
|
|
|
@NotBlank(message = "题目设置不能为空!") Collection<QuestionSettingDTO> questionSettingOptions, Map<Long, Long> courseInfoIdPair) {
|
|
|
|
|
|
|
|
|
|
List<ResourcesQuestionSnapshot> result = new ArrayList<>();
|
|
|
|
@ -403,12 +422,13 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService<ResourcesQ
|
|
|
|
|
for (QuestionSettingDTO questionSettingOption : questionSettingOptions) {
|
|
|
|
|
// 根据配置随机出题。这里直接设置题目的分值。
|
|
|
|
|
List<TeacherOpenCourseMergeResourcesQuestion> randomMergeResourcesQuestionList =
|
|
|
|
|
teacherOpenCourseMergeResourcesQuestionDao.getRandomMergeResourcesQuestionList(questionSettingOption);
|
|
|
|
|
teacherOpenCourseMergeResourcesQuestionDao
|
|
|
|
|
.getRandomMergeResourcesQuestionListByChapterTestQuestion(questionSettingOption, null, questionSettingId);
|
|
|
|
|
|
|
|
|
|
setRQNewCourseInfoId(randomMergeResourcesQuestionList, courseInfoIdPair);
|
|
|
|
|
|
|
|
|
|
// 放入最终的集合中
|
|
|
|
|
result.addAll(getResourcesQuestionSnapshotList(randomMergeResourcesQuestionList, teacherOpenCourseQuestionSettingId, e -> {}));
|
|
|
|
|
result.addAll(getResourcesQuestionSnapshotList(randomMergeResourcesQuestionList, questionSettingId, e -> {}));
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
@ -559,4 +579,25 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService<ResourcesQ
|
|
|
|
|
public void deleteTeacherOpenCourseAllRelatedByTeacherOpenCourseId(@NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId) {
|
|
|
|
|
log.info("需要实现删除操作!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 通过题目ID,更改题目快照的状态
|
|
|
|
|
*
|
|
|
|
|
* @param openCourseMergeResourcesQuestionIds 开课题目IDs
|
|
|
|
|
* @param upStatusEnum 上下架状态
|
|
|
|
|
*/
|
|
|
|
|
public void updateStatusByTeacherOpenCourseMergeResourcesQuestionId(@NotEmpty(message = "开课的题目IDs不能为空!") String openCourseMergeResourcesQuestionIds,
|
|
|
|
|
@NotNull(message = "要更改的状态不能为空!") GlobalUpStatusEnum upStatusEnum) {
|
|
|
|
|
for (String mergeResourceQuestionId : openCourseMergeResourcesQuestionIds.split(",")) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ResourcesQuestionSnapshotQuery query = new ResourcesQuestionSnapshotQuery();
|
|
|
|
|
query.setTeacherOpenCourseMergeResourcesQuestionIdPlural(openCourseMergeResourcesQuestionIds);
|
|
|
|
|
List<ResourcesQuestionSnapshot> questionSnapshotList = getValuesByQueryNotWithPermission(query);
|
|
|
|
|
|
|
|
|
|
String snapshotIds = listJoin(questionSnapshotList, ResourcesQuestionSnapshot::getResourcesQuestionSnapshotId);
|
|
|
|
|
deleteResourcesQuestionSnapshot(snapshotIds);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|