题目快照增加,附带学生提交的答案

beetlsql3-dev
Mlxa0324 2 years ago
parent 82054483cc
commit b1069fbf8e

@ -678,6 +678,8 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
ResourcesQuestionSnapshotQuery questionSnapshotQuery = new ResourcesQuestionSnapshotQuery();
questionSnapshotQuery.setTeacherOpenCourseQuestionSettingId(teacherOpenCourseQuestionSettingId);
// 学生ID
questionSnapshotQuery.setStudentId(student.getStudentId());
// 答卷后显示答案解析
if (TRUE_CONST.equals(hwSetting.getTeacherOpenCourseQuestionSettingEndShowQa())) {

@ -65,8 +65,13 @@ public class ResourcesQuestionSnapshotQuery extends PageParam {
private String _given;//指定更新的特定字段,多个逗号隔开
// 扩展数据
// 是否乱序
private boolean rand;
// 学生ID
private Long studentId;
public ResourcesQuestionSnapshot pojo(){
ResourcesQuestionSnapshot pojo = new ResourcesQuestionSnapshot();

@ -661,16 +661,6 @@ getValuesByQueryNotWithPermission
* 根据不为空的参数进行查询(不包含权限)
select t.*
@if(has(studentId) && !isEmpty(studentId)){
,(select b.general_question_log_answer
from general_question_log b
where 1 = 1 and b.student_id = #studentId#
and b.general_question_log_status = 1
and b.general_question_setting_id = t.general_question_setting_id
and b.general_resources_question_snapshot_id = t.general_resources_question_snapshot_id
order by general_question_log_add_time desc limit 1
) as student_answer
@}
from general_question_log t
where 1=1
@if(!isEmpty(generalQuestionLogId)){
@ -1231,19 +1221,4 @@ getQuestionLogScoreDetailsInfo
ta.student_sn,
ta.class_id,
tb.class_name
) tz
validateQuestionLogAddTimeLatest
===
* 验证前端传递过来的添加时间是否是最新的
select
if(t.general_question_log_update_time is null, true, t.general_question_log_update_time < #addTime#)
from
general_question_log t
where 1 = 1
and t.general_question_setting_id = #questionSettingId#
and FIND_IN_SET(t.general_resources_question_snapshot_id, #questionSnapshotIds#)
and t.student_id = #studentId#
and t.general_question_log_status = 1
order by general_question_log_add_time desc
limit 1
) tz

@ -5,6 +5,7 @@ queryByCondition
select
@pageTag(){
t.*
#use("selectStudentAnswerFragment")#
@}
from general_resources_question_snapshot t
where 1=1
@ -91,6 +92,7 @@ queryByConditionQuery
select
@pageTag(){
t.*
#use("selectStudentAnswerFragment")#
@}
from general_resources_question_snapshot t
where 1=1
@ -322,6 +324,7 @@ getGeneralResourcesQuestionSnapshotValues
* 根据不为空的参数进行查询
select t.*
#use("selectStudentAnswerFragment")#
from general_resources_question_snapshot t
where 1=1
@if(!isEmpty(generalResourcesQuestionSnapshotId)){
@ -383,6 +386,7 @@ getValuesByQuery
* 根据不为空的参数进行查询
select t.*
#use("selectStudentAnswerFragment")#
from general_resources_question_snapshot t
where 1=1 and #function("generalResourcesQuestionSnapshot.query")#
@if(!isEmpty(generalResourcesQuestionSnapshotId)){
@ -458,6 +462,20 @@ getValuesByQuery
and find_in_set(t.org_id,#orgIdPlural#)
@}
selectStudentAnswerFragment
===
* 查询学生的分数
@if(!isEmpty(studentId!)){
,(select b.general_question_log_answer
from general_question_log b
where 1 = 1 and b.student_id = #studentId#
and b.general_question_log_status = 1
and b.general_question_setting_id = t.general_question_setting_id
and b.general_resources_question_snapshot_id = t.general_resources_question_snapshot_id
order by general_question_log_add_time desc limit 1
) as student_answer
@}
getValuesByQueryNotWithPermission
===
@ -465,6 +483,7 @@ getValuesByQueryNotWithPermission
* 根据不为空的参数进行查询(不包含权限)
select t.*
#use("selectStudentAnswerFragment")#
from general_resources_question_snapshot t
where 1=1
@if(!isEmpty(generalResourcesQuestionSnapshotId)){

@ -476,22 +476,30 @@ getValuesByQuery
@}
asc
selectStudentAnswerFragment
===
* 查询学生的分数
@if(!isEmpty(studentId!)){
,(select b.teacher_open_course_question_log_answer
from teacher_open_course_question_log b
where 1 = 1 and b.student_id = #studentId#
and b.teacher_open_course_question_log_status = 1
and b.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
and b.resources_question_snapshot_id = t.resources_question_snapshot_id
order by teacher_open_course_question_log_add_time desc limit 1
) as student_answer
@}
getValuesByQueryNotWithPermission
===
* 根据不为空的参数进行查询
select t.*
@if(has(studentId) && !isEmpty(studentId)){
,(select b.teacher_open_course_question_log_answer
from teacher_open_course_question_log b
where 1 = 1 and b.student_id = #studentId#
and b.teacher_open_course_question_log_status = 1
and b.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
and b.resources_question_snapshot_id = t.resources_question_snapshot_id
order by teacher_open_course_question_log_add_time desc limit 1
) as student_answer
@}
#use("selectStudentAnswerFragment")#
from resources_question_snapshot t
where 1=1
@if(!isEmpty(resourcesQuestionSnapshotId)){

Loading…
Cancel
Save