教师端查询题目的学生分数列表,支持查询其他提交类型

beetlsql3-dev
Mlxa0324 2 years ago
parent bdeb0bd2b7
commit bc4e4bcdcc

@ -3,6 +3,7 @@ package com.ibeetl.jlw.entity;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ibeetl.admin.core.entity.BaseEntity;
import com.ibeetl.jlw.enums.QuestionLogAddTypeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.beetl.sql.annotation.entity.Auto;
@ -34,8 +35,8 @@ public class GeneralQuestionLogScoreInfo extends BaseEntity {
// 开课题目设置ID
private Long generalQuestionSettingId;
// 学生ID
private Long studentId;
// 查询指定的题目分数
private QuestionLogAddTypeEnum questionLogAddType;
// @FetchOne("studentId")
// @DictDeep
@ -60,7 +61,7 @@ public class GeneralQuestionLogScoreInfo extends BaseEntity {
@FetchSql("select count(1) from general_question_log t " +
"where 1 = 1 " +
"and t.general_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" +
"and t.general_question_log_status = 1 and t.question_log_add_type = #questionLogAddType# \n" +
"@if(!isEmpty(studentId)) { \n" +
"and t.student_id = #studentId# \n" +
"@} \n" +
@ -71,7 +72,7 @@ public class GeneralQuestionLogScoreInfo extends BaseEntity {
// 答错数量
@FetchSql("select count(1) from general_question_log t " +
"where t.general_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" +
"where t.general_question_log_status = 1 and t.question_log_add_type = #questionLogAddType# \n" +
"@if(!isEmpty(studentId)) { \n" +
"and t.student_id = #studentId# \n" +
"@} \n" +
@ -83,7 +84,7 @@ public class GeneralQuestionLogScoreInfo extends BaseEntity {
// 总得分
@FetchSql("select sum(IFNULL(t.student_score, 0)) as total_score " +
"from general_question_log t " +
"where t.general_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" +
"where t.general_question_log_status = 1 and t.question_log_add_type = #questionLogAddType# \n" +
"@if(!isEmpty(studentId)) { \n" +
"and t.student_id = #studentId# \n" +
"@} \n" +
@ -102,6 +103,7 @@ public class GeneralQuestionLogScoreInfo extends BaseEntity {
"@if(!isEmpty(studentId)) { \n" +
"and t.student_id = #studentId# \n" +
"@} \n" +
"and t.question_log_add_type = #questionLogAddType# " +
"and t.general_question_setting_id = #generalQuestionSettingId# "
)
private List<GeneralQuestionLog> questionLogList;
@ -111,7 +113,8 @@ public class GeneralQuestionLogScoreInfo extends BaseEntity {
*/
@FetchSql(value = "SELECT max(TIMEDIFF( t.general_question_log_update_time , t.general_question_log_add_time )) as finish_time " +
"FROM general_question_log t " +
"WHERE t.general_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" +
"WHERE t.general_question_log_status = 1 " +
"and t.question_log_add_type = #questionLogAddType# \n" +
"@if(!isEmpty(studentId)) { \n" +
"and t.student_id = #studentId# \n" +
"@} \n" +
@ -124,7 +127,7 @@ public class GeneralQuestionLogScoreInfo extends BaseEntity {
// */
// @FetchSql(value = "SELECT max(ifnull(t.general_question_log_finish_time , 0)) as finish_time " +
// "FROM general_question_log t " +
// "WHERE t.general_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" +
// "WHERE t.general_question_log_status = 1 and t.question_log_add_type = #questionLogAddType# \n" +
// "@if(!isEmpty(studentId)) { \n" +
// "and t.student_id = #studentId# \n" +
// "@} \n" +

@ -3,6 +3,7 @@ package com.ibeetl.jlw.entity;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ibeetl.admin.core.entity.BaseEntity;
import com.ibeetl.jlw.enums.QuestionLogAddTypeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.beetl.sql.annotation.entity.Auto;
@ -36,6 +37,10 @@ public class TeacherOpenCourseQuestionLogScoreInfo extends BaseEntity {
// 学生ID
private Long studentId;
// 题目提交类型
private QuestionLogAddTypeEnum questionAddType;
// @FetchOne("studentId")
// @DictDeep
@ -60,7 +65,7 @@ public class TeacherOpenCourseQuestionLogScoreInfo extends BaseEntity {
@FetchSql("select sum( ifnull( t.student_score > 0 , 0)) from teacher_open_course_question_log t " +
"where 1 = 1 " +
"and t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" +
"and t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = #questionLogAddType# \n" +
"@if(!isEmpty(studentId)) { \n" +
"and t.student_id = #studentId# \n" +
"@} \n" +
@ -70,7 +75,7 @@ public class TeacherOpenCourseQuestionLogScoreInfo extends BaseEntity {
// 答错数量
@FetchSql("select sum( ifnull( t.student_score <= 0 , 0)) from teacher_open_course_question_log t " +
"where t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" +
"where t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = #questionLogAddType# \n" +
"@if(!isEmpty(studentId)) { \n" +
"and t.student_id = #studentId# \n" +
"@} \n" +
@ -81,7 +86,7 @@ public class TeacherOpenCourseQuestionLogScoreInfo extends BaseEntity {
// 总得分
@FetchSql("select sum( IFNULL(t.student_score, 0) ) as total_score " +
"from teacher_open_course_question_log t " +
"where t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" +
"where t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = #questionLogAddType# \n" +
"@if(!isEmpty(studentId)) { \n" +
"and t.student_id = #studentId# \n" +
"@} \n" +
@ -99,6 +104,7 @@ public class TeacherOpenCourseQuestionLogScoreInfo extends BaseEntity {
"@if(!isEmpty(studentId)) { \n" +
"and t.student_id = #studentId# \n" +
"@} \n" +
"and t.question_log_add_type = #questionLogAddType# " +
"and t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# "
)
private List<TeacherOpenCourseQuestionLog> questionLogList;
@ -108,7 +114,7 @@ public class TeacherOpenCourseQuestionLogScoreInfo extends BaseEntity {
*/
@FetchSql(value = "SELECT max(TIMEDIFF( t.teacher_open_course_question_log_update_time , t.teacher_open_course_question_log_add_time )) as finish_time " +
"FROM teacher_open_course_question_log t " +
"WHERE t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" +
"WHERE t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = #questionLogAddType# \n" +
"@if(!isEmpty(studentId)) { \n" +
"and t.student_id = #studentId# \n" +
"@} \n" +
@ -121,7 +127,7 @@ public class TeacherOpenCourseQuestionLogScoreInfo extends BaseEntity {
// */
// @FetchSql(value = "SELECT max(ifnull(t.teacher_open_course_question_log_finish_time , 0)) as finish_time " +
// "FROM teacher_open_course_question_log t " +
// "WHERE t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" +
// "WHERE t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = #questionLogAddType# \n" +
// "@if(!isEmpty(studentId)) { \n" +
// "and t.student_id = #studentId# \n" +
// "@} \n" +

@ -2,6 +2,7 @@ package com.ibeetl.jlw.entity.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.ibeetl.admin.core.web.query.PageParam;
import com.ibeetl.jlw.enums.QuestionLogAddTypeEnum;
import com.ibeetl.jlw.enums.ResourcesQuestionSnapshotFromTypeEnum;
import lombok.*;
import lombok.experimental.Accessors;
@ -34,6 +35,12 @@ public class GeneralQuestionTestSimpleInfoDTO extends PageParam {
@NotNull(message = "题目配置类型不能为空!")
private ResourcesQuestionSnapshotFromTypeEnum generalQuestionSettingType;
/**
*
*
*/
private QuestionLogAddTypeEnum questionLogAddType;
}

@ -3,6 +3,7 @@ package com.ibeetl.jlw.entity.dto;
import cn.jlw.validate.ValidateConfig;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.ibeetl.admin.core.web.query.PageParam;
import com.ibeetl.jlw.enums.QuestionLogAddTypeEnum;
import com.ibeetl.jlw.enums.ResourcesQuestionSnapshotFromTypeEnum;
import lombok.*;
import lombok.experimental.Accessors;
@ -37,6 +38,12 @@ public class TeacherOpenCourseQuestionTestSimpleInfoDTO extends PageParam {
@NotNull(message = "题目配置类型不能为空!", groups = ValidateConfig.ADD.class)
private ResourcesQuestionSnapshotFromTypeEnum teacherOpenCourseQuestionSettingType;
/**
*
*
*/
private QuestionLogAddTypeEnum questionLogAddType;
}

@ -30,7 +30,15 @@ public enum QuestionLogAddTypeEnum {
LOCK(2, "锁定题目", "题目在选中答案以后,无法更改选项,这个时候需要锁定状态"),
FINALLY_SUBMIT(3,"最终提交", "简单理解就是交卷"),
// TODO 暂时没用到,后面估计会用
RE_EXAM_VOIDED(4, "申请重考", "标记这套试卷作废,目前还没用到这个枚举")
RE_EXAM_VOIDED(4, "申请重考", "标记这套试卷作废,目前还没用到这个枚举"),
// 错题练习
ERROR_TEST_PRE_SUBMIT(100, "错题练习-预提交", "错题练习-预提交"),
ERROR_TEST_FINALLY_SUBMIT(101, "错题练习-最终提交", "错题练习-最终提交"),
// 收藏夹练习
TUCK_PRE_SUBMIT(200, "收藏夹练习-预提交", "错题练习-预提交"),
TUCK_FINALLY_SUBMIT(201, "收藏夹练习-预提交", "错题练习-最终提交")
;
final private Integer code;

@ -669,4 +669,8 @@ public class GeneralQuestionSettingService extends CoreBaseService<GeneralQuesti
}
}
public Object errorQuestionTest(Long questionSettingIds, Student student) {
Assert.notNull(student, "改接口只能学生访问");
return null;
}
}

@ -20,6 +20,7 @@ import com.ibeetl.jlw.entity.dto.GeneralQuestionTestSimpleInfoDTO;
import com.ibeetl.jlw.entity.dto.QuestionSettingDTO;
import com.ibeetl.jlw.entity.vo.GeneralQuestionTestSimpleInfoVO;
import com.ibeetl.jlw.enums.BusinessCourseInfoEnum;
import com.ibeetl.jlw.enums.QuestionLogAddTypeEnum;
import com.ibeetl.jlw.web.query.GeneralResourcesQuestionSnapshotQuery;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@ -42,8 +43,10 @@ import java.io.*;
import java.math.BigDecimal;
import java.util.*;
import static cn.hutool.core.util.ObjectUtil.defaultIfNull;
import static cn.jlw.util.CacheUserUtil.getStudent;
import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue;
import static com.ibeetl.jlw.enums.QuestionLogAddTypeEnum.FINALLY_SUBMIT;
/**
* Service
@ -432,10 +435,12 @@ public class GeneralResourcesQuestionSnapshotService extends CoreBaseService<Gen
* @param query ID
* @return
*/
public PageQuery<GeneralQuestionTestSimpleInfoVO> getQuestionTestSimpleInfo(GeneralQuestionTestSimpleInfoDTO query) {
public PageQuery<GeneralQuestionTestSimpleInfoVO> getQuestionTestSimpleInfo(@NotNull GeneralQuestionTestSimpleInfoDTO query) {
Student student = getStudent();
Assert.notNull(student, "该接口只允许学生访问");
PageQuery pageQuery = query.getPageQuery(); pageQuery.setPara("studentId", student.getStudentId());
// 默认只查询普通最终提交
query.setQuestionLogAddType(defaultIfNull(query.getQuestionLogAddType(), FINALLY_SUBMIT));
PageQuery<GeneralQuestionTestSimpleInfoVO> questionTestSimpleInfo = generalResourcesQuestionSnapshotDao.getQuestionTestSimpleInfo(pageQuery);
dictParser(questionTestSimpleInfo.getList());
return questionTestSimpleInfo;
@ -445,10 +450,12 @@ public class GeneralResourcesQuestionSnapshotService extends CoreBaseService<Gen
* -
*
*
* @param questionSettingId ID
* @param questionSettingId ID
* @param questionAddType
* @return
*/
public GeneralQuestionLogScoreInfo getScoreInfo(@NotNull(message = "开课题目配置ID不能为空") final Long questionSettingId) {
public GeneralQuestionLogScoreInfo getScoreInfo(@NotNull(message = "开课题目配置ID不能为空") final Long questionSettingId,
@NotNull(message = "题目提交类型不能为空!") QuestionLogAddTypeEnum questionAddType) {
// 查询学生身份
Student student = getStudent();
@ -462,9 +469,8 @@ public class GeneralResourcesQuestionSnapshotService extends CoreBaseService<Gen
// 查询符合条件的实体
GeneralQuestionLogScoreInfo scoreInfo = sqlManager.executeQueryOne(
new SQLReady("SELECT " +
"? as general_question_setting_id, " +
"? as student_id ", questionSettingId, studentId), GeneralQuestionLogScoreInfo.class);
new SQLReady("SELECT ? as general_question_setting_id, ? as student_id ? as question_add_type",
questionSettingId, studentId, questionAddType), GeneralQuestionLogScoreInfo.class);
dictParser(scoreInfo);
return scoreInfo;
}

@ -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.QuestionLogAddTypeEnum;
import com.ibeetl.jlw.web.query.ResourcesQuestionSnapshotQuery;
import com.ibeetl.jlw.web.query.TeacherOpenCourseQuestionSettingQuery;
import lombok.extern.slf4j.Slf4j;
@ -42,7 +43,9 @@ import java.util.function.Consumer;
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.jlw.enums.QuestionLogAddTypeEnum.FINALLY_SUBMIT;
/**
* Service
@ -443,10 +446,12 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService<ResourcesQ
*
*
* @param questionSettingId ID
* @param questionAddType
* @return
*/
public TeacherOpenCourseQuestionLogScoreInfo getScoreInfo(
@NotNull(message = "开课题目配置ID不能为空") final Long questionSettingId) {
@NotNull(message = "开课题目配置ID不能为空") final Long questionSettingId,
@NotNull(message = "题目提交类型不能为空!") QuestionLogAddTypeEnum questionAddType) {
// 查询学生身份
Student student = getStudent();
@ -459,9 +464,8 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService<ResourcesQ
// 给实体类传参数剩下来的交给Fetch 来处理
// 查询符合条件的实体
TeacherOpenCourseQuestionLogScoreInfo scoreInfo = sqlManager.executeQueryOne(
new SQLReady("SELECT " +
"? as teacher_open_course_question_setting_id, " +
"? as student_id ", questionSettingId, studentId), TeacherOpenCourseQuestionLogScoreInfo.class);
new SQLReady("SELECT ? as teacher_open_course_question_setting_id, ? as student_id ",
questionSettingId, studentId, questionAddType), TeacherOpenCourseQuestionLogScoreInfo.class);
dictParser(scoreInfo);
return scoreInfo;
}
@ -471,10 +475,12 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService<ResourcesQ
* @param query ID
* @return
*/
public PageQuery<TeacherOpenCourseQuestionTestSimpleInfoVO> getQuestionTestSimpleInfo(TeacherOpenCourseQuestionTestSimpleInfoDTO query) {
public PageQuery<TeacherOpenCourseQuestionTestSimpleInfoVO> getQuestionTestSimpleInfo(@NotNull TeacherOpenCourseQuestionTestSimpleInfoDTO query) {
Student student = getStudent();
Assert.notNull(student, "该接口只允许学生访问");
PageQuery pageQuery = query.getPageQuery(); pageQuery.setPara("studentId", student.getStudentId());
// 默认只查询普通最终提交
query.setQuestionLogAddType(defaultIfNull(query.getQuestionLogAddType(), FINALLY_SUBMIT));
PageQuery<TeacherOpenCourseQuestionTestSimpleInfoVO> questionTestSimpleInfo = resourcesQuestionSnapshotDao.getQuestionTestSimpleInfo(pageQuery);
dictParser(questionTestSimpleInfo.getList());
return questionTestSimpleInfo;

@ -808,4 +808,11 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
Assert.isTrue(isZeroCount, notSubmitThrowMessage);
}
}
public Object errorQuestionTest(@NotNull(message = "题目配置ID不能为空") Long questionSettingId, Student student) {
Assert.notNull(student, "改接口只能学生访问");
final Long studentId = student.getStudentId();
return null;
}
}

@ -45,6 +45,7 @@ import java.util.List;
import java.util.Map;
import static cn.hutool.core.util.ObjectUtil.defaultIfNull;
import static cn.jlw.util.CacheUserUtil.getStudent;
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getCurrentOrg;
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
@ -141,6 +142,21 @@ public class GeneralQuestionSettingController{
return JsonResult.success(generalQuestionSettingService.questionDetail(generalQuestionSettingId, fromTypeEnum));
}
/**
* : <br>
*
*
* @param questionSettingIds
* @param coreUser
* @return {@link JsonResult}
* @Author: 87966
* @Date: 2022/12/1 9:27
*/
@PostMapping(API + "/errorQuestionTest.do")
public JsonResult errorQuestionTest(Long questionSettingIds, @SCoreUser CoreUser coreUser){
return JsonResult.success(generalQuestionSettingService.errorQuestionTest(questionSettingIds, getStudent()));
}
/**
*
* @param ids

@ -15,6 +15,7 @@ import com.ibeetl.jlw.entity.FileEntity;
import com.ibeetl.jlw.entity.GeneralQuestionLogScoreInfo;
import com.ibeetl.jlw.entity.GeneralResourcesQuestionSnapshot;
import com.ibeetl.jlw.entity.dto.GeneralQuestionTestSimpleInfoDTO;
import com.ibeetl.jlw.enums.QuestionLogAddTypeEnum;
import com.ibeetl.jlw.service.GeneralResourcesQuestionSnapshotService;
import com.ibeetl.jlw.web.query.GeneralResourcesQuestionSnapshotQuery;
import org.apache.commons.lang3.StringUtils;
@ -28,10 +29,7 @@ import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
@ -100,11 +98,13 @@ public class GeneralResourcesQuestionSnapshotController{
/**
* -
*
*
*
*
*
* @param questionSettingId ID
* @param questionAddType
* @param coreUser
* @return
*/
@ -112,9 +112,25 @@ public class GeneralResourcesQuestionSnapshotController{
@ResponseBody
public JsonResult<GeneralQuestionLogScoreInfo> getScoreInfoDo(
Long questionSettingId,
@RequestParam(required = false, defaultValue = "FINALLY_SUBMIT") QuestionLogAddTypeEnum questionAddType,
@SCoreUser
CoreUser coreUser) {
return JsonResult.success(generalResourcesQuestionSnapshotService.getScoreInfo(questionSettingId));
return JsonResult.success(generalResourcesQuestionSnapshotService.getScoreInfo(questionSettingId, questionAddType));
}
/**
* -
*
*
* @param dto
* @param coreUser
* @return
*/
@PostMapping(API + "/getQuestionTestSimpleInfo.do")
public JsonResult<PageQuery> getQuestionTestSimpleInfoDo(@Validated GeneralQuestionTestSimpleInfoDTO dto,
@SCoreUser CoreUser coreUser) {
Assert.isTrue(coreUser.isStudent(), "非学生身份,无法获取数据!");
return JsonResult.success(generalResourcesQuestionSnapshotService.getQuestionTestSimpleInfo(dto));
}
@ -447,18 +463,24 @@ public class GeneralResourcesQuestionSnapshotController{
}
/**
* -
* -
*
*
*
*
* @param dto
* @param questionSettingId ID
* @param questionAddType
* @param coreUser
* @return
*/
@PostMapping(API + "/getQuestionTestSimpleInfo.do")
public JsonResult<PageQuery> getQuestionTestSimpleInfoDo(@Validated GeneralQuestionTestSimpleInfoDTO dto,
@SCoreUser CoreUser coreUser) {
Assert.isTrue(coreUser.isStudent(), "非学生身份,无法获取数据!");
return JsonResult.success(generalResourcesQuestionSnapshotService.getQuestionTestSimpleInfo(dto));
@PostMapping(MODEL + "/getScoreInfo.json")
@Function("teacherOpenCourseQuestionLog.query")
@ResponseBody
public JsonResult<GeneralQuestionLogScoreInfo> getScoreInfo(
Long questionSettingId,
@RequestParam(required = false, defaultValue = "FINALLY_SUBMIT") QuestionLogAddTypeEnum questionAddType,
@SCoreUser
CoreUser coreUser) {
return JsonResult.success(generalResourcesQuestionSnapshotService.getScoreInfo(questionSettingId, questionAddType));
}
}

@ -14,6 +14,7 @@ import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionLogScoreInfo;
import com.ibeetl.jlw.entity.dto.TeacherOpenCourseQuestionTestDetailDTO;
import com.ibeetl.jlw.entity.dto.TeacherOpenCourseQuestionTestSimpleInfoDTO;
import com.ibeetl.jlw.entity.vo.TeacherOpenCourseQuestionTestDetailVO;
import com.ibeetl.jlw.enums.QuestionLogAddTypeEnum;
import com.ibeetl.jlw.service.ResourcesQuestionSnapshotService;
import com.ibeetl.jlw.web.query.ResourcesQuestionSnapshotQuery;
import org.apache.commons.lang3.StringUtils;
@ -23,10 +24,7 @@ import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import java.io.IOException;
@ -113,9 +111,10 @@ public class ResourcesQuestionSnapshotController extends BaseController {
@ResponseBody
public JsonResult<TeacherOpenCourseQuestionLogScoreInfo> getScoreInfoDo(
Long questionSettingId,
@RequestParam(required = false, defaultValue = "FINALLY_SUBMIT") QuestionLogAddTypeEnum questionAddType,
@SCoreUser
CoreUser coreUser) {
return JsonResult.success(resourcesQuestionSnapshotService.getScoreInfo(questionSettingId));
return JsonResult.success(resourcesQuestionSnapshotService.getScoreInfo(questionSettingId, questionAddType));
}
/**
@ -298,7 +297,8 @@ public class ResourcesQuestionSnapshotController extends BaseController {
*
*
*
* @param teacherOpenCourseQuestionSettingId ID
* @param questionSettingId ID
* @param questionAddType
* @param coreUser
* @return
*/
@ -306,10 +306,11 @@ public class ResourcesQuestionSnapshotController extends BaseController {
@Function("teacherOpenCourseQuestionLog.query")
@ResponseBody
public JsonResult<TeacherOpenCourseQuestionLogScoreInfo> getScoreInfo(
Long teacherOpenCourseQuestionSettingId,
Long questionSettingId,
@RequestParam(required = false, defaultValue = "FINALLY_SUBMIT") QuestionLogAddTypeEnum questionAddType,
@SCoreUser
CoreUser coreUser) {
return JsonResult.success(resourcesQuestionSnapshotService.getScoreInfo(teacherOpenCourseQuestionSettingId));
return JsonResult.success(resourcesQuestionSnapshotService.getScoreInfo(questionSettingId, questionAddType));
}
/**

@ -139,6 +139,21 @@ public class TeacherOpenCourseQuestionSettingController{
return JsonResult.success(teacherOpenCourseQuestionSettingService.analysis(teacherOpenCourseId, questionSettingType));
}
/**
* : <br>
*
*
* @param questionSettingId IDID
* @param coreUser
* @return {@link JsonResult}
* @Author: 87966
* @Date: 2022/12/1 9:27
*/
@PostMapping(API + "/errorQuestionTest.do")
public JsonResult errorQuestionTest(Long questionSettingId, @SCoreUser CoreUser coreUser){
return JsonResult.success(teacherOpenCourseQuestionSettingService.errorQuestionTest(questionSettingId, getStudent()));
}
/**
*
* @param ids

@ -812,7 +812,7 @@ getQuestionTestSimpleInfo
SELECT
sum(
@ // 已经交卷的状态才算分
CASE WHEN ta.question_log_add_type = 'FINALLY_SUBMIT' THEN IFNULL( ta.student_score, 0 ) ELSE 0 END
CASE WHEN ta.question_log_add_type = #questionLogAddType# THEN IFNULL( ta.student_score, 0 ) ELSE 0 END
)
FROM
general_question_log ta
@ -841,7 +841,7 @@ getQuestionTestSimpleInfo
tc.general_question_setting_id = t.general_question_setting_id
AND tc.general_question_log_status = 1
@ // 是否已交卷
AND tc.question_log_add_type = 'FINALLY_SUBMIT'
AND tc.question_log_add_type = #questionLogAddType#
LIMIT 1
) AS is_finished,
(
@ -851,7 +851,7 @@ getQuestionTestSimpleInfo
@if(!isEmpty(studentId)) {
and td.student_id = #studentId#
@}
and td.question_log_add_type = 'FINALLY_SUBMIT'
and td.question_log_add_type = #questionLogAddType#
and td.general_question_setting_id = t.general_question_setting_id
AND td.general_question_log_update_time IS NOT NULL
) as finish_time,
@ -862,7 +862,7 @@ getQuestionTestSimpleInfo
@if(!isEmpty(studentId)) {
and te.student_id = #studentId#
@}
and te.question_log_add_type = 'FINALLY_SUBMIT'
and te.question_log_add_type = #questionLogAddType#
and te.general_question_setting_id = t.general_question_setting_id
AND te.general_question_log_update_time IS NOT NULL
) as finish_second_time,
@ -874,7 +874,7 @@ getQuestionTestSimpleInfo
@if(!isEmpty(studentId)) {
and tf.student_id = #studentId#
@}
and tf.question_log_add_type = 'FINALLY_SUBMIT'
and tf.question_log_add_type = #questionLogAddType#
and tf.general_question_setting_id = t.general_question_setting_id
AND tf.general_question_log_update_time IS NOT NULL
) as correct_rate

@ -600,7 +600,7 @@ getQuestionTestSimpleInfo
SELECT
sum(
@ // 已经交卷的状态才算分
CASE WHEN ta.question_log_add_type = 'FINALLY_SUBMIT' THEN IFNULL( ta.student_score, 0 ) ELSE 0 END
CASE WHEN ta.question_log_add_type = #questionLogAddType# THEN IFNULL( ta.student_score, 0 ) ELSE 0 END
)
FROM
teacher_open_course_question_log ta
@ -629,7 +629,7 @@ getQuestionTestSimpleInfo
tc.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
AND tc.teacher_open_course_question_log_status = 1
@ // 是否已交卷
AND tc.question_log_add_type = 'FINALLY_SUBMIT'
AND tc.question_log_add_type = #questionLogAddType#
LIMIT 1
) AS is_finished,
(
@ -639,7 +639,7 @@ getQuestionTestSimpleInfo
@if(!isEmpty(studentId)) {
and td.student_id = #studentId#
@}
and td.question_log_add_type = 'FINALLY_SUBMIT'
and td.question_log_add_type = #questionLogAddType#
and td.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
AND td.teacher_open_course_question_log_update_time IS NOT NULL
) as finish_time,
@ -650,7 +650,7 @@ getQuestionTestSimpleInfo
@if(!isEmpty(studentId)) {
and te.student_id = #studentId#
@}
and te.question_log_add_type = 'FINALLY_SUBMIT'
and te.question_log_add_type = #questionLogAddType#
and te.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
AND te.teacher_open_course_question_log_update_time IS NOT NULL
) as finish_second_time,
@ -662,7 +662,7 @@ getQuestionTestSimpleInfo
@if(!isEmpty(studentId)) {
and tf.student_id = #studentId#
@}
and tf.question_log_add_type = 'FINALLY_SUBMIT'
and tf.question_log_add_type = #questionLogAddType#
and tf.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
AND tf.teacher_open_course_question_log_update_time IS NOT NULL
) as correct_rate

Loading…
Cancel
Save