@ -589,36 +589,44 @@ getValuesByQueryNotWithPermission
getQuestionTestSimpleInfo
===
* 学生端- 题目的简单信息(包含学生得分)
SELECT
@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_name,
t.teacher_open_course_question_setting_type,
t.teacher_open_course_question_start_time,
t.teacher_open_course_question_end_time,
(
SELECT
sum(ta.student_score)
FROM
teacher_open_course_question_log ta
WHERE
ta.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
and ta.teacher_open_course_question_log_status = 1
AND t.teacher_open_course_question_setting_status = 1
AND t.teacher_open_course_question_setting_push_status = 1
@ // 是否已交卷
AND ta.question_log_add_type = #questionLogAddType #
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
@// 我的分数
sum( ta.student_score )
FROM
teacher_open_course_question_log ta
WHERE
ta.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
AND ta.teacher_open_course_question_log_status = 1
AND ta.question_log_add_type = #questionLogAddType #
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 ) > 0
@ -627,51 +635,48 @@ getQuestionTestSimpleInfo
WHERE
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.question_log_add_type = #questionLogAddType #
LIMIT 1
) 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
FROM teacher_open_course_question_log td
WHERE td.teacher_open_course_question_log_status = 1
@if (!isEmpty(studentId)) {
and td.student_id = #studentId #
@}
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
max(
TIMEDIFF( td.teacher_open_course_question_log_update_time, td.teacher_open_course_question_log_add_time )) AS finish_time
FROM
teacher_open_course_question_log td
WHERE
td.teacher_open_course_question_log_status = 1
AND td.student_id = #studentId #
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 )))
FROM teacher_open_course_question_log te
WHERE te.teacher_open_course_question_log_status = 1
@if (!isEmpty(studentId)) {
and te.student_id = #studentId #
@}
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,
round(
SELECT
abs(
max(
TIMESTAMPDIFF( SECOND, te.teacher_open_course_question_log_update_time, te.teacher_open_course_question_log_add_time )))
FROM
teacher_open_course_question_log te
WHERE
te.teacher_open_course_question_log_status = 1
AND te.student_id = #studentId #
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
count(DISTINCT ( t.resources_question_snapshot_id ))
FROM
resources_question_snapshot t
WHERE
1 = 1
AND t.question_status = 1
AND t.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
) ,2) * 100 as correct_rate
@}
sum( tf.student_score > 0 )
FROM
teacher_open_course_question_log tf
WHERE
tf.teacher_open_course_question_log_status = 1
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
) AS my_success_count
FROM
teacher_open_course_question_setting t
WHERE
@ -680,8 +685,9 @@ getQuestionTestSimpleInfo
AND t.teacher_open_course_question_setting_push_status = 1
AND t.teacher_open_course_question_setting_status = 1
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
===