新增授权课的章节练习,实操的预览接口

beetlsql3-dev
yaodan 2 years ago
parent a6be1e5c97
commit 53632946cf

@ -61,4 +61,5 @@ public interface CourseInfoDao extends BaseMapper<CourseInfo>{
PageQuery<CourseInfo> examCourseQuestionDO(PageQuery<CourseInfoQuery> pageQuery);
PageQuery<CourseInfo> queryChapterExerciseInfoList(PageQuery pageQuery);
}

@ -27,4 +27,7 @@ public interface HandsOnSimulationTasksDao extends BaseMapper<HandsOnSimulationT
List<HandsOnSimulationTasks> getValuesByQuery(HandsOnSimulationTasksQuery handsOnSimulationTasksQuery);
List<HandsOnSimulationTasks> queryObjectByHandsOnIds(List<Long> handsOnIds);
List<HandsOnSimulationTasks> getValuesByQueryNotPermission(HandsOnSimulationTasksQuery tasksQuery);
}

@ -52,4 +52,5 @@ public interface ResourcesQuestionDao extends BaseMapper<ResourcesQuestion>{
Long getCourseInfoByBusinessTypeAndTitle(String courseInfoTitle, String importCourseId, MatchTypeEnum matchType, QuestionBusinessTypeEnum businessType);
List<QuestionSettingDTO> getGroupQuestionTypeCountAndSelectInfo(Long courseInfoId, Long questionSettingId);
}

@ -1038,6 +1038,10 @@ public class CourseInfoService extends CoreBaseService<CourseInfo>{
});
}
public LambdaQuery<CourseInfo> createLambdaQuery() {
return courseInfoDao.createLambdaQuery();
}
/**
*
*/
@ -1532,4 +1536,9 @@ public class CourseInfoService extends CoreBaseService<CourseInfo>{
.andIn(CourseInfo::getCourseInfoId, Arrays.asList(courseInfoIds.split(",")))
.andEq(CourseInfo::getCourseInfoStatus, 1).select();
}
public PageQuery<CourseInfo> queryChapterExerciseInfoList(PageQuery pageQuery){
return courseInfoDao.queryChapterExerciseInfoList(pageQuery);
}
}

@ -13,7 +13,10 @@ import com.ibeetl.admin.core.web.JsonReturnCode;
import com.ibeetl.jlw.dao.HandsOnDao;
import com.ibeetl.jlw.entity.HandsOn;
import com.ibeetl.jlw.entity.HandsOnSimulationTasks;
import com.ibeetl.jlw.entity.vo.StudentHandsOnVO;
import com.ibeetl.jlw.web.query.HandsOnQuery;
import com.ibeetl.jlw.web.query.HandsOnSimulationTasksQuery;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.beetl.sql.core.SqlId;
import org.beetl.sql.core.engine.PageQuery;
@ -196,4 +199,43 @@ public class HandsOnService extends CoreBaseService<HandsOn>{
.andEq(HandsOn::getHandsOnStatus, 1)
.select();
}
/**
* -- FIXME
*
* @param courseInfo
* @return
*/
public JsonResult<List<StudentHandsOnVO>> getHandsListCenterByOpenCourseId(Long courseInfo) {
//查询实操
HandsOnQuery handsOnQuery = new HandsOnQuery();
handsOnQuery.setCourseInfoId(courseInfo);
handsOnQuery.setHandsOnStatus(1);
List<HandsOn> handsOnList = this.getValuesByQueryNotPermission(handsOnQuery);
List<HandsOnSimulationTasks> tasksList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(handsOnList)) {
//查询实操任务
List<Long> handIds = handsOnList.stream().map(HandsOn::getHandsOnId).collect(Collectors.toList());
HandsOnSimulationTasksQuery tasksQuery = new HandsOnSimulationTasksQuery();
tasksQuery.setHandsOnIdPlural(CollectionUtil.join(handIds, ","));
tasksList = handsOnSimulationTasksService.getValuesByQueryNotPermission(tasksQuery);
}
List<StudentHandsOnVO> studentHandsOnVOS = new ArrayList<>();
for (HandsOn handsOn : handsOnList) {
StudentHandsOnVO studentHandsOnVO = new StudentHandsOnVO();
Long handsOnId = handsOn.getHandsOnId();
studentHandsOnVO.setChapterId(handsOn.getCourseChildNode());
studentHandsOnVO.setTeacherOpenCourseId(handsOn.getTeacherOpenCourseId());
List<HandsOnSimulationTasks> tasks = tasksList.stream().filter(v -> v.getHandsOnId().equals(handsOnId)).collect(Collectors.toList());
studentHandsOnVO.setHandsOnId(handsOnId);
studentHandsOnVO.setHandsOnName(handsOn.getHandsOnName());
studentHandsOnVO.setHandsOnTaskNum(tasks.size());
studentHandsOnVOS.add(studentHandsOnVO);
}
return JsonResult.success(studentHandsOnVOS);
}
}

