1、实现作业列表展示页面
2、新建作业、修改作业、开启/关闭匿评路由以及页面跳转 3、注释掉bid相关的路由 4、作品列表、新建作品、修改作品、删除作品路由及页面跳转
This commit is contained in:
parent
dc1971f507
commit
7684a6b253
|
@ -0,0 +1,68 @@
|
|||
class HomeworkCommonController < ApplicationController
|
||||
layout "base_courses"
|
||||
before_filter :find_course, :only => [:index,:new]
|
||||
|
||||
def index
|
||||
homeworks = @course.homework_commons
|
||||
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
|
||||
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
|
||||
@homeworks = paginateHelper homeworks,10
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
||||
end
|
||||
|
||||
#开启匿评
|
||||
def start_anonymous_comment
|
||||
|
||||
end
|
||||
|
||||
#关闭匿评
|
||||
def stop_anonymous_comment
|
||||
|
||||
end
|
||||
|
||||
#提示
|
||||
def alert_anonymous_comment
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
#获取课程
|
||||
def find_course
|
||||
@course = Course.find params[:course]
|
||||
rescue
|
||||
render_404
|
||||
end
|
||||
#获取作业
|
||||
def find_homework
|
||||
@homework = HomeworkCommon.find params[:id]
|
||||
@course = @homework.course
|
||||
rescue
|
||||
render_404
|
||||
end
|
||||
end
|
|
@ -0,0 +1,45 @@
|
|||
class StudentWorkController < ApplicationController
|
||||
layout "base_courses"
|
||||
before_filter :find_homework, :only => [:new, :index]
|
||||
|
||||
def index
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
#获取作业
|
||||
def find_homework
|
||||
@homework = HomeworkCommon.find params[:homework]
|
||||
@course = @homework.course
|
||||
rescue
|
||||
render_404
|
||||
end
|
||||
#获取作品
|
||||
def find_work
|
||||
@work = StudentWork.find params[:id]
|
||||
@course = @work.homework_common.course
|
||||
rescue
|
||||
render_404
|
||||
end
|
||||
end
|
|
@ -2110,7 +2110,7 @@ module ApplicationHelper
|
|||
# courses_link = link_to l(:label_course_practice), {:controller => 'courses', :action => 'index'}
|
||||
#users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index', :host => Setting.host_user}
|
||||
# contest_link = link_to l(:label_contest_innovate), {:controller => 'contests', :action => 'index'}
|
||||
bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'}
|
||||
# bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'}
|
||||
forum_link = link_to l(:label_forum_all), {:controller => "forums", :action => "index"}
|
||||
stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index'}
|
||||
school_all_school_link = link_to l(:label_school_all), {:controller => 'school', :action => 'index'}
|
||||
|
|
|
@ -428,40 +428,19 @@ module CoursesHelper
|
|||
|
||||
now > cTime
|
||||
end
|
||||
|
||||
def find_by_extra_from_project extra
|
||||
Course.find_by_extra(try(extra))
|
||||
end
|
||||
|
||||
#判断指定用户是不是当前课程的老师
|
||||
def is_course_teacher (user,course)
|
||||
#course.members.joins(:member_roles).where("member_roles.role_id IN (:role_id) and members.user_id = #{user.id}", {:role_id => TeacherRoles}).count != 0
|
||||
user.allowed_to?(:as_teacher,course)
|
||||
#修改为根据用户是否有发布任务的权限来判断用户是否是课程的老师
|
||||
#is_teacher = false
|
||||
#@membership = user.memberships.all(:conditions => Project.visible_condition(User.current))
|
||||
#@membership.each do |membership|
|
||||
# unless(membership.project.project_type==0)
|
||||
# if user.allowed_to?({:controller => "projects", :action => "new_homework"}, membership.project, :global => false)
|
||||
# is_teacher = true
|
||||
# end
|
||||
# end
|
||||
#end
|
||||
#is_teacher
|
||||
end
|
||||
|
||||
#当前用户是不是指定课程的学生
|
||||
def is_cur_course_student course
|
||||
#course.members.joins(:member_roles).where("member_roles.role_id IN (:role_id) and members.user_id = #{User.current.id}", {:role_id => StudentRoles}).count != 0
|
||||
User.current.logged? && User.current.member_of_course?(course) && !(User.current.allowed_to?(:as_teacher,course))
|
||||
#修改:能新建占位且不能新建任务的角色判定为学生
|
||||
#is_student = false
|
||||
#@membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current))
|
||||
#@membership.each do |membership|
|
||||
# unless(membership.project.project_type==0)
|
||||
# if !User.current.allowed_to?({:controller => "projects", :action => "new_homework"}, membership.project, :global => false) && User.current.allowed_to?({:controller => "homework_attach", :action => "new"}, membership.project, :global => false)
|
||||
# is_student = true
|
||||
# end
|
||||
# end
|
||||
#end
|
||||
#is_student
|
||||
end
|
||||
#获取当前用户在指定作业下提交的作业的集合
|
||||
def cur_user_homework_for_bid bid
|
||||
|
@ -479,61 +458,6 @@ module CoursesHelper
|
|||
homework.nil? ? [] : (homework.users + [homework.user])
|
||||
end
|
||||
|
||||
#获取指定作业的最终评分
|
||||
#最终评分 = 学生评分的平均分 * 0.4 +教师评分 * 0.6
|
||||
def score_for_homework homework
|
||||
if homework.bid.is_evaluation == 1 || homework.bid.is_evaluation == nil
|
||||
return format("%.2f",(homework.bid.proportion * 1.0 / 100) * (teacher_score_for_homework(homework).to_f) + (1 - homework.bid.proportion * 1.0 / 100) * (student_score_for_homework(homework).to_f))
|
||||
else
|
||||
return teacher_score_for_homework homework
|
||||
end
|
||||
end
|
||||
def score_for_homework_new homework
|
||||
if teacher_score_for_homework(homework) != 0
|
||||
return teacher_score_for_homework homework
|
||||
else
|
||||
return student_score_for_homework homework
|
||||
end
|
||||
end
|
||||
#获取作业的互评得分
|
||||
def student_score_for_homework homework
|
||||
#member = searchTeacherAndAssistant(homework.bid.courses.first).first#searchPeopleByRoles(homework.bid.courses.first,TeacherRoles).first
|
||||
#if member.nil?
|
||||
# return "0.00"
|
||||
#end
|
||||
#student_stars = homework.rates(:quality).where("rater_id <> #{member.user_id}").select("stars")
|
||||
members = searchStudent(homework.bid.courses.first)
|
||||
user_ids = []
|
||||
members.each do |user|
|
||||
user_ids << user.user_id
|
||||
end
|
||||
student_stars = homework.rates(:quality).where("rater_id in (:user_ids)",{:user_ids => user_ids}).select("stars")
|
||||
student_stars_count = 0
|
||||
student_stars.each do |star|
|
||||
student_stars_count = student_stars_count + star.stars
|
||||
end
|
||||
return format("%.2f",student_stars_count / (student_stars.count == 0 ? 1 : student_stars.count))
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
#获取作业的教师评分
|
||||
#多个教师只获取一份教师评分
|
||||
def teacher_score_for_homework homework
|
||||
members = searchTeacherAndAssistant(homework.bid.courses.first)
|
||||
teacher_ids = []
|
||||
members.each do |user|
|
||||
teacher_ids << user.user_id
|
||||
end
|
||||
teacher_stars = homework.rates(:quality).where("rater_id in (:teacher_ids)",{:teacher_ids => teacher_ids}).select("stars")
|
||||
teacher_stars_count = 0
|
||||
teacher_stars.each do |star|
|
||||
teacher_stars_count = teacher_stars_count + star.stars
|
||||
end
|
||||
return format("%.2f",teacher_stars.count > 0 ? teacher_stars_count/teacher_stars.count : 0)
|
||||
end
|
||||
|
||||
#获取指定项目的得分
|
||||
def project_score project
|
||||
issue_count = project.issues.count
|
||||
|
@ -739,54 +663,6 @@ module CoursesHelper
|
|||
link.html_safe
|
||||
end
|
||||
|
||||
def bid_anonymous_comment bid
|
||||
if bid.open_anonymous_evaluation == 1
|
||||
if bid.homeworks.count >= 2
|
||||
case bid.comment_status
|
||||
when 0
|
||||
link = link_to '启动匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'fr mr10 work_edit'
|
||||
when 1
|
||||
link = link_to '关闭匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true,:class => 'fr mr10 work_edit'
|
||||
when 2
|
||||
link = "<span class='fr pr_join_span mr10' title='匿评结束'>匿评结束</span>".html_safe
|
||||
end
|
||||
else
|
||||
link = "<span class='fr mr10 pr_join_span ' title='学生提交作业数大于2时才可以启动匿评'>启动匿评</span>".html_safe
|
||||
end
|
||||
else
|
||||
link = "<span class='fr mr10 pr_join_span ' title='未开启匿评作业不可以启动匿评'>启动匿评</span>".html_safe
|
||||
end
|
||||
link
|
||||
end
|
||||
|
||||
def student_new_homework bid
|
||||
user_homework = cur_user_homework_for_bid bid
|
||||
if user_homework && user_homework.empty?
|
||||
link_to l(:label_commit_homework), new_exercise_book_path(bid),:class => 'fr mr10 work_edit'
|
||||
else
|
||||
if bid.comment_status == 1 && bid.open_anonymous_evaluation == 1
|
||||
"<span class='fr mr10 pr_join_span ' title='已开启匿评不能修改作品'>#{l(:label_edit_homework)}</span>".html_safe
|
||||
else
|
||||
link_to l(:label_edit_homework), edit_homework_attach_path(user_homework.first.id),:class => 'fr mr10 work_edit'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def student_anonymous_comment bid
|
||||
if bid.open_anonymous_evaluation == 1
|
||||
case bid.comment_status
|
||||
when 0
|
||||
"<span class='fr mr10 pr_join_span '>未开启匿评</span>".html_safe
|
||||
when 1
|
||||
"<span class='fr mr10 pr_join_span '>正在匿评中</span>".html_safe
|
||||
when 2
|
||||
"<span class='fr mr10 pr_join_span '>匿评已结束</span>".html_safe
|
||||
end
|
||||
else
|
||||
"<span class='fr mr10 pr_join_span '>未启用匿评</span>".html_safe
|
||||
end
|
||||
end
|
||||
|
||||
def visable_attachemnts_incourse course
|
||||
return[] unless course
|
||||
result = []
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
# encoding: utf-8
|
||||
module HomeworkCommonHelper
|
||||
#获取匿评相关连接代码
|
||||
def homework_anonymous_comment homework
|
||||
if homework.homework_type == 2 && homework.homework_detail_manual #匿评作业
|
||||
if homework.student_works.count >= 2 #作业份数大于2
|
||||
case homework.homework_detail_manual.comment_status
|
||||
when 1
|
||||
link = link_to '启动匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'fr mr10 work_edit'
|
||||
when 2
|
||||
link = link_to '关闭匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'fr mr10 work_edit'
|
||||
when 3
|
||||
link = "<span class='fr pr_join_span mr10' title='匿评结束'>匿评结束</span>".html_safe
|
||||
end
|
||||
else
|
||||
link = "<span class='fr mr10 pr_join_span ' title='学生提交作业数大于2时才可以启动匿评'>启动匿评</span>".html_safe
|
||||
end
|
||||
else
|
||||
link = "<span class='fr mr10 pr_join_span ' title='未开启匿评作业不可以启动匿评'>启动匿评</span>".html_safe
|
||||
end
|
||||
link
|
||||
end
|
||||
|
||||
def student_new_homework homework
|
||||
work = cur_user_works_for_homework homework
|
||||
if work.nil?
|
||||
link_to l(:label_commit_homework), new_student_work_path(:homework => homework.id),:class => 'fr mr10 work_edit'
|
||||
else
|
||||
if homework.homework_type == 2 && homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前
|
||||
"<span class='fr mr10 pr_join_span ' title='已开启匿评不能修改作品'>#{l(:label_edit_homework)}</span>".html_safe
|
||||
else
|
||||
link_to l(:label_edit_homework), edit_student_work_path(work.id),:class => 'fr mr10 work_edit'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def student_anonymous_comment homework
|
||||
if homework.homework_type == 2
|
||||
case homework.homework_detail_manual.comment_status
|
||||
when 1
|
||||
"<span class='fr mr10 pr_join_span '>未开启匿评</span>".html_safe
|
||||
when 2
|
||||
"<span class='fr mr10 pr_join_span '>正在匿评中</span>".html_safe
|
||||
when 3
|
||||
"<span class='fr mr10 pr_join_span '>匿评已结束</span>".html_safe
|
||||
end
|
||||
elsif homework.homework_type == 1
|
||||
"<span class='fr mr10 pr_join_span '>未启用匿评</span>".html_safe
|
||||
elsif homework.homework_type == 3
|
||||
"<span class='fr mr10 pr_join_span '>编程作业</span>".html_safe
|
||||
end
|
||||
end
|
||||
|
||||
#获取当前用户在指定作业下提交的作业的集合
|
||||
def cur_user_works_for_homework homework
|
||||
homework.student_works.where("user_id = ?",User.current).first
|
||||
end
|
||||
end
|
|
@ -20,7 +20,7 @@ class Course < ActiveRecord::Base
|
|||
has_many :users, :through => :members
|
||||
# has_many :homeworks, :through => :homework_for_courses, :source => :bid, :dependent => :destroy
|
||||
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
||||
has_many :homework_for_courses, :dependent => :destroy
|
||||
# has_many :homework_for_courses, :dependent => :destroy
|
||||
has_many :student, :class_name => 'StudentsForCourse', :source => :user
|
||||
has_many :course_infos, :class_name => 'CourseInfos',:dependent => :destroy
|
||||
has_many :enabled_modules, :dependent => :delete_all
|
||||
|
@ -30,6 +30,7 @@ class Course < ActiveRecord::Base
|
|||
has_one :course_status, :class_name => "CourseStatus", :dependent => :destroy
|
||||
|
||||
has_many :homework_commons, :dependent => :destroy
|
||||
has_many :student_works, :through => :homework_commons, :dependent => :destroy
|
||||
|
||||
has_many :course_groups, :dependent => :destroy
|
||||
|
||||
|
|
|
@ -10,4 +10,6 @@ class HomeworkCommon < ActiveRecord::Base
|
|||
has_many :homework_tests, :dependent => :destroy
|
||||
has_many :student_works, :dependent => :destroy
|
||||
has_many :student_works_evaluation_distributions, :through => :student_works #一个作业的分配的匿评列表
|
||||
|
||||
acts_as_attachable
|
||||
end
|
||||
|
|
|
@ -6,4 +6,6 @@ class StudentWork < ActiveRecord::Base
|
|||
belongs_to :user
|
||||
has_many :student_works_evaluation_distributions, :dependent => :destroy
|
||||
has_many :student_works_scores, :dependent => :destroy
|
||||
|
||||
acts_as_attachable
|
||||
end
|
||||
|
|
|
@ -3,4 +3,6 @@ class StudentWorksScore < ActiveRecord::Base
|
|||
|
||||
belongs_to :user
|
||||
belongs_to :student_work
|
||||
|
||||
acts_as_attachable
|
||||
end
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
alert(1111);
|
|
@ -0,0 +1 @@
|
|||
编辑作业
|
|
@ -0,0 +1,67 @@
|
|||
<div class="project_r_h">
|
||||
<h2 class="project_h2">
|
||||
<%= l(:label_homework)%>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="talk_top">
|
||||
<p class="fl">
|
||||
<%= l(:label_totle)%>
|
||||
<span><%= @obj_count%></span>
|
||||
<%= l(:label_homework_count)%>
|
||||
</p>
|
||||
<%= link_to( l(:label_course_homework_new), new_homework_common_path(:course => @course.id), :class => 'problem_new_btn fl c_dorange') if @is_teacher %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% @homeworks.each do |homework|%>
|
||||
<div class="problem_main">
|
||||
<%= link_to(image_tag(url_to_avatar(homework.user), :width => "42", :height => "42"), user_path(homework.user), :class => "problem_pic fl") %>
|
||||
<div class="problem_txt fl mt5">
|
||||
<%= link_to(homework.user.lastname+homework.user.firstname, user_path(homework.user),:class => 'problem_name fl') %>
|
||||
<span class="fl"> <%= l(:label_user_create_project_homework) %>:</span>
|
||||
<%= link_to(homework.name, student_work_index_path(:homework => homework.id), :class => 'problem_tit fl fb c_dblue') %>
|
||||
<div class="cl mb5"></div>
|
||||
<p class="fl ">
|
||||
<%= l(:lebel_homework_commit)%>
|
||||
( <%= link_to homework.student_works.count, student_work_index_path(:homework => homework.id), :class => 'c_red'%> )
|
||||
</p>
|
||||
<% if @is_teacher%>
|
||||
<%= homework_anonymous_comment(homework)%>
|
||||
<%= link_to(l(:button_edit),edit_homework_common_path(homework), :class => "fr mr10 work_edit") %>
|
||||
<% elsif @is_student%>
|
||||
<%= student_anonymous_comment homework %>
|
||||
<%= student_new_homework homework %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<script>
|
||||
$(function(){if($("#bid_description_<%= homework.id%>_content").height()>38){$("#bid_show_more_des_button<%= homework.id%>").show();}});
|
||||
</script>
|
||||
<div id="bid_description_<%= homework.id%>" class="news_description mt5">
|
||||
<div id="bid_description_<%= homework.id%>_content" class="upload_img">
|
||||
<%= homework.description.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="news_foot c_red" id="bid_show_more_des_button<%= homework.id%>" onclick="bid_show_more_des(<%= homework.id%>);" style="cursor:pointer;display: none;">
|
||||
<%= l(:button_more)%>...
|
||||
<span class="g-arr-down"></span>
|
||||
</div>
|
||||
<span class="fl"><%= l(:label_end_time)%>:<%= homework.end_time%></span>
|
||||
<% if betweentime(homework.end_time) < 0 %>
|
||||
<span class='fr mr10 c_red '>
|
||||
<%= l(:label_commit_limit)%>
|
||||
</span>
|
||||
<% else %>
|
||||
<script type="text/javascript">
|
||||
window.setInterval(function(){show_bid_dead_line(<%= homework.end_time.year%>,<%= homework.end_time.month%>,<%= homework.end_time.day + 1%>,"bid_deadline_<%= homework.id%>");},1000)
|
||||
</script>
|
||||
<div id="bid_deadline_<%= homework.id%>">
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end%>
|
||||
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
|
@ -0,0 +1 @@
|
|||
发布作业
|
|
@ -1,12 +1,5 @@
|
|||
<% if course %>
|
||||
<li id="homework_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="<%=course.name%>" onmouseover="homeworkSlipMenuOver(<%= course.id%>);" onmouseout="homeworkSlipMenuOut(<%= course.id%>);">
|
||||
<%= link_to course.name, course_path(course.id, host: Setting.host_course) %>
|
||||
<ul class="homework_sub_menu" id="homework_loggedas_ul_<%= course.id%>" style="top:<%= course_index * 28.1%>px;">
|
||||
<% course.homework_for_courses.map(&:bid).each do |bid| %>
|
||||
<li style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="<%=bid.name%>">
|
||||
<%= link_to bid.name, course_for_bid_path(bid, host: Setting.host_course), :target => "_blank" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
|
@ -116,9 +116,9 @@
|
|||
<%= link_to "(#{course_activity_count @course})", course_path(@course), :class => "subnav_num c_orange"%>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_homework), homework_course_path(@course), :class => "f14 c_blue02"%>
|
||||
<%= link_to "(#{@course.homeworks.count})", homework_course_path(@course), :class => "subnav_num c_orange"%>
|
||||
<%= link_to( "+#{l(:label_course_homework_new)}", new_homework_course_path(@course), :class => 'subnav_green c_white') if is_teacher %>
|
||||
<%= link_to l(:label_homework), homework_common_index_path(:course => @course.id), :class => "f14 c_blue02"%>
|
||||
<%= link_to "(#{@course.homework_commons.count})", homework_common_index_path(:course => @course.id), :class => "subnav_num c_orange"%>
|
||||
<%= link_to( "+#{l(:label_course_homework_new)}", new_homework_common_path(:course => @course.id), :class => 'subnav_green c_white') if is_teacher %>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_course_news), course_news_index_path(@course), :class => "f14 c_blue02" %>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
作品列表
|
|
@ -0,0 +1 @@
|
|||
新建作品
|
108
config/routes.rb
108
config/routes.rb
|
@ -80,6 +80,26 @@ RedmineApp::Application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
resources :homework_common, :except => [:show]do
|
||||
member do
|
||||
get 'start_anonymous_comment'
|
||||
get 'stop_anonymous_comment'
|
||||
get 'alert_anonymous_comment'
|
||||
end
|
||||
collection do
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
resources :student_work do
|
||||
member do
|
||||
|
||||
end
|
||||
collection do
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
resources :contest_notification
|
||||
|
||||
resources :open_source_projects do
|
||||
|
@ -251,7 +271,7 @@ RedmineApp::Application.routes.draw do
|
|||
post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
|
||||
post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy'
|
||||
# boards end
|
||||
post 'bids/homework_destroy', :to => 'bids#homework_destroy'
|
||||
# post 'bids/homework_destroy', :to => 'bids#homework_destroy'
|
||||
|
||||
# Misc issue routes. TODO: move into resources
|
||||
match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues'
|
||||
|
@ -283,7 +303,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'user_projects', :to => 'users#user_projects', :via => :get
|
||||
match 'user_activities', :to => 'users#user_activities', :via => :get, :as => "user_activities"
|
||||
match 'user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "user_newfeedback"
|
||||
match 'watch_calls', :to => 'users#watch_bids', :via => [:get , :post]
|
||||
# match 'watch_calls', :to => 'users#watch_bids', :via => [:get , :post]
|
||||
match 'info', :to => 'users#info', :via => [:get , :post], :as => 'user_info'
|
||||
match 'user_watchlist', :to => 'users#user_watchlist', :via => :get, :as => "user_watchlist" #add by huang
|
||||
match 'user_fanslist', :to => 'users#user_fanslist', :via => :get, :as => "user_fanslist" #add by huang
|
||||
|
@ -357,14 +377,6 @@ RedmineApp::Application.routes.draw do
|
|||
post 'appliedproject/applied', :to => 'applied_project#applied_join_project', :as => 'appliedproject'
|
||||
delete 'appliedproject/applied', :to => 'applied_project#unapplied_join_project'
|
||||
|
||||
resources :bids, :only=>[:edit,:update,:show] do
|
||||
member do
|
||||
match 'homework_ajax_modal'
|
||||
get 'start_anonymous_comment', as: 'start_anonymous_comment'
|
||||
get 'stop_anonymous_comment', as: 'stop_anonymous_comment'
|
||||
get 'alert_anonymous_comment'
|
||||
end
|
||||
end
|
||||
resources :projects do
|
||||
member do
|
||||
match 'change_project_type', :via => [:get, :post]
|
||||
|
@ -767,35 +779,35 @@ RedmineApp::Application.routes.draw do
|
|||
get 'words/back', :to=> 'words#back'
|
||||
get 'words/destroyJournal', :to => 'words#destroyJournal'
|
||||
############## fq
|
||||
post 'calls/create', :to => 'bids#create'
|
||||
delete 'calls/destroy', :to => 'bids#destroy'
|
||||
match 'calls/new', :to => 'bids#new', :via => [:get , :post]
|
||||
get 'calls/more', :to => 'bids#more'
|
||||
get 'calls/back', :to=> 'bids#back'
|
||||
match 'calls/new_bid', :to => 'bids#new_bid'
|
||||
match 'contest/new_contest', :to => 'bids#new_contest' #huang
|
||||
match 'calls/:id/show_project', :to => 'bids#show_project', :as => 'project_for_bid'
|
||||
match 'calls/:id/show_course', :to => 'bids#show_courseEx', :as => 'course_for_bid' # nwb added
|
||||
match 'calls/:id/new_exercise_book', :to => 'homework_attach#new', :as => 'new_exercise_book'
|
||||
match 'calls/:id/add', :to => 'bids#add'
|
||||
match 'calls/:id/delete', :to => 'bids#delete'
|
||||
match 'calls/:id/add_homework', :to => 'bids#add_homework', :via => :post
|
||||
match 'calls/:id/new_submit_homework', :to => 'bids#new_submit_homework', :via => :get, :as => 'new_submit_homework'
|
||||
# post 'calls/create', :to => 'bids#create'
|
||||
# delete 'calls/destroy', :to => 'bids#destroy'
|
||||
# match 'calls/new', :to => 'bids#new', :via => [:get , :post]
|
||||
# get 'calls/more', :to => 'bids#more'
|
||||
# get 'calls/back', :to=> 'bids#back'
|
||||
# match 'calls/new_bid', :to => 'bids#new_bid'
|
||||
# match 'contest/new_contest', :to => 'bids#new_contest' #huang
|
||||
# match 'calls/:id/show_project', :to => 'bids#show_project', :as => 'project_for_bid'
|
||||
# match 'calls/:id/show_course', :to => 'bids#show_courseEx', :as => 'course_for_bid' # nwb added
|
||||
# match 'calls/:id/new_exercise_book', :to => 'homework_attach#new', :as => 'new_exercise_book'
|
||||
# match 'calls/:id/add', :to => 'bids#add'
|
||||
# match 'calls/:id/delete', :to => 'bids#delete'
|
||||
# match 'calls/:id/add_homework', :to => 'bids#add_homework', :via => :post
|
||||
# match 'calls/:id/new_submit_homework', :to => 'bids#new_submit_homework', :via => :get, :as => 'new_submit_homework'
|
||||
match 'words/add_project_respond', :to => 'words#add_project_respond'
|
||||
match 'words/:id/leave_project_message', :to => 'words#leave_project_message'
|
||||
|
||||
match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback'
|
||||
match 'calls/create_bid', :to => 'bids#create_bid'
|
||||
match 'contest/create_contest', :to => 'bids#create_contest' #huang
|
||||
match 'calls/create_homework', :to => 'bids#create_homework'
|
||||
match 'calls/:id/homework_respond', :to => 'bids#homework_respond'
|
||||
match 'calls/:id/homework_statistics', :to => 'bids#homework_statistics'
|
||||
match 'calls/:id/fork', :to => 'bids#fork', :as => 'fork'
|
||||
match 'calls/:id/create_fork', :to => 'bids#create_fork'
|
||||
|
||||
match 'calls/:id/show_course', :to => 'bids#show_course', :as => 'show_course'
|
||||
match 'calls/:id/show_bid_project', :to => 'bids#show_bid_project', :as => 'show_bid_project'
|
||||
match 'calls/:id/show_bid_user', :to => 'bids#show_bid_user', :as => 'show_bid_user'
|
||||
# match 'calls/create_bid', :to => 'bids#create_bid'
|
||||
# match 'contest/create_contest', :to => 'bids#create_contest' #huang
|
||||
# match 'calls/create_homework', :to => 'bids#create_homework'
|
||||
# match 'calls/:id/homework_respond', :to => 'bids#homework_respond'
|
||||
# match 'calls/:id/homework_statistics', :to => 'bids#homework_statistics'
|
||||
# match 'calls/:id/fork', :to => 'bids#fork', :as => 'fork'
|
||||
# match 'calls/:id/create_fork', :to => 'bids#create_fork'
|
||||
#
|
||||
# match 'calls/:id/show_course', :to => 'bids#show_course', :as => 'show_course'
|
||||
# match 'calls/:id/show_bid_project', :to => 'bids#show_bid_project', :as => 'show_bid_project'
|
||||
# match 'calls/:id/show_bid_user', :to => 'bids#show_bid_user', :as => 'show_bid_user'
|
||||
|
||||
match 'project/:id/share', :to => 'projects#share', :as => 'share_show' #share
|
||||
|
||||
|
@ -803,33 +815,29 @@ RedmineApp::Application.routes.draw do
|
|||
delete 'join_in/join', :to => 'courses#unjoin'
|
||||
post 'join_in/join_group', :to => 'courses#join_group', :as => 'join_group'
|
||||
delete 'join_in/join_group', :to => 'courses#unjoin_group'
|
||||
post 'calls/:id/join_in_contest', :to => 'bids#join_in_contest', :as => 'join_in_contest'
|
||||
delete 'calls/:id/join_in_contest', :to => 'bids#unjoin_in_contest'
|
||||
match 'calls/:id/show_participator', :to => 'bids#show_participator' # bai
|
||||
match 'calls/:id/update_contest', :to => 'bids#update_contest' # bai
|
||||
match 'calls/:id/settings', :to => 'bids#settings' # bai
|
||||
# post 'calls/:id/join_in_contest', :to => 'bids#join_in_contest', :as => 'join_in_contest'
|
||||
# delete 'calls/:id/join_in_contest', :to => 'bids#unjoin_in_contest'
|
||||
# match 'calls/:id/show_participator', :to => 'bids#show_participator' # bai
|
||||
# match 'calls/:id/update_contest', :to => 'bids#update_contest' # bai
|
||||
# match 'calls/:id/settings', :to => 'bids#settings' # bai
|
||||
|
||||
delete 'attachment/:id', :to => 'attachments#delete_homework'
|
||||
match 'new_join', :to => 'courses#new_join', :as => 'try_join'
|
||||
match 'new_join_group', :to => 'courses#new_join_group', :as => 'try_join_group'
|
||||
match 'new_join_in_contest', :to => 'bids#new_join', :as => 'try_join_in_contest'
|
||||
# match 'new_join_in_contest', :to => 'bids#new_join', :as => 'try_join_in_contest'
|
||||
match 'projects/:id/respond', :to => 'projects#project_respond', :via => :post
|
||||
match 'calls/:id/manage',:to => 'bids#manage',:via => [:get,:post]
|
||||
# match 'calls/:id/manage',:to => 'bids#manage',:via => [:get,:post]
|
||||
|
||||
|
||||
#added by william
|
||||
# match 'calls/:id/set_results',:controller => 'bids', :action => 'set_results',:via => [:get,:post],:as => 'set_results'
|
||||
# match 'calls/:id/set_prizes',:controller => 'bids',:action => 'set_prizes',:as => 'set_prizes'
|
||||
match 'calls/:id/set_reward',:to => 'bids#set_reward',:as => 'set_reward'
|
||||
# match 'calls/:id/set_reward',:to => 'bids#set_reward',:as => 'set_reward'
|
||||
|
||||
# added by young
|
||||
match 'calls', :to => 'bids#index'
|
||||
|
||||
match 'calls/:id', :to => 'bids#show', :as => 'respond'
|
||||
# modified by longjun
|
||||
# bids#contests is not exist
|
||||
# match 'contest', :to => 'bids#contests', :as => 'contest' #modified @20140403
|
||||
# end longjun
|
||||
# match 'calls', :to => 'bids#index'
|
||||
#
|
||||
# match 'calls/:id', :to => 'bids#show', :as => 'respond'
|
||||
|
||||
########################
|
||||
##added by wen##########
|
||||
|
|
Loading…
Reference in New Issue