题目分析

beetlsql3-dev
Mlxa0324 2 years ago
parent 00ecf5f4aa
commit c5839ff127

@ -119,10 +119,10 @@ public class TeacherOpenCourseQuestionSetting extends BaseEntity {
/**======================================= 扩展数据 =====================================*/ /**======================================= 扩展数据 =====================================*/
// 附件题目的得分和评语 // 附件题目的得分和评语
@FetchSql("select t.student_score, t.teacher_open_course_question_log_reply from teacher_open_course_question_log t " + // @FetchSql("select t.student_score, t.teacher_open_course_question_log_reply from teacher_open_course_question_log t " +
"where t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' " + // "where t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' " +
"and t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# " + // "and t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# " +
"and #teacherOpenCourseQuestionSettingType# = 'HOMEWORK_FILE' ") // "and #teacherOpenCourseQuestionSettingType# = 'HOMEWORK_FILE' ")
@UpdateIgnore @UpdateIgnore
@InsertIgnore @InsertIgnore
private Map fileQuestionInfo; private Map fileQuestionInfo;
@ -190,4 +190,12 @@ public class TeacherOpenCourseQuestionSetting extends BaseEntity {
) )
private String resourcesQuestionIdPlural; private String resourcesQuestionIdPlural;
@UpdateIgnore
@InsertIgnore
@FetchSql("select count(1) " +
"from resources_question_snapshot t where t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# \n" +
"and t.question_status = 1 \n"
)
private Integer questionCount;
} }

@ -251,6 +251,21 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
Long questionSettingId = item.getTeacherOpenCourseQuestionSettingId(); Long questionSettingId = item.getTeacherOpenCourseQuestionSettingId();
if (ObjectUtil.isNotEmpty(student)) { if (ObjectUtil.isNotEmpty(student)) {
Long studentId = student.getStudentId(); Long studentId = student.getStudentId();
TeacherOpenCourseQuestionLogQuery logQuery = new TeacherOpenCourseQuestionLogQuery();
logQuery.setTeacherOpenCourseQuestionSettingId(questionSettingId);
logQuery.setStudentId(studentId);
logQuery.setTeacherOpenCourseQuestionLogStatus(1);
logQuery.setQuestionLogAddType(FINALLY_SUBMIT);
logQuery.setQuestionSettingType(HOMEWORK_FILE);
TeacherOpenCourseQuestionLog questionLog = teacherOpenCourseQuestionLogService.getInfo(logQuery);
if (null != questionLog) {
Map<String, String> fileQuestionInfo = new HashMap();
fileQuestionInfo.put("studentScore", questionLog.getStudentScore().toString());
fileQuestionInfo.put("teacherOpenCourseQuestionLogReply", questionLog.getTeacherOpenCourseQuestionLogReply());
item.setFileQuestionInfo(fileQuestionInfo);
}
QuestionLogSummaryQuery logSummaryQuery = new QuestionLogSummaryQuery(); QuestionLogSummaryQuery logSummaryQuery = new QuestionLogSummaryQuery();
logSummaryQuery.setPersonId(studentId); logSummaryQuery.setPersonId(studentId);
logSummaryQuery.setQuestionLogSummaryStatus(1); logSummaryQuery.setQuestionLogSummaryStatus(1);
@ -278,7 +293,6 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
if (ObjectUtil.isNotEmpty(logSummaryList2)) { if (ObjectUtil.isNotEmpty(logSummaryList2)) {
BigDecimal studentTotalScore = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummaryStudentTotalScore).reduce(BigDecimal::add).get(); BigDecimal studentTotalScore = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummaryStudentTotalScore).reduce(BigDecimal::add).get();
int passTotalCount = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummaryIsPass).reduce(Integer::sum).get(); int passTotalCount = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummaryIsPass).reduce(Integer::sum).get();
int questionTotalCount = logSummaryList2.get(0).getQuestionLogSummaryQuestionTotalCount();
int totalSuccessCount = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummarySuccessCount).reduce(Integer::sum).get(); int totalSuccessCount = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummarySuccessCount).reduce(Integer::sum).get();
int totalErrorCount = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummaryErrorCount).reduce(Integer::sum).get(); int totalErrorCount = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummaryErrorCount).reduce(Integer::sum).get();
BigDecimal totalSuccessRate = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummarySuccessRate).reduce(BigDecimal::add).get(); BigDecimal totalSuccessRate = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummarySuccessRate).reduce(BigDecimal::add).get();
@ -286,7 +300,6 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
item.set("avgScore", NumberUtil.div(studentTotalScore, logSummarySize, 1)); item.set("avgScore", NumberUtil.div(studentTotalScore, logSummarySize, 1));
item.set("avgPassRate", NumberUtil.div(passTotalCount, logSummarySize, 1)); item.set("avgPassRate", NumberUtil.div(passTotalCount, logSummarySize, 1));
item.set("questionCount", questionTotalCount);
item.set("avgSuccessCount", NumberUtil.div(totalSuccessCount, logSummarySize, 1)); item.set("avgSuccessCount", NumberUtil.div(totalSuccessCount, logSummarySize, 1));
item.set("avgErrorCount", NumberUtil.div(totalErrorCount, logSummarySize, 1)); item.set("avgErrorCount", NumberUtil.div(totalErrorCount, logSummarySize, 1));
item.set("avgSuccessRate", NumberUtil.div(totalSuccessRate, logSummarySize, 1)); item.set("avgSuccessRate", NumberUtil.div(totalSuccessRate, logSummarySize, 1));

