老师的测试结果能显示出来
This commit is contained in:
parent
50aa22c5e5
commit
a29ab60481
|
@ -631,7 +631,7 @@ class StudentWorkController < ApplicationController
|
|||
unless @homework.save
|
||||
logger.debug @homework.errors.full_messages
|
||||
else
|
||||
student_work = @homework.student_works.where(user_id: User.current.id).first
|
||||
student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id).first
|
||||
end
|
||||
end
|
||||
student_work
|
||||
|
|
|
@ -354,7 +354,7 @@ class UsersController < ApplicationController
|
|||
@user = User.current
|
||||
@homework = HomeworkCommon.find(params[:homework_id])
|
||||
@is_test = params[:is_test] == 'true'
|
||||
@student_work = @homework.student_works.where(user_id: User.current.id).first
|
||||
@student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id).first
|
||||
if @student_work.nil?
|
||||
@student_work = StudentWork.new
|
||||
end
|
||||
|
@ -369,7 +369,7 @@ class UsersController < ApplicationController
|
|||
|
||||
def user_commit_homework
|
||||
homework = HomeworkCommon.find(params[:homework])
|
||||
student_work = homework.student_works.where(user_id: User.current.id).first
|
||||
student_work = StudentWork.where(homework_common_id: homework.id, user_id: User.current.id).first
|
||||
if student_work
|
||||
student_work.save
|
||||
flash[:notice] = l(:notice_successful_create)
|
||||
|
|
Loading…
Reference in New Issue