|
|
|
@ -19,7 +19,6 @@ import com.ibeetl.jlw.entity.ResourcesQuestionSnapshot;
|
|
|
|
|
import com.ibeetl.jlw.entity.Student;
|
|
|
|
|
import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionLog;
|
|
|
|
|
import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionSetting;
|
|
|
|
|
import com.ibeetl.jlw.web.query.ResourcesQuestionSnapshotQuery;
|
|
|
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseQuestionLogQuery;
|
|
|
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseQuestionSettingQuery;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
@ -171,6 +170,9 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
|
public List<TeacherOpenCourseQuestionLog> getValuesByQuery (TeacherOpenCourseQuestionLogQuery teacherOpenCourseQuestionLogQuery){
|
|
|
|
|
return teacherOpenCourseQuestionLogDao.getValuesByQuery(teacherOpenCourseQuestionLogQuery);
|
|
|
|
|
}
|
|
|
|
|
public List<TeacherOpenCourseQuestionLog> getValuesByQueryNotWithPermission (TeacherOpenCourseQuestionLogQuery teacherOpenCourseQuestionLogQuery){
|
|
|
|
|
return teacherOpenCourseQuestionLogDao.getValuesByQueryNotWithPermission(teacherOpenCourseQuestionLogQuery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TeacherOpenCourseQuestionLog getInfo (Long teacherOpenCourseQuestionLogId){
|
|
|
|
|
TeacherOpenCourseQuestionLogQuery teacherOpenCourseQuestionLogQuery = new TeacherOpenCourseQuestionLogQuery();
|
|
|
|
@ -390,11 +392,12 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
|
* @param questionSettingId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public Map<Integer, List<ResourcesQuestionSnapshot>> questionAnalysis(@NotNull(message = "题目配置ID不能为空!") Long questionSettingId) {
|
|
|
|
|
ResourcesQuestionSnapshotQuery resourcesQuestionSnapshotQuery = new ResourcesQuestionSnapshotQuery();
|
|
|
|
|
resourcesQuestionSnapshotQuery.setTeacherOpenCourseQuestionSettingId(questionSettingId);
|
|
|
|
|
resourcesQuestionSnapshotQuery.setQuestionStatus(1);
|
|
|
|
|
List<ResourcesQuestionSnapshot> valuesByQuery = resourcesQuestionSnapshotDao.getValuesByQuery(resourcesQuestionSnapshotQuery);
|
|
|
|
|
public Map<Integer, List<TeacherOpenCourseQuestionLog>> questionAnalysis(@NotNull(message = "题目配置ID不能为空!") Long questionSettingId, @NotNull(message = "学生ID不能为空!") Long studentId) {
|
|
|
|
|
TeacherOpenCourseQuestionLogQuery query = new TeacherOpenCourseQuestionLogQuery();
|
|
|
|
|
query.setTeacherOpenCourseQuestionSettingId(questionSettingId);
|
|
|
|
|
query.setTeacherOpenCourseQuestionLogStatus(1);
|
|
|
|
|
query.setStudentId(studentId);
|
|
|
|
|
List<TeacherOpenCourseQuestionLog> valuesByQuery = getValuesByQueryNotWithPermission(query);
|
|
|
|
|
return questionAnalysis(valuesByQuery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -404,20 +407,24 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
|
* @param questionSnapshotIds
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public Map<Integer, List<ResourcesQuestionSnapshot>> questionAnalysis(@NotNull(message = "题目配置ID不能为空!") TreeSet<Long> questionSnapshotIds) {
|
|
|
|
|
List<ResourcesQuestionSnapshot> valuesByQuery = resourcesQuestionSnapshotDao.getByIds(join(questionSnapshotIds.toArray(), ","));
|
|
|
|
|
public Map<Integer, List<TeacherOpenCourseQuestionLog>> questionAnalysis(@NotNull(message = "题目配置ID不能为空!") TreeSet<Long> questionSnapshotIds, @NotNull(message = "学生ID不能为空!") Long studentId) {
|
|
|
|
|
TeacherOpenCourseQuestionLogQuery query = new TeacherOpenCourseQuestionLogQuery();
|
|
|
|
|
query.setResourcesQuestionSnapshotIdPlural(join(questionSnapshotIds.toArray(), ","));
|
|
|
|
|
query.setTeacherOpenCourseQuestionLogStatus(1);
|
|
|
|
|
query.setStudentId(studentId);
|
|
|
|
|
List<TeacherOpenCourseQuestionLog> valuesByQuery = getValuesByQueryNotWithPermission(query);
|
|
|
|
|
return questionAnalysis(valuesByQuery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 开课相关-考试或者作业,答题提交后,获取问题解析。根据配置获取
|
|
|
|
|
* @param questionSnapshots
|
|
|
|
|
* @param questionLogList
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public Map<Integer, List<ResourcesQuestionSnapshot>> questionAnalysis(@NotEmpty(message = "未查询到题目列表!") final List<ResourcesQuestionSnapshot> questionSnapshots) {
|
|
|
|
|
public Map<Integer, List<TeacherOpenCourseQuestionLog>> questionAnalysis(@NotEmpty(message = "未查询到题目列表!") final List<TeacherOpenCourseQuestionLog> questionLogList) {
|
|
|
|
|
|
|
|
|
|
TeacherOpenCourseQuestionSettingQuery settingQuery = new TeacherOpenCourseQuestionSettingQuery();
|
|
|
|
|
settingQuery.setTeacherOpenCourseQuestionSettingId(questionSnapshots.get(0).getTeacherOpenCourseQuestionSettingId());
|
|
|
|
|
settingQuery.setTeacherOpenCourseQuestionSettingId(questionLogList.get(0).getTeacherOpenCourseQuestionSettingId());
|
|
|
|
|
final TeacherOpenCourseQuestionSetting hwSetting = teacherOpenCourseQuestionSettingService.getInfo(settingQuery);
|
|
|
|
|
|
|
|
|
|
// 答卷后显示答案解析
|
|
|
|
@ -425,13 +432,13 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
|
// 答卷后显示答案对错
|
|
|
|
|
final Boolean isEndShowTrueFalse = BooleanUtil.toBoolean(String.valueOf(hwSetting.getTeacherOpenCourseQuestionSettingEndShowTrueFalse()));
|
|
|
|
|
|
|
|
|
|
return questionSnapshots.stream().map(item -> {
|
|
|
|
|
ResourcesQuestionSnapshot resourcesQuestionSnapshot = new ResourcesQuestionSnapshot();
|
|
|
|
|
resourcesQuestionSnapshot.setResourcesQuestionSnapshotId(item.getResourcesQuestionSnapshotId());
|
|
|
|
|
resourcesQuestionSnapshot.setQuestionAnswer(isEndShowQa ? item.getQuestionAnswer() : "");
|
|
|
|
|
resourcesQuestionSnapshot.setQuestionAnalysis(isEndShowTrueFalse ? item.getQuestionAnalysis(): "");
|
|
|
|
|
return resourcesQuestionSnapshot;
|
|
|
|
|
}).collect(groupingBy(ResourcesQuestionSnapshot::getQuestionType));
|
|
|
|
|
return questionLogList.stream().map(item -> {
|
|
|
|
|
TeacherOpenCourseQuestionLog questionLog = new TeacherOpenCourseQuestionLog();
|
|
|
|
|
questionLog.setResourcesQuestionSnapshotId(item.getResourcesQuestionSnapshotId());
|
|
|
|
|
questionLog.setQuestionAnswer(isEndShowQa ? item.getQuestionAnswer() : "");
|
|
|
|
|
questionLog.setQuestionAnalysis(isEndShowTrueFalse ? item.getQuestionAnswer(): "");
|
|
|
|
|
return questionLog;
|
|
|
|
|
}).collect(groupingBy(TeacherOpenCourseQuestionLog::getQuestionType));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|