@ -5,20 +5,16 @@ import cn.jlw.util.ToolUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
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;
import com.ibeetl.admin.core.web.JsonReturnCode;
import com.ibeetl.jlw.dao.HandsOnSimulationTasksDao;
import com.ibeetl.jlw.dao.ResourcesQuestionDao;
import com.ibeetl.jlw.entity.HandsOnSimulationTasks;
import com.ibeetl.jlw.entity.HandsOnSimulationTasksAssessment;
import com.ibeetl.jlw.entity.HandsOnSimulationTasksFile;
import com.ibeetl.jlw.entity.ResourcesQuestion;
import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.entity.vo.HandsOnTaskProblemVO;
import com.ibeetl.jlw.web.query.HandsOnSimulationTasksAssessmentQuery;
import com.ibeetl.jlw.web.query.HandsOnSimulationTasksFileQuery;
import com.ibeetl.jlw.web.query.HandsOnSimulationTasksQuery;
import com.ibeetl.jlw.web.query.*;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.beetl.sql.core.SqlId;
@ -45,7 +41,7 @@ public class HandsOnSimulationTasksService extends CoreBaseService<HandsOnSimula
@Autowired private HandsOnSimulationTasksDao handsOnSimulationTasksDao;
@Autowired private HandsOnSimulationTasksFileService handsOnSimulationTasksFileService;
@Autowired private HandsOnSimulationTasksAssessmentService handsOnSimulationTasksAssessmentService;
@Autowired private ResourcesQuestionDao mergeResourcesQuestionService;
@Autowired private ResourcesQuestionDao resourcesQuestionDao;
public PageQuery<HandsOnSimulationTasks>queryByCondition(PageQuery query){
//查询任务排序
query.setOrderBy("task_order+0, add_time");
@ -319,7 +315,7 @@ public class HandsOnSimulationTasksService extends CoreBaseService<HandsOnSimula
}
HandsOnSimulationTasks info = taskId == null ? null : getInfo(taskId);
List<ResourcesQuestion> resourcesQuestions = StringUtils.isNotEmpty(problemIds)
? mergeResourcesQuestionService.getByIds(problemIds) : null;
? resourcesQuestionDao.getByIds(problemIds) : null;
if (CollectionUtils.isEmpty(resourcesQuestions)) {
return new ArrayList<>();
}
@ -358,4 +354,27 @@ public class HandsOnSimulationTasksService extends CoreBaseService<HandsOnSimula
});
return list;
}
public List<HandsOnSimulationTasks> getValuesByQueryNotPermission(HandsOnSimulationTasksQuery tasksQuery) {
return handsOnSimulationTasksDao.getValuesByQueryNotPermission(tasksQuery);
}
public JsonResult<List<ResourcesQuestion>> getHandsOnTaskkTheoryCenterByTaskId(Long taskId, CoreUser coreUser) {
HandsOnSimulationTasksQuery tasksQuery = new HandsOnSimulationTasksQuery();
tasksQuery.setTaskId(taskId);
List<HandsOnSimulationTasks> tasksList = handsOnSimulationTasksDao.getValuesByQueryNotPermission(tasksQuery);
if (CollectionUtils.isEmpty(tasksList)) {
return JsonResult.fail();
}
HandsOnSimulationTasks tasks = tasksList.get(0);
String taskList = tasks.getTaskList();
ResourcesQuestionQuery questionQuery = new ResourcesQuestionQuery();
questionQuery.setResourcesQuestionIds(taskList);
questionQuery.setQuestionStatus(1);
List<ResourcesQuestion> resourcesQuestions = resourcesQuestionDao.getValuesByQueryNotWithPermission(questionQuery);
if (CollectionUtils.isEmpty(resourcesQuestions)) {
return JsonResult.success(resourcesQuestions);
}
return JsonResult.success(resourcesQuestions);
}
}

