gpt-3.5-turbo-0301· OpenAI
WildChat-4.8M (AI2)
public ResultVO get(Integer studentCourseId) { if…
- User
public ResultVO get(Integer studentCourseId) { if (!optionManager.getAllowTeacherGrade()) { return failedResult("现在不是打分时间!"); }
Integer teacherId = getUserId(); StudentCourseEntity studentCourse = manager.getStudentCourseById(studentCourseId); if (studentCourse == null) { return failedResult("学生选课Id:" + studentCourseId + "不存在"); } if (!manager.getCourseById(studentCourse.getCourseId()).getTeacherId().equals(teacherId)) { return failedResult("此课程非您教授"); } TeacherGradeVO vo = new TeacherGradeVO(); BeanUtils.copyProperties(studentCourse, vo); vo.setStudentCourseId(studentCourseId); return result(vo); }啥意思 - Assistant
该方法用于获取学生选课的成绩情况,需要满足以下条件:
1.当前允许老师进行打分; 2.当前登录用户为老师; 3.传入的学生选课Id存在,并且该学生选课属于当前老师所教授的课程。
返回值为一个封装了学生选课成绩信息的TeacherGradeVO对象。如果条件不满足,则返回一个ResultVO对象,其中包含错误提示信息。