@ -873,21 +873,23 @@ analysisPageQuery
@} @}
from ( from (
select select
t.question_setting_name, ta.teacher_open_course_question_setting_name as question_setting_name,
t.question_log_summary_from_type, ta.teacher_open_course_question_setting_type as question_setting_type,
sum(t.question_setting_id) as total_setting_count, count(distinct(ab.resources_question_snapshot_id)) as question_total_count,
avg(question_setting_total_score) as avg_question_setting_total_score, count(distinct(t.question_setting_id)) as total_setting_count,
avg(question_log_summary_student_total_score) as avg_student_score, round(avg(question_setting_total_score), 1) as avg_question_setting_total_score,
avg(question_log_summary_question_total_count) as question_total_count, round(avg(question_log_summary_student_total_score), 1) as avg_student_score,
avg(question_log_summary_student_do_count) as avg_question_log_summary_student_do_count, round(avg(question_log_summary_question_total_count), 1) as avg_question_total_count,
avg(question_log_summary_success_count) as avg_correct_count, round(avg(question_log_summary_student_do_count), 1) as avg_question_log_summary_student_do_count,
avg(question_log_summary_error_count) as avg_wrong_count, round(avg(question_log_summary_success_count), 1) as avg_correct_count,
avg(question_log_summary_success_rate) as avg_question_log_summary_success_rate, round(avg(question_log_summary_error_count), 1)as avg_wrong_count,
avg(question_log_summary_is_pass) as avg_question_log_summary_is_pass, round(avg(question_log_summary_success_rate), 1) as avg_question_log_summary_success_rate,
avg(finish_second_time) as avg_finish_second_time round(avg(question_log_summary_is_pass), 1) as avg_question_log_summary_is_pass,
from question_log_summary t round(avg(finish_second_time), 1) as avg_finish_second_time
left join teacher_open_course_question_setting ta on ta.teacher_open_course_question_setting_id = t.question_setting_id from resources_question_snapshot ab
where 1 = 1 left join teacher_open_course_question_setting ta on ta.teacher_open_course_question_setting_id = ab.teacher_open_course_question_setting_id
left join question_log_summary t on t.question_setting_id = ab.teacher_open_course_question_setting_id
where 1
@if(!isEmpty(questionSettingType)) { @if(!isEmpty(questionSettingType)) {
and t.question_setting_type = #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#
@ -896,8 +898,9 @@ analysisPageQuery
and ta.teacher_open_course_id = #teacherOpenCourseId# and ta.teacher_open_course_id = #teacherOpenCourseId#
and ta.teacher_open_course_question_setting_status = 1 and ta.teacher_open_course_question_setting_status = 1
AND ta.teacher_open_course_question_setting_push_status = 1 AND ta.teacher_open_course_question_setting_push_status = 1
AND ta.teacher_open_course_question_setting_name is not null
group by group by
t.question_setting_name, ta.teacher_open_course_question_setting_name,
question_log_summary_from_type ta.teacher_open_course_question_setting_type
) z ) z
Loading…
Cancel
Save