diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 9c4d8cfa8..1862c7828 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -972,9 +972,9 @@ class BidsController < ApplicationController def memberAccess # 是课程,则判断当前用户是否参加了课程 return true if current_user.admin? - return 0 if @bid.courses.first.project_type == Project::ProjectType_project + #return 0 if @bid.courses.first.project_type == Project::ProjectType_project currentUser = User.current - render_403 unless currentUser.member_of?(@bid.courses.first) + render_403 unless currentUser.member_of_cousrse?(@bid.courses.first) end end diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 808df65dc..df57e4f41 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -37,7 +37,7 @@ class ZipdownController < ApplicationController #下载某一学生的作业的所有文件 def download_user_homework homework = HomeworkAttach.find params[:homework] - if homework != nil && (User.current.admin? || User.current.member_of?(homework.bid.courses.first)) + if homework != nil && (User.current.admin? || User.current.member_of_course?(homework.bid.courses.first)) zipfile = zip_homework_by_user homework send_file zipfile, :filename => homework.name, :type => detect_content_type(zipfile) if zipfile else diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 18778f5e9..ec15b890e 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -3,7 +3,7 @@ <% is_teacher = is_course_teacher User.current,@bid.courses.first %> <% is_evaluation = @bid.is_evaluation == 1 || @bid.is_evaluation == nil %> -<%= form_tag(:controller => 'bids', :action => "show_project", :method => :get) do %> +<%= form_tag(:controller => 'bids', :action => "show_courseEx", :method => :get) do %>
<%= link_to request.host()+"/courses", :controller => 'projects', :action => 'course'%> | -<%=link_to "主页", home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course' %> > - <%= link_to(@homework.bid.courses.first.name.to_s, homework_project_path(@homework.bid.courses.first)) if @homework.bid.courses.first%> > + | <%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index'%> | +<%=link_to "主页", home_path %> > <%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> > + <%= link_to(@homework.bid.courses.first.name.to_s, homework_course_path(@homework.bid.courses.first)) if @homework.bid.courses.first%> > <%=link_to(@homework.bid.name, respond_path(@homework.bid)) %> > <%= link_to "修改作业",edit_homework_attach_path(@homework)%> |