竞赛作品允许补交
This commit is contained in:
parent
907dcf1f7d
commit
15b1a82cd4
|
@ -15,7 +15,7 @@ class ContestantWorksController < ApplicationController
|
||||||
|
|
||||||
def new
|
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 = @contestwork.contest_messages.where("user_id =? and viewed =?", User.current.id, 0)
|
||||||
noEvaluation.update_all(:viewed => true)
|
noEvaluation.update_all(:viewed => true)
|
||||||
|
|
||||||
|
@ -24,9 +24,9 @@ class ContestantWorksController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html{ render :layout => "base_contests"}
|
format.html{ render :layout => "base_contests"}
|
||||||
end
|
end
|
||||||
else
|
#else
|
||||||
render_403
|
# render_403
|
||||||
end
|
#end
|
||||||
end
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
|
@ -3180,7 +3180,7 @@ module ApplicationHelper
|
||||||
def user_for_contest_work homework,is_contestant,work
|
def user_for_contest_work homework,is_contestant,work
|
||||||
count = homework.contestant_works.has_committed.count
|
count = homework.contestant_works.has_committed.count
|
||||||
if User.current.logged?
|
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 #老师显示作品数量
|
if !is_contestant #老师显示作品数量
|
||||||
link_to "作品(#{count})", contestant_works_path(:work =>homework.id, :tab => 2), :class => "c_blue"
|
link_to "作品(#{count})", contestant_works_path(:work =>homework.id, :tab => 2), :class => "c_blue"
|
||||||
else #学生显示提交作品、修改作品等按钮
|
else #学生显示提交作品、修改作品等按钮
|
||||||
|
@ -3192,6 +3192,12 @@ module ApplicationHelper
|
||||||
else
|
else
|
||||||
link_to "提交作品(#{count})", new_contestant_work_path(:work => homework.id),:class => 'c_blue'
|
link_to "提交作品(#{count})", new_contestant_work_path(:work => homework.id),:class => 'c_blue'
|
||||||
end
|
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
|
else
|
||||||
if homework.work_status == 1 && work.user_id == User.current.id
|
if homework.work_status == 1 && work.user_id == User.current.id
|
||||||
link_to "修改作品(#{count})", edit_contestant_work_path(work.id),:class => 'c_blue'
|
link_to "修改作品(#{count})", edit_contestant_work_path(work.id),:class => 'c_blue'
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
<div>
|
<div>
|
||||||
<span class="fl" style="width:280px;" onclick="show_student_work('<%= contestant_work_path(student_work)%>');">
|
<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="hidden fl" style="max-width:220px;"><%= student_work.name %></span>
|
||||||
<span class="fontGrey2 ml5 fl">
|
<span class="fontGrey2 ml5 fl">已提交
|
||||||
<% if student_work.work_status %>
|
<%# if student_work.work_status %>
|
||||||
<%= get_contest_new_status student_work.work_status %>
|
<%#= get_contest_new_status student_work.work_status %>
|
||||||
<% end %>
|
<%# end %>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<a href="javascript:void(0)" class="linkBlue2 fr" onclick="show_student_work('<%= contestant_work_path(student_work)%>');">评分</a>
|
<a href="javascript:void(0)" class="linkBlue2 fr" onclick="show_student_work('<%= contestant_work_path(student_work)%>');">评分</a>
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
<div>
|
<div>
|
||||||
<span class="fl" style="width:280px;" onclick="show_student_work('<%= contestant_work_path(student_work)%>');">
|
<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="hidden fl" style="max-width:220px;"><%= student_work.name %></span>
|
||||||
<span class="fontGrey2 ml5 fl">
|
<span class="fontGrey2 ml5 fl">已提交
|
||||||
<% if student_work.work_status %>
|
<%# if student_work.work_status %>
|
||||||
<%= get_contest_new_status student_work.work_status %>
|
<%#= get_contest_new_status student_work.work_status %>
|
||||||
<% end %>
|
<%# end %>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<a href="javascript:void(0)" class="linkBlue2 fr" onclick="show_student_work('<%= contestant_work_path(student_work)%>');">查看</a>
|
<a href="javascript:void(0)" class="linkBlue2 fr" onclick="show_student_work('<%= contestant_work_path(student_work)%>');">查看</a>
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
<% my_work = cur_user_works_for_work @contestwork %>
|
<% my_work = cur_user_works_for_work @contestwork %>
|
||||||
<% if !@is_teacher && !@is_judge && my_work.nil? && User.current.member_of_contest?(@contest) %>
|
<% if !@is_teacher && !@is_judge && my_work.nil? && User.current.member_of_contest?(@contest) %>
|
||||||
<span class="f12 c_red">您尚未提交作品</span>
|
<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)) %>
|
<% if @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' %>
|
<%=link_to @contestwork.work_status == 1 ? "提交作品" : "补交作品", new_contestant_work_path(:work => @contestwork.id),:class => 'blueCir ml5 f12' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% elsif !@is_teacher && !@is_judge && my_work && @contestwork.work_status > 1 && !@stundet_works.empty?%>
|
<% elsif !@is_teacher && !@is_judge && my_work && @contestwork.work_status > 1 && !@stundet_works.empty?%>
|
||||||
<span class="f12 c_red">截止日期已过,已提交且不可修改</span>
|
<span class="f12 c_red">截止日期已过,已提交且不可修改</span>
|
||||||
|
|
Loading…
Reference in New Issue