1、课程中心-章节练习
parent
38c074bddb
commit
a7e4a7630d
@ -0,0 +1,25 @@
|
||||
package com.ibeetl.jlw.dao;
|
||||
|
||||
import com.ibeetl.jlw.entity.StudentChapterQuestionLog;
|
||||
import com.ibeetl.jlw.web.query.StudentChapterQuestionLogQuery;
|
||||
import org.beetl.sql.mapper.BaseMapper;
|
||||
import org.beetl.sql.mapper.annotation.SqlResource;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资源管理-学生做题记录
|
||||
*/
|
||||
@Repository
|
||||
@SqlResource("jlw.studentChapterQuestionLog")
|
||||
public interface StudentChapterQuestionLogDao extends BaseMapper<StudentChapterQuestionLog> {
|
||||
|
||||
/**
|
||||
* 查询学习做题记录
|
||||
*
|
||||
* @param studentChapterQuestionLogQuery
|
||||
* @return
|
||||
*/
|
||||
List<StudentChapterQuestionLog> getValuesByQueryNotWithPermission(StudentChapterQuestionLogQuery studentChapterQuestionLogQuery);
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package com.ibeetl.jlw.web;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.jlw.Interceptor.SCoreUser;
|
||||
import com.ibeetl.admin.core.entity.CoreUser;
|
||||
import com.ibeetl.admin.core.web.JsonResult;
|
||||
import com.ibeetl.jlw.entity.StudentHandsOnTaskLog;
|
||||
import com.ibeetl.jlw.entity.dto.QuestionLogAddDTO;
|
||||
import com.ibeetl.jlw.service.StudentChapterQuestionLogService;
|
||||
import com.ibeetl.jlw.service.StudentHandsOnTaskLogService;
|
||||
import com.ibeetl.jlw.web.query.StudentHandsOnTaskLogQuery;
|
||||
import org.beetl.sql.core.engine.PageQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 学生章节-做题日志
|
||||
* 切记不要对非线程安全的静态变量进行写操作
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Validated
|
||||
public class StudentChapterQuestionLogController {
|
||||
|
||||
private static final String API = "/api/studentChapterQuestionLog";
|
||||
|
||||
|
||||
@Autowired
|
||||
private StudentChapterQuestionLogService studentChapterQuestionLogService;
|
||||
|
||||
|
||||
|
||||
/* 前端接口 */
|
||||
|
||||
/**
|
||||
* 课程中心章节练习-学生答题记录
|
||||
* @param questionLogAddDTO
|
||||
* @param coreUser
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(API + "/addStudentChapterQuestionLog.do")
|
||||
@ResponseBody
|
||||
public JsonResult<String> addStudentChapterQuestionLog(@RequestBody QuestionLogAddDTO questionLogAddDTO, @SCoreUser CoreUser coreUser) {
|
||||
if (null == coreUser) {
|
||||
return JsonResult.failMessage("请登录后再操作");
|
||||
} else {
|
||||
Assert.isTrue(coreUser.isStudent(), "非学生身份,无法提交!");
|
||||
studentChapterQuestionLogService.addStudentChapterQuestionLog(questionLogAddDTO,coreUser);
|
||||
return JsonResult.success();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 课程中心章节练习-学生答题统计
|
||||
* @param courseInfoId
|
||||
* @param courseType
|
||||
* @param coreUser
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(API + "/getStudentChapterGradeTotal.do")
|
||||
public JsonResult<Map<String, Object>> getStudentChapterGradeTotal(Long courseInfoId, Integer courseType, @SCoreUser CoreUser coreUser) {
|
||||
if (null == coreUser) {
|
||||
return JsonResult.failMessage("请登录后再操作");
|
||||
} else {
|
||||
return JsonResult.success(studentChapterQuestionLogService.getStudentChapterGradeTotal(courseInfoId,courseType));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
getValuesByQueryNotWithPermission
|
||||
===
|
||||
|
||||
* 根据不为空的参数进行查询(不包含权限)
|
||||
|
||||
select t.*
|
||||
from student_chapter_question_log t
|
||||
where 1=1
|
||||
@if(!isEmpty(studentChapterQuestionLogId)){
|
||||
and t.student_chapter_question_log_id =#studentChapterQuestionLogId#
|
||||
@}
|
||||
@if(!isEmpty(questionLogAnswer)){
|
||||
and t.question_log_answer =#questionLogAnswer#
|
||||
@}
|
||||
@if(!isEmpty(questionLogUploadFile)){
|
||||
and t.question_log_upload_file =#questionLogUploadFile#
|
||||
@}
|
||||
@if(!isEmpty(questionLogAddTime)){
|
||||
and t.question_log_add_time =#questionLogAddTime#
|
||||
@}
|
||||
@if(!isEmpty(questionLogStatus)){
|
||||
and t.question_log_status =#questionLogStatus#
|
||||
@}
|
||||
@if(!isEmpty(studentId)){
|
||||
and t.student_id =#studentId#
|
||||
@}
|
||||
@if(!isEmpty(questionLogAddType)){
|
||||
and t.question_log_add_type =#questionLogAddType#
|
||||
@}
|
||||
@if(!isEmpty(studentScore)){
|
||||
and t.student_score =#studentScore#
|
||||
@}
|
||||
@if(!isEmpty(questionType)){
|
||||
and t.question_type =#questionType#
|
||||
@}
|
||||
@if(!isEmpty(questionScore)){
|
||||
and t.question_score =#questionScore#
|
||||
@}
|
||||
@if(!isEmpty(questionStem)){
|
||||
and t.question_stem =#questionStem#
|
||||
@}
|
||||
@if(!isEmpty(questionOptionA)){
|
||||
and t.question_option_a =#questionOptionA#
|
||||
@}
|
||||
@if(!isEmpty(questionOptionB)){
|
||||
and t.question_option_b =#questionOptionB#
|
||||
@}
|
||||
@if(!isEmpty(questionOptionC)){
|
||||
and t.question_option_c =#questionOptionC#
|
||||
@}
|
||||
@if(!isEmpty(questionOptionD)){
|
||||
and t.question_option_d =#questionOptionD#
|
||||
@}
|
||||
@if(!isEmpty(questionOptionE)){
|
||||
and t.question_option_e =#questionOptionE#
|
||||
@}
|
||||
@if(!isEmpty(questionAnswer)){
|
||||
and t.question_answer =#questionAnswer#
|
||||
@}
|
||||
@if(!isEmpty(questionAnalysis)){
|
||||
and t.question_analysis =#questionAnalysis#
|
||||
@}
|
||||
@if(!isEmpty(isTuck)){
|
||||
and t.is_tuck =#isTuck#
|
||||
@}
|
||||
@if(!isEmpty(isErrorFavorite)){
|
||||
and t.is_error_favorite =#isErrorFavorite#
|
||||
@}
|
||||
@if(!isEmpty(resourcesQuestionLogUpdateTime)){
|
||||
and t.resources_question_log_update_time =#resourcesQuestionLogUpdateTime#
|
||||
@}
|
||||
@if(!isEmpty(resourcesQuestionLogFinishTime)){
|
||||
and t.resources_question_log_finish_time =#resourcesQuestionLogFinishTime#
|
||||
@}
|
||||
@if(!isEmpty(resourcesQuestionLogReply)){
|
||||
and t.resources_question_log_reply =#resourcesQuestionLogReply#
|
||||
@}
|
||||
@if(!isEmpty(userId)){
|
||||
and t.user_id =#userId#
|
||||
@}
|
||||
@if(!isEmpty(orgId)){
|
||||
and t.org_id =#orgId#
|
||||
@}
|
||||
@if(!isEmpty(courseType)){
|
||||
and t.course_type =#courseType#
|
||||
@}
|
||||
@if(!isEmpty(courseInfoId)){
|
||||
and t.course_info_id =#courseInfoId#
|
||||
@}
|
Loading…
Reference in New Issue