diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 98de01eab..a008414f3 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -1,8 +1,8 @@ class StudentWorkController < ApplicationController layout "base_courses" before_filter :find_homework, :only => [:new, :index, :create] - before_filter :find_work, :only => [:edit, :update, :show, :destroy] - before_filter :member_of_course, :only => [:index, :new, :create, :show] + before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score] + before_filter :member_of_course, :only => [:index, :new, :create, :show, :add_score] before_filter :author_of_work, :only => [:edit, :update, :destroy] def index @@ -72,7 +72,16 @@ class StudentWorkController < ApplicationController #评分 def add_score + respond_to do |format| + format.js + end + end + #评分的回复 + def add_score_reply + respond_to do |format| + format.js + end end private diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb new file mode 100644 index 000000000..e69de29bb diff --git a/config/routes.rb b/config/routes.rb index ba0ad11fb..dba1e8340 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -93,7 +93,7 @@ RedmineApp::Application.routes.draw do resources :student_work do member do - + post 'add_score' end collection do