|
|
|
@ -83,13 +83,16 @@ public class PCQuestionController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "getCourseList")
|
|
|
|
|
public List<CourseDTO> getCourseList() {
|
|
|
|
|
return questionDao.getCourseList();
|
|
|
|
|
public Result<GetCourseList> getCourseList() {
|
|
|
|
|
GetCourseList getCourseList =new GetCourseList();
|
|
|
|
|
List<CourseDTO> courseList = questionDao.getCourseList();
|
|
|
|
|
getCourseList.setList(courseList);
|
|
|
|
|
return Result.success(getCourseList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "getIdsByCount")
|
|
|
|
|
public List<Long> getIdsByCount(@RequestBody GetIdsVo vo) {
|
|
|
|
|
public Result<CourseList> getIdsByCount(@RequestBody GetIdsVo vo) {
|
|
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
|
|
List<Long> courseIds = vo.getCourseIds();
|
|
|
|
|
int judgeCount = vo.getJudgeCount();
|
|
|
|
@ -114,11 +117,13 @@ public class PCQuestionController extends BaseController {
|
|
|
|
|
ids.addAll(randomSelect(collect, gapFillingCount));
|
|
|
|
|
}
|
|
|
|
|
if (multyCount > 0) {
|
|
|
|
|
List<Question> multyIds= questionDao.findAllByQuestionTypeAndCourseIdIn(2, courseIds);
|
|
|
|
|
List<Question> multyIds = questionDao.findAllByQuestionTypeAndCourseIdIn(2, courseIds);
|
|
|
|
|
List<Long> collect = multyIds.stream().map(Question::getId).collect(Collectors.toList());
|
|
|
|
|
ids.addAll(randomSelect(collect, multyCount));
|
|
|
|
|
}
|
|
|
|
|
return ids;
|
|
|
|
|
CourseList courseList = new CourseList();
|
|
|
|
|
courseList.setList(ids);
|
|
|
|
|
return Result.success(courseList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|