|
|
|
@ -3,7 +3,7 @@ class CoursesService
|
|
|
|
|
include CoursesHelper
|
|
|
|
|
include HomeworkAttachHelper
|
|
|
|
|
include ApiHelper
|
|
|
|
|
#TODO:尚未整合权限系统
|
|
|
|
|
|
|
|
|
|
#参数school_id为0或不传时返回所有课程,否则返回对应学校的课程
|
|
|
|
|
#参数per_page_count分页功能,每页显示的课程数
|
|
|
|
|
#参数page分页功能,当前页码
|
|
|
|
@ -356,7 +356,7 @@ class CoursesService
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
def show_homework_info course,bid,current_user,is_course_teacher
|
|
|
|
|
author = bid.author.lastname + bid.author.firstname
|
|
|
|
|
author_real_name = bid.author.lastname + bid.author.firstname
|
|
|
|
|
many_times = course.homeworks.index(bid) + 1
|
|
|
|
|
name = bid.name
|
|
|
|
|
homework_count = bid.homeworks.count #已提交的作业数量
|
|
|
|
@ -369,7 +369,7 @@ class CoursesService
|
|
|
|
|
end
|
|
|
|
|
#end
|
|
|
|
|
open_anonymous_evaluation = bid.open_anonymous_evaluation
|
|
|
|
|
{:course_name => course.name,:id => bid.id, :course_teacher => author, :homework_times => many_times, :homework_name => name, :homework_count => homework_count,:student_questions_count => student_questions_count,
|
|
|
|
|
{:course_name => course.name,:id => bid.id, :author => bid.author,:author_real_name => author_real_name, :homework_times => many_times, :homework_name => name, :homework_count => homework_count,:student_questions_count => student_questions_count,
|
|
|
|
|
:description => description, :homework_state => state,:open_anonymous_evaluation => open_anonymous_evaluation,:homework_for_anonymous_comments => homework_for_anonymous_comments}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|