Merge branch 'develop' into 'develop'

竞赛相关



See merge request !174
This commit is contained in:
陈晓婷 2017-03-13 16:58:52 +08:00
commit 7a3e1a6a75
6 changed files with 24 additions and 15 deletions

View File

@ -15,7 +15,7 @@ class ContestantWorksController < ApplicationController
def new
#更新消息
if @contestwork.work_status == 1
#if @contestwork.work_status == 1
noEvaluation = @contestwork.contest_messages.where("user_id =? and viewed =?", User.current.id, 0)
noEvaluation.update_all(:viewed => true)
@ -24,9 +24,9 @@ class ContestantWorksController < ApplicationController
respond_to do |format|
format.html{ render :layout => "base_contests"}
end
else
render_403
end
#else
# render_403
#end
end
def index

View File

@ -3180,7 +3180,7 @@ module ApplicationHelper
def user_for_contest_work homework,is_contestant,work
count = homework.contestant_works.has_committed.count
if User.current.logged?
if User.current.member_of_contest?(homework.contest)
if User.current.member_of_contest?(homework.contest) || User.current.admin?
if !is_contestant #老师显示作品数量
link_to "作品(#{count})", contestant_works_path(:work =>homework.id, :tab => 2), :class => "c_blue"
else #学生显示提交作品、修改作品等按钮
@ -3192,6 +3192,12 @@ module ApplicationHelper
else
link_to "提交作品(#{count})", new_contestant_work_path(:work => homework.id),:class => 'c_blue'
end
elsif work.nil? && homework.work_status > 1
if homework.work_type ==3 && project.nil? && homework.work_detail_group.base_on_project
link_to "补交作品(#{count})","javascript:void(0)", :class => 'c_grey',:style=>"cursor:not-allowed",:title => '请先关联项目再补交作品'
else
link_to "补交作品(#{count})", new_contestant_work_path(:work => homework.id),:class => 'c_blue'
end
else
if homework.work_status == 1 && work.user_id == User.current.id
link_to "修改作品(#{count})", edit_contestant_work_path(work.id),:class => 'c_blue'

View File

@ -2,10 +2,10 @@
<div>
<span class="fl" style="width:280px;" onclick="show_student_work('<%= contestant_work_path(student_work)%>');">
<span class="hidden fl" style="max-width:220px;"><%= student_work.name %></span>
<span class="fontGrey2 ml5 fl">
<% if student_work.work_status %>
<%= get_contest_new_status student_work.work_status %>
<% end %>
<span class="fontGrey2 ml5 fl">已提交
<%# if student_work.work_status %>
<%#= get_contest_new_status student_work.work_status %>
<%# end %>
</span>
</span>
<a href="javascript:void(0)" class="linkBlue2 fr" onclick="show_student_work('<%= contestant_work_path(student_work)%>');">评分</a>

View File

@ -2,10 +2,10 @@
<div>
<span class="fl" style="width:280px;" onclick="show_student_work('<%= contestant_work_path(student_work)%>');">
<span class="hidden fl" style="max-width:220px;"><%= student_work.name %></span>
<span class="fontGrey2 ml5 fl">
<% if student_work.work_status %>
<%= get_contest_new_status student_work.work_status %>
<% end %>
<span class="fontGrey2 ml5 fl">已提交
<%# if student_work.work_status %>
<%#= get_contest_new_status student_work.work_status %>
<%# end %>
</span>
</span>
<a href="javascript:void(0)" class="linkBlue2 fr" onclick="show_student_work('<%= contestant_work_path(student_work)%>');">查看</a>

View File

@ -13,8 +13,8 @@
<% my_work = cur_user_works_for_work @contestwork %>
<% if !@is_teacher && !@is_judge && my_work.nil? && User.current.member_of_contest?(@contest) %>
<span class="f12 c_red">您尚未提交作品</span>
<% if @contestwork.work_status == 1 && (@contestwork.work_type != 3 ||(@contestwork.work_type == 3 && !@contestwork.work_detail_group.base_on_project)) %>
<%=link_to "提交作品", new_contestant_work_path(:work => @contestwork.id),:class => 'blueCir ml5 f12' %>
<% if @contestwork.work_type != 3 ||(@contestwork.work_type == 3 && !@contestwork.work_detail_group.base_on_project) %>
<%=link_to @contestwork.work_status == 1 ? "提交作品" : "补交作品", new_contestant_work_path(:work => @contestwork.id),:class => 'blueCir ml5 f12' %>
<% end %>
<% elsif !@is_teacher && !@is_judge && my_work && @contestwork.work_status > 1 && !@stundet_works.empty?%>
<span class="f12 c_red">截止日期已过,已提交且不可修改</span>

View File

@ -1,4 +1,7 @@
<% if @members.count != 0 %>
<div>
<%= link_to "导出作业成绩", export_course_member_excel_course_path(@course, :format => 'xls'), :class => 'link-blue fr mb5'%>
</div>
<table class="muban_table clearfix mb15 t-center" cellpadding="0" cellspacing="0">
<thead>
<tr>