|
|
|
@ -13,16 +13,17 @@ class HomeworkService
|
|
|
|
|
def show_homework params
|
|
|
|
|
@bid = Bid.find(params[:id])
|
|
|
|
|
course = @bid.courses.first
|
|
|
|
|
author = @bid.author.firstname + @bid.author.lastname
|
|
|
|
|
author = @bid.author.lastname + @bid.author.firstname
|
|
|
|
|
many_times = course.homeworks.index(@bid) + 1
|
|
|
|
|
name = @bid.name
|
|
|
|
|
homework_count = @bid.homeworks.count
|
|
|
|
|
homework_count = @bid.homeworks.count #已提交的作业数量
|
|
|
|
|
student_questions_count = @bid.commit.nil? ? 0 : @bid.commit
|
|
|
|
|
description = @bid.description
|
|
|
|
|
if is_course_teacher(User.current, course) && @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2
|
|
|
|
|
state = bid.comment_status
|
|
|
|
|
end
|
|
|
|
|
{:course => 'course', :atuthor => 'author', :many_times => 'many_times', :name => 'name', :homework_count => 'homework_count',
|
|
|
|
|
:descriptiong => 'description', :state => 'state'}
|
|
|
|
|
{:course => course, :atuthor => author, :many_times => many_times, :name => name, :homework_count => homework_count,:student_questions_count => student_questions_count,
|
|
|
|
|
:descriptiong => description, :state => state}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 启动作业匿评
|
|
|
|
|