@ -589,36 +589,44 @@ getValuesByQueryNotWithPermission
getQuestionTestSimpleInfo
getQuestionTestSimpleInfo
===
===
* 学生端- 题目的简单信息(包含学生得分)
* 学生端- 题目的简单信息(包含学生得分)
SELECT
SELECT
@pageTag (){
@pageTag (){
z.teacher_open_course_question_setting_id,
z.teacher_open_course_question_setting_name,
z.teacher_open_course_question_setting_type,
z.teacher_open_course_question_start_time,
z.teacher_open_course_question_end_time,
z.question_total_count,
z.is_finished,
z.finish_time,
z.finish_second_time,
z.my_success_count,
round(z.my_success_count / z.question_total_count * 100, 2) as correct_rate
@}
FROM
(
SELECT
t.teacher_open_course_question_setting_id,
t.teacher_open_course_question_setting_id,
t.teacher_open_course_question_setting_name,
t.teacher_open_course_question_setting_name,
t.teacher_open_course_question_setting_type,
t.teacher_open_course_question_setting_type,
t.teacher_open_course_question_start_time,
t.teacher_open_course_question_start_time,
t.teacher_open_course_question_end_time,
t.teacher_open_course_question_end_time,
(
(
SELECT
SELECT
sum(ta.student_score)
@// 我的分数
FROM
sum( ta.student_score )
teacher_open_course_question_log ta
FROM
WHERE
teacher_open_course_question_log ta
ta.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
WHERE
and ta.teacher_open_course_question_log_status = 1
ta.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
AND t.teacher_open_course_question_setting_status = 1
AND ta.teacher_open_course_question_log_status = 1
AND t.teacher_open_course_question_setting_push_status = 1
AND ta.question_log_add_type = #questionLogAddType #
@ // 是否已交卷
AND ta.student_id = #studentId #
AND ta.question_log_add_type = #questionLogAddType #
) AS my_score,
AND ta.student_id = #studentId #
@// 题目总数
) AS my_score,
( SELECT count( 1 ) FROM resources_question_snapshot tb WHERE tb.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id AND tb.question_status = 1 ) AS question_total_count,
(
@// 是否交卷
SELECT
count( 1 )
FROM
resources_question_snapshot tb
WHERE
tb.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
AND tb.question_status = 1
) AS question_total_count,
(
(
SELECT
SELECT
count( 1 ) > 0
count( 1 ) > 0
@ -627,51 +635,48 @@ getQuestionTestSimpleInfo
WHERE
WHERE
tc.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
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.teacher_open_course_question_log_status = 1
@ // 是否已交卷
AND tc.question_log_add_type = #questionLogAddType #
AND tc.question_log_add_type = #questionLogAddType #
LIMIT 1
LIMIT 1
) AS is_finished,
) AS is_finished,
@// 完成时间 00:00:00
(
(
SELECT max(TIMEDIFF( td.teacher_open_course_question_log_update_time , td.teacher_open_course_question_log_add_time )) as finish_time
SELECT
FROM teacher_open_course_question_log td
max(
WHERE td.teacher_open_course_question_log_status = 1
TIMEDIFF( td.teacher_open_course_question_log_update_time, td.teacher_open_course_question_log_add_time )) AS finish_time
@if (!isEmpty(studentId)) {
FROM
and td.student_id = #studentId #
teacher_open_course_question_log td
@}
WHERE
and td.question_log_add_type = #questionLogAddType #
td.teacher_open_course_question_log_status = 1
and td.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
AND td.student_id = #studentId #
) as finish_time,
AND td.question_log_add_type = #questionLogAddType #
AND td.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
) AS finish_time,
@// 完成时间(秒)
(
(
SELECT abs(max(TIMESTAMPDIFF(SECOND, te.teacher_open_course_question_log_update_time , te.teacher_open_course_question_log_add_time )))
SELECT
FROM teacher_open_course_question_log te
abs(
WHERE te.teacher_open_course_question_log_status = 1
max(
@if (!isEmpty(studentId)) {
TIMESTAMPDIFF( SECOND, te.teacher_open_course_question_log_update_time, te.teacher_open_course_question_log_add_time )))
and te.student_id = #studentId #
FROM
@}
teacher_open_course_question_log te
and te.question_log_add_type = #questionLogAddType #
WHERE
and te.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
te.teacher_open_course_question_log_status = 1
) as finish_second_time,
AND te.student_id = #studentId #
round(
AND te.question_log_add_type = #questionLogAddType #
AND te.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
) AS finish_second_time,
@// 题目正确数( 大于0, 就算对的)
(
(
SELECT sum(tf.student_score < > 1 )
FROM teacher_open_course_question_log tf
WHERE tf.teacher_open_course_question_log_status = 1
@if (!isEmpty(studentId)) {
and tf.student_id = #studentId #
@}
and tf.question_log_add_type = #questionLogAddType #
and tf.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
) / (
SELECT
SELECT
count(DISTINCT ( t.resources_question_snapshot_id ))
sum( tf.student_score > 0 )
FROM
FROM
resources_question_snapshot t
teacher_open_course_question_log tf
WHERE
WHERE
1 = 1
tf.teacher_open_course_question_log_status = 1
AND t.question_status = 1
AND tf.student_id = #studentId #
AND t.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
AND tf.question_log_add_type = #questionLogAddType #
) ,2) * 100 as correct_rate
AND tf.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
@}
) AS my_success_count
FROM
FROM
teacher_open_course_question_setting t
teacher_open_course_question_setting t
WHERE
WHERE
@ -680,8 +685,9 @@ getQuestionTestSimpleInfo
AND t.teacher_open_course_question_setting_push_status = 1
AND t.teacher_open_course_question_setting_push_status = 1
AND t.teacher_open_course_question_setting_status = 1
AND t.teacher_open_course_question_setting_status = 1
AND t.teacher_open_course_id = #teacherOpenCourseId #
AND t.teacher_open_course_id = #teacherOpenCourseId #
order by t.teacher_open_course_question_setting_name asc
ORDER BY
t.teacher_open_course_question_setting_name ASC
) z
questionTestResults
questionTestResults
===
===