@ -363,7 +363,7 @@ getValuesByQuery
where 1=1 and #function ("teacherOpenCourseMergeResourcesQuestion.query")#
@if (!isEmpty(teacherOpenCourseMergeResourcesQuestionId)){
and t.teacher_open_course_merge_resources_question_id =#teacherOpenCourseMergeResourcesQuestionId#
@}
@}
@if (!isEmpty(teacherOpenCourseMergeResourcesQuestionIdPlural)){
and find_in_set(t.teacher_open_course_merge_resources_question_id,#teacherOpenCourseMergeResourcesQuestionIdPlural#)
@}
@ -883,4 +883,43 @@ getGroupQuestionTypeCount
GROUP BY
t.question_type
ORDER BY
t.question_type ASC
t.question_type ASC
getGroupQuestionTypeCountAndSelectInfo
===
* 开课离线题库,根据题目类型分组查询数量,和选中的情况
select
z.*,
z.select_count * z.single_score as single_type_total_score
from (
SELECT
t.question_type,
count( 1 ) AS total_count,
@// 该题目类型下,选择的数据
( SELECT count( 1 ) FROM resources_question_snapshot
WHERE teacher_open_course_question_setting_id = ta.teacher_open_course_question_setting_id
AND question_type = t.question_type AND question_status = 1 ) AS select_count,
@// 该题目类型下设置的分数,可能会有不同分数的情况,默认取最大分数
( SELECT max( question_score ) FROM resources_question_snapshot
WHERE teacher_open_course_question_setting_id = ta.teacher_open_course_question_setting_id
AND question_type = t.question_type AND question_status = 1 ) AS single_score
FROM
teacher_open_course_merge_resources_question t
LEFT JOIN teacher_open_course_question_setting ta ON ta.teacher_open_course_id = t.teacher_open_course_id
WHERE
1 = 1
AND t.question_status = 1
@ // 开课ID
@if (!isEmpty(teacherOpenCourseId)){
AND t.teacher_open_course_id = #teacherOpenCourseId #
@}
@ // 开课题目配置ID
@if (!isEmpty(questionSettingId)){
AND ta.teacher_open_course_question_setting_id = #questionSettingId #
@}
GROUP BY
t.question_type
ORDER BY
t.question_type ASC
) z