一些修订
This commit is contained in:
parent
c2302dc0c7
commit
1c4f7f99e8
|
@ -4,12 +4,14 @@ class BidsController < ApplicationController
|
||||||
menu_item :respond
|
menu_item :respond
|
||||||
menu_item :project, :only => :show_project
|
menu_item :project, :only => :show_project
|
||||||
menu_item :homework_respond, :only => :homework_respond
|
menu_item :homework_respond, :only => :homework_respond
|
||||||
|
menu_item :homework_statistics, :only => :homework_statistics
|
||||||
#Ended by young
|
#Ended by young
|
||||||
before_filter :find_bid, :only => [:show, :show_project, :create, :destroy, :more, :back, :add, :new, :homework_respond, :add_homework]
|
before_filter :find_bid, :only => [:show, :show_project, :create, :destroy, :more, :back, :add, :new, :homework_respond, :add_homework, :homework_statistics]
|
||||||
|
|
||||||
helper :watchers
|
helper :watchers
|
||||||
helper :attachments
|
helper :attachments
|
||||||
include AttachmentsHelper
|
include AttachmentsHelper
|
||||||
|
|
||||||
def index
|
def index
|
||||||
# Modified by nie
|
# Modified by nie
|
||||||
# @requirement_title = "4"
|
# @requirement_title = "4"
|
||||||
|
@ -365,6 +367,26 @@ class BidsController < ApplicationController
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 作业统计
|
||||||
|
def homework_statistics
|
||||||
|
@course = @bid.courses.first
|
||||||
|
@member = []
|
||||||
|
@course.memberships.each do |member|
|
||||||
|
unless (member.roles && Role.where('id = ? ', 3)).empty?
|
||||||
|
@member.push member
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if @bid.homework_type = 1
|
||||||
|
@student = User.where("id in (select DISTINCT user_id from #{HomeworkAttach.table_name} where bid_id = ? )", @bid.id)
|
||||||
|
@homework_type = true
|
||||||
|
else
|
||||||
|
|
||||||
|
@homework_type = false
|
||||||
|
end
|
||||||
|
@user = @bid.author
|
||||||
|
render :layout => 'base_homework'
|
||||||
|
end
|
||||||
|
|
||||||
def homework_respond
|
def homework_respond
|
||||||
@user = @bid.author
|
@user = @bid.author
|
||||||
render :layout => 'base_homework'
|
render :layout => 'base_homework'
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
未交作业人数(
|
||||||
|
<% %>)
|
||||||
|
|
||||||
|
已交作业人数
|
|
@ -121,6 +121,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li><%= link_to l(:label_question_student), { :controller => 'bids', :action => 'show' },:class => link_class(:respond)%></li>
|
<li><%= link_to l(:label_question_student), { :controller => 'bids', :action => 'show' },:class => link_class(:respond)%></li>
|
||||||
<li><%= link_to l(:label_homework_commit), { :controller => 'bids', :action => 'show_project' },:class => link_class(:project)%></li>
|
<li><%= link_to l(:label_homework_commit), { :controller => 'bids', :action => 'show_project' },:class => link_class(:project)%></li>
|
||||||
|
<!-- <li><%= link_to l(:label_homework_statistics), { :controller => 'bids', :action => 'homework_statistics' },:class => link_class(:homework_statistics)%></li> -->
|
||||||
<!-- <li><%= link_to l(:label_homework_respond), { :controller => 'bids', :action => 'homework_respond' },:class => link_class(:homework_respond)%></li>
|
<!-- <li><%= link_to l(:label_homework_respond), { :controller => 'bids', :action => 'homework_respond' },:class => link_class(:homework_respond)%></li>
|
||||||
--><ul>
|
--><ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1496,4 +1496,5 @@ zh:
|
||||||
label_course_new_homework: 新建作业
|
label_course_new_homework: 新建作业
|
||||||
label_course_homework_list: 作业列表
|
label_course_homework_list: 作业列表
|
||||||
label_course_homework_new: 发布作业
|
label_course_homework_new: 发布作业
|
||||||
label_course_data: 资料
|
label_course_data: 资料
|
||||||
|
label_homework_statistics: 作业统计
|
|
@ -443,6 +443,7 @@ RedmineApp::Application.routes.draw do
|
||||||
match 'calls/create_bid', :to => 'bids#create_bid'
|
match 'calls/create_bid', :to => 'bids#create_bid'
|
||||||
match 'calls/create_homework', :to => 'bids#create_homework'
|
match 'calls/create_homework', :to => 'bids#create_homework'
|
||||||
match 'calls/:id/homework_respond', :to => 'bids#homework_respond'
|
match 'calls/:id/homework_respond', :to => 'bids#homework_respond'
|
||||||
|
match 'calls/:id/homework_statistics', :to => 'bids#homework_statistics'
|
||||||
|
|
||||||
post 'join_in/join', :to => 'courses#join', :as => 'join'
|
post 'join_in/join', :to => 'courses#join', :as => 'join'
|
||||||
delete 'join_in/join', :to => 'courses#unjoin'
|
delete 'join_in/join', :to => 'courses#unjoin'
|
||||||
|
|
Loading…
Reference in New Issue