作业截至之前启动匿评给出提示

tmp
sw 10 years ago
parent 306970558a
commit 7fa45a47bb

@ -135,6 +135,7 @@ class HomeworkCommonController < ApplicationController
#statue 1:启动成功2启动失败作业总数大于等于2份时才能启动匿评3:已开启匿评,请务重复开启,4:没有开启匿评的权限
def start_anonymous_comment
@statue =4 and return unless User.current.admin? || User.current.allowed_to?(:as_teacher,@course)
@statue = 5 and return if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") > Time.now.strftime("%Y-%m-%d")
if @homework_detail_manual.comment_status == 1
student_works = @homework.student_works
if student_works && student_works.size >=2

@ -5,6 +5,8 @@ $("#<%= @homework.id %>_start_anonymous_comment").replaceWith('<%= escape_javasc
alert('启动失败\n作业总数大于等于2份时才能启动匿评');
<% elsif @statue == 3%>
alert("已开启匿评,请务重复开启");
<% elsif @statue == 3%>
<% elsif @statue == 4%>
alert("您没有权限开启匿评");
<% elsif @statue == 5%>
alert("作业提交截止之后才能启动匿评");
<% end %>
Loading…
Cancel
Save