题目分析

beetlsql3-dev
Mlxa0324 2 years ago
parent 91e1608c42
commit def88e745a

@ -33,10 +33,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;
@ -67,7 +64,6 @@ public class QuestionLogSummaryController extends BaseController {
@Autowired private QuestionLogSummaryService questionLogSummaryService;
@Autowired FileService fileService;
/* 前端接口 */
@ -112,7 +108,7 @@ public class QuestionLogSummaryController extends BaseController {
* @return
*/
@PostMapping(API + "/analysis.do")
public JsonResult analysisDo(PageParam param, Long teacherOpenCourseId, ResourcesQuestionSnapshotFromTypeEnum questionSettingType, @SCoreUser CoreUser coreUser) {
public JsonResult analysisDo(PageParam param, Long teacherOpenCourseId, @RequestParam(required = false) ResourcesQuestionSnapshotFromTypeEnum questionSettingType, @SCoreUser CoreUser coreUser) {
PageQuery<Object> objectPageQuery = ofDefault(new PageQuery<>(), param);
objectPageQuery.setPara("questionSettingType", questionSettingType);
objectPageQuery.setPara("teacherOpenCourseId", teacherOpenCourseId);
@ -127,7 +123,7 @@ public class QuestionLogSummaryController extends BaseController {
* @return
*/
@PostMapping(API + "/exportAnalysis.do")
public void exportAnalysisDo(Long teacherOpenCourseId, ResourcesQuestionSnapshotFromTypeEnum questionSettingType, @SCoreUser CoreUser coreUser) throws IOException {
public void exportAnalysisDo(Long teacherOpenCourseId, @RequestParam(required = false) ResourcesQuestionSnapshotFromTypeEnum questionSettingType, @SCoreUser CoreUser coreUser) throws IOException {
PageQuery<Object> objectPageQuery = new PageQuery<>();
objectPageQuery.setPageNumber(1L);
@ -517,7 +513,7 @@ public class QuestionLogSummaryController extends BaseController {
* @return
*/
@PostMapping(MODEL + "/analysisPageList.json")
public JsonResult analysisPageList(PageParam param, Long teacherOpenCourseId, ResourcesQuestionSnapshotFromTypeEnum questionSettingType, @SCoreUser CoreUser coreUser) {
public JsonResult analysisPageList(PageParam param, Long teacherOpenCourseId, @RequestParam(required = false) ResourcesQuestionSnapshotFromTypeEnum questionSettingType, @SCoreUser CoreUser coreUser) {
PageQuery<Object> objectPageQuery = ofDefault(new PageQuery<>(), param);
objectPageQuery.setPara("questionSettingType", questionSettingType);
objectPageQuery.setPara("teacherOpenCourseId", teacherOpenCourseId);
@ -532,7 +528,7 @@ public class QuestionLogSummaryController extends BaseController {
* @return
*/
@PostMapping(MODEL + "/exportAnalysis.json")
public void exportAnalysis(Long teacherOpenCourseId, ResourcesQuestionSnapshotFromTypeEnum questionSettingType, @SCoreUser CoreUser coreUser) throws IOException {
public void exportAnalysis(Long teacherOpenCourseId, @RequestParam(required = false) ResourcesQuestionSnapshotFromTypeEnum questionSettingType, @SCoreUser CoreUser coreUser) throws IOException {
// 不需要分页,直接查询出来所有的
PageQuery<Object> objectPageQuery = new PageQuery<>();

@ -215,28 +215,22 @@ public class TeacherOpenCourseChatLogController extends BaseController {
*
* @param teacherOpenCourseChatLogId
* @param studentScore
* @param result
* @return
*/
@PostMapping(API + "/setScore.do")
public JsonResult setScore(
@NotNull(message = "互动ID不能为空")
Long teacherOpenCourseChatLogId,
@NotNull(message = "学生分数不能为空!")
BigDecimal studentScore, BindingResult result) {
if (result.hasErrors()) {
return JsonResult.failMessage(result);
public JsonResult setScore(@NotNull(message = "互动ID不能为空")
Long teacherOpenCourseChatLogId,
@NotNull(message = "学生分数不能为空!")
BigDecimal studentScore) {
TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery = new TeacherOpenCourseChatLogQuery();
teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogId(teacherOpenCourseChatLogId);
teacherOpenCourseChatLogQuery.setStudentScore(studentScore);
String msg = teacherOpenCourseChatLogService.edit(teacherOpenCourseChatLogQuery);
if (StringUtils.isBlank(msg)) {
return JsonResult.success();
} else {
TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery = new TeacherOpenCourseChatLogQuery();
teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogId(teacherOpenCourseChatLogId);
teacherOpenCourseChatLogQuery.setStudentScore(studentScore);
String msg = teacherOpenCourseChatLogService.edit(teacherOpenCourseChatLogQuery);
if (StringUtils.isBlank(msg)) {
return JsonResult.success();
} else {
return JsonResult.failMessage("更新失败," + msg);
}
return JsonResult.failMessage("更新失败," + msg);
}
}

@ -864,10 +864,14 @@ getExcelValues
)
)t
analysis
analysisPageQuery
===
* 题目配置,统计分析接口。用于分析所有题目类型的平均值
select
@pageTag(){
z.*
@}
from (
select
t.question_setting_name,
t.question_log_summary_from_type,
@ -884,12 +888,16 @@ analysis
from question_log_summary t
left join teacher_open_course_question_setting ta on ta.teacher_open_course_question_setting_id = t.question_setting_id
where 1 = 1
@if(!isEmpty(questionSettingType)) {
and t.question_setting_type = #questionSettingType#
and ta.teacher_open_course_question_setting_type = #questionSettingType#
and ta.teacher_open_course_question_setting_type = #questionSettingType#
@}
and t.question_log_summary_status = 1
and ta.teacher_open_course_id = #teacherOpenCourseId#
and ta.teacher_open_course_question_setting_status = 1
AND ta.teacher_open_course_question_setting_push_status = 1
group by
t.question_setting_name,
question_log_summary_from_type
question_log_summary_from_type
) z
Loading…
Cancel
Save