@ -1392,4 +1392,15 @@ public class ResourcesQuestionService extends CoreBaseService<ResourcesQuestion>
return resourcesQuestionDao.getGroupQuestionTypeCountAndSelectInfo(courseInfoId, questionSettingId);
}
public List<ResourcesQuestion> getChapterExerciseQuestionList(Long courseInfoId){
return resourcesQuestionDao.createLambdaQuery()
.andEq(ResourcesQuestion::getCourseInfoId,courseInfoId)
.andEq(ResourcesQuestion::getQuestionStatus,1)
.select();
}
}

@ -445,7 +445,7 @@ public class StudentHandsOnTaskStepService extends CoreBaseService<StudentHandsO
assessmentQuery.setHandsOnTaskId(taskId);
List<TeacherOpenCourseHandsOnSimulationTasksAssessment> assessmentList = assessmentService.getValuesByQueryNotWithPermission(assessmentQuery);
if (CollectionUtils.isEmpty(assessmentList)) {
return JsonResult.fail();
return JsonResult.success();
}
TeacherOpenCourseHandsOnSimulationTasksQuery tasksQuery = new TeacherOpenCourseHandsOnSimulationTasksQuery();
tasksQuery.setTaskId(taskId);

@ -16,7 +16,6 @@ import com.ibeetl.admin.core.util.TimeTool;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.admin.core.web.JsonReturnCode;
import com.ibeetl.jlw.dao.StudentHandsOnTaskTheoryDao;
import com.ibeetl.jlw.dao.TeacherOpenCourseHandsOnSimulationTasksDao;
import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.entity.dto.FillAndAnalysisScoreDTO;
import com.ibeetl.jlw.entity.vo.TeacherOpenCourseMergeResourcesQuestionVO;
@ -60,7 +59,7 @@ public class StudentHandsOnTaskTheoryService extends CoreBaseService<StudentHand
@Autowired private StudentHandsOnTaskTheoryDao studentHandsOnTaskTheoryDao;
@Autowired private StudentService studentService;
@Autowired private TeacherOpenCourseHandsOnSimulationTasksDao tasksService;
@Autowired private TeacherOpenCourseHandsOnSimulationTasksService teacherOpenCourseHandsOnSimulationTasksService;
@Autowired private TeacherOpenCourseMergeResourcesQuestionService questionService;
//存储学生临时答题
public static ConcurrentHashMap<String, Map<String, Object>> questions = new ConcurrentHashMap<>();
@ -391,7 +390,7 @@ public class StudentHandsOnTaskTheoryService extends CoreBaseService<StudentHand
.andEq(StudentHandsOnTaskTheory::getStudentId, student.getStudentId()).select();
TeacherOpenCourseHandsOnSimulationTasksQuery tasksQuery = new TeacherOpenCourseHandsOnSimulationTasksQuery();
tasksQuery.setTaskId(taskId);
List<TeacherOpenCourseHandsOnSimulationTasks> tasksList = tasksService.getValuesByQueryNotWithPermission(tasksQuery);
List<TeacherOpenCourseHandsOnSimulationTasks> tasksList = teacherOpenCourseHandsOnSimulationTasksService.getValuesByQueryNotWithPermission(tasksQuery);
if (CollectionUtils.isEmpty(tasksList)) {
return JsonResult.fail();
}
@ -446,13 +445,9 @@ public class StudentHandsOnTaskTheoryService extends CoreBaseService<StudentHand
public JsonResult<List<TeacherOpenCourseMergeResourcesQuestion>> getHandsOnTaskkTheoryCenterByTaskId(Long taskId, CoreUser coreUser) {
//查询登录用的学生id
if (!coreUser.isStudent()) {
return null;
}
TeacherOpenCourseHandsOnSimulationTasksQuery tasksQuery = new TeacherOpenCourseHandsOnSimulationTasksQuery();
tasksQuery.setTaskId(taskId);
List<TeacherOpenCourseHandsOnSimulationTasks> tasksList = tasksService.getValuesByQueryNotWithPermission(tasksQuery);
List<TeacherOpenCourseHandsOnSimulationTasks> tasksList = teacherOpenCourseHandsOnSimulationTasksService.getValuesByQueryNotWithPermission(tasksQuery);
if (CollectionUtils.isEmpty(tasksList)) {
return JsonResult.fail();
}
@ -461,6 +456,7 @@ public class StudentHandsOnTaskTheoryService extends CoreBaseService<StudentHand
TeacherOpenCourseMergeResourcesQuestionQuery questionQuery = new TeacherOpenCourseMergeResourcesQuestionQuery();
questionQuery.setTeacherOpenCourseMergeResourcesQuestionIdPlural(taskList);
questionQuery.setQuestionStatus(1);
List<TeacherOpenCourseMergeResourcesQuestion> resourcesQuestions = questionService.getValuesByQueryNotWithPermission(questionQuery);
if (CollectionUtils.isEmpty(resourcesQuestions)) {
return JsonResult.success(resourcesQuestions);
@ -513,7 +509,7 @@ public class StudentHandsOnTaskTheoryService extends CoreBaseService<StudentHand
TeacherOpenCourseHandsOnSimulationTasksQuery tasksQuery = new TeacherOpenCourseHandsOnSimulationTasksQuery();
tasksQuery.setTaskId(taskId);
List<TeacherOpenCourseHandsOnSimulationTasks> tasksList = tasksService.getValuesByQueryNotWithPermission(tasksQuery);
List<TeacherOpenCourseHandsOnSimulationTasks> tasksList = teacherOpenCourseHandsOnSimulationTasksService.getValuesByQueryNotWithPermission(tasksQuery);
if (CollectionUtils.isEmpty(tasksList)) {
return JsonResult.fail();
}

@ -387,7 +387,7 @@ public class TeacherOpenCourseHandsOnService extends CoreBaseService<TeacherOpen
}
/**
*
* FIXME
*
* @param teacherOpenCourseId
* @param coreUser
@ -497,7 +497,7 @@ public class TeacherOpenCourseHandsOnService extends CoreBaseService<TeacherOpen
}
/**
* --
* -- FIXME
*
* @param teacherOpenCourseId
* @param coreUser

@ -392,7 +392,7 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
}
/**
*
* FIXME
* <p>
*
*
@ -1076,8 +1076,6 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
*/
public List<ResourcesQuestionSnapshot> questionDetailBYCenter(@NotNull(message = "题目配置ID不能为空") final Long teacherOpenCourseQuestionSettingId, CoreUser coreUser) {
// 获取学生ID
final Student student = getStudent();
Assert.notNull(student, "非学生身份,无法获取题目!");
TeacherOpenCourseQuestionSetting setting = getInfo(teacherOpenCourseQuestionSettingId);
Assert.notNull(setting, "未查询到来源ID对应的题目");

@ -847,7 +847,7 @@ public class TeacherOpenCourseScoreDashboardService extends CoreBaseService<Teac
if (CollectionUtil.isNotEmpty(teacherOpenCourseChatLogList) && weight != null && StringUtils.isNotBlank(weight.getInteractionResultSetting())) {
BigDecimal totalChatScore = BigDecimal.ZERO;
//1留言2提问3回答
String interactionResultSetting = weight.getInteractionResultSetting();
String interactionResultSetting = ObjectUtil.defaultIfBlank(weight.getInteractionResultSetting(),"");
//回答分数处理
{

@ -477,4 +477,18 @@ public class CourseInfoController{
}
//
@GetMapping(API + "/queryChapterExerciseInfoList.do")
@ResponseBody
public JsonResult queryChapterExerciseInfoList(CourseInfoQuery courseInfoQuery,@SCoreUser CoreUser coreUser) {
if (courseInfoQuery.getCourseInfoId()==null){
return JsonResult.failMessage("课程ID不能为空");
}
return JsonResult.success(courseInfoService.queryChapterExerciseInfoList(courseInfoQuery.getPageQuery()));
}
}

@ -14,6 +14,7 @@ import com.ibeetl.jlw.entity.CourseInfo;
import com.ibeetl.jlw.entity.HandsOn;
import com.ibeetl.jlw.entity.HandsOnSimulationTasks;
import com.ibeetl.jlw.entity.vo.ResourcesCourseInfoAuthDetailsVO;
import com.ibeetl.jlw.entity.vo.StudentHandsOnVO;
import com.ibeetl.jlw.service.HandsOnService;
import com.ibeetl.jlw.service.HandsOnSimulationTasksService;
import com.ibeetl.jlw.service.UniversitiesCollegesJurisdictionCurriculumResourcesService;
@ -414,4 +415,10 @@ public class HandsOnController{
@GetMapping(API + "/getHandsListCenterByOpenCourseId.do")
public JsonResult getHandsListCenterByOpenCourseId(Long courseInfoId,@SCoreUser CoreUser coreUser) {
JsonResult<List<StudentHandsOnVO>> handsListCenterByOpenCourseId = handsOnService.getHandsListCenterByOpenCourseId(courseInfoId);
return JsonResult.success(handsListCenterByOpenCourseId);
}
}

@ -7,6 +7,7 @@ import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.file.FileService;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.jlw.entity.HandsOnSimulationTasks;
import com.ibeetl.jlw.entity.ResourcesQuestion;
import com.ibeetl.jlw.entity.vo.HandsOnTaskProblemVO;
import com.ibeetl.jlw.service.HandsOnSimulationTasksService;
import com.ibeetl.jlw.web.query.HandsOnSimulationTasksQuery;
@ -206,4 +207,17 @@ public class HandsOnSimulationTasksController{
return handsOnSimulationTasksService.getObjectiveProblem(problemIds, taskId);
}
/**
* ---
*
* @param taskId id
* @param coreUser
* @return myOptions
*/
@GetMapping(API + "/getHandsOnTaskTheoryCenterByTaskId")
public JsonResult<List<ResourcesQuestion>> getHandsOnTaskkTheoryCenterByTaskId(Long taskId, @SCoreUser CoreUser coreUser) {
return handsOnSimulationTasksService.getHandsOnTaskkTheoryCenterByTaskId(taskId, coreUser);
}
}

@ -772,4 +772,9 @@ public class ResourcesQuestionController{
return JsonResult.success(resourcesQuestionService.getQuestionTypeGroupInfoByOrgIdsAndCourseLabelTypes(courseInfoQuery, courseLabelTypePlural));
}
@GetMapping(API + "/getChapterExerciseQuestionList.do")
@ResponseBody
public JsonResult getChapterExerciseQuestionList(Long courseInfoId, @SCoreUser CoreUser coreUser) {
return JsonResult.success(resourcesQuestionService.getChapterExerciseQuestionList(courseInfoId));
}
}

@ -214,7 +214,6 @@ public class ResourcesQuestionSnapshotController extends BaseController {
public JsonResult<PageQuery> getQuestionTestInfoSupplyCenter(@Validated(ValidateConfig.ADD.class) TeacherOpenCourseQuestionTestSimpleInfoDTO dto,
@SCoreUser CoreUser coreUser) {
Assert.isTrue(coreUser.isStudent(), "非学生身份,无法获取数据!");
return JsonResult.success(resourcesQuestionSnapshotService.getQuestionTestInfoSupplyCenter(dto));
}

@ -489,7 +489,7 @@ public class StudentHandsOnTaskTheoryController {
}
/**
* --
* ---
*
* @param taskId id
* @param coreUser
@ -500,6 +500,8 @@ public class StudentHandsOnTaskTheoryController {
return studentHandsOnTaskTheoryService.getHandsOnTaskkTheoryCenterByTaskId(taskId, coreUser);
}
/**
*
*

@ -786,4 +786,19 @@ examCourseQuestionDO
@if(!isEmpty(userId)){
and t.user_id =#userId#
@}
queryChapterExerciseInfoList
===
* 查询章节练习题目信息
select
@pageTag(){
t.*,
(select count(*) from resources_question rq where rq.course_info_id = t.course_info_id) as question_count
@}
from course_info t
where t.course_info_parent_id = #courseInfoId#
and t.course_info_type=2
and t.course_info_status = 1
and (select count(*) from resources_question rq where rq.course_info_id = t.course_info_id) > 0
order by t.order_index asc

@ -388,3 +388,68 @@ getValuesByQuery
getValuesByQueryNotPermission
===
* 根据不为空的参数进行查询
select t.*
from hands_on_simulation_tasks t
where 1=1
@if(!isEmpty(taskId)){
and t.task_id =#taskId#
@}
@if(!isEmpty(taskIdPlural)){
and find_in_set(t.task_id,#taskIdPlural#)
@}
@if(!isEmpty(handsOnId)){
and t.hands_on_id =#handsOnId#
@}
@if(!isEmpty(handsOnIdPlural)){
and t.hands_on_id in (#text(handsOnIdPlural)#)
@}
@if(!isEmpty(taskType)){
and t.task_type =#taskType#
@}
@if(!isEmpty(taskTitle)){
and t.task_title =#taskTitle#
@}
@if(!isEmpty(taskScore)){
and t.task_score =#taskScore#
@}
@if(!isEmpty(taskOrder)){
and t.task_order =#taskOrder#
@}
@if(!isEmpty(taskStatus)){
and t.task_status =#taskStatus#
@}
@if(!isEmpty(assessmentRequirements)){
and t.assessment_requirements =#assessmentRequirements#
@}
@if(!isEmpty(assessmentTime)){
and t.assessment_time =#assessmentTime#
@}
@if(!isEmpty(assessmentContent)){
and t.assessment_content =#assessmentContent#
@}
@if(!isEmpty(fileUrl)){
and t.file_url =#fileUrl#
@}
@if(!isEmpty(taskList)){
and t.task_list =#taskList#
@}
@if(!isEmpty(orgId)){
and t.org_id =#orgId#
@}
@if(!isEmpty(orgIdPlural)){
and find_in_set(t.org_id,#orgIdPlural#)
@}
@if(!isEmpty(userId)){
and t.user_id =#userId#
@}
@if(!isEmpty(userIdPlural)){
and find_in_set(t.user_id,#userIdPlural#)
@}
@if(!isEmpty(addTime)){
and t.add_time =#addTime#
@}

@ -846,6 +846,5 @@ getQuestionTestInfoSupplyCenter
where tb.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
and tb.question_status = 1) > 0
@pageIgnoreTag() {
ORDER BY
CONVERT(regexp_replace ( t.teacher_open_course_question_setting_name, '[^0-9]+', '' ),unsigned) asc
ORDER BY t.teacher_open_course_question_setting_id desc
@}

Loading…
Cancel
Save