测试代码即提交代码 系统得分为当次的测试得分

This commit is contained in:
cxt 2016-03-10 11:15:37 +08:00
parent 5b4ff5ec8a
commit cc441826ee
3 changed files with 12 additions and 4 deletions

View File

@ -36,6 +36,14 @@ class StudentWorkController < ApplicationController
unless student_work.save
resultObj[:status] = 200
else
student_work.name = params[:title]
student_work.description = params[:src]
if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d")
student_work.late_penalty = @homework.late_penalty
else
student_work.late_penalty = 0
end
student_work.save
resultObj[:status] = result["status"].to_i
resultObj[:time] = student_work_test.created_at.to_s(:db)
resultObj[:index] = student_work.student_work_tests.count

View File

@ -15,10 +15,10 @@
<li>
<% if @homework.homework_type != 3 %>
<ul class="mt10 fl">
<li class="hworkStName mr10 mt16" title="姓名">
<li class="hworkStName mr10 mt16" title="<%= student_work.user.show_name%>">
<%= student_work.user.show_name%>
</li>
<li class="hworkStID mt16" title="学号">
<li class="hworkStID mt16" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>">
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
</li>
</ul>

View File

@ -21,10 +21,10 @@
<li onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;" class="student_work_<%= student_work.id%>">
<% if @homework.homework_type != 3 %>
<ul class="mt10 fl">
<li class="hworkStName mr10 mt16" title="姓名">
<li class="hworkStName mr10 mt16" title="<%= student_work.user.show_name%>">
<%= student_work.user.show_name%>
</li>
<li class="hworkStID mt16" title="学号">
<li class="hworkStID mt16" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>">
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
</li>
</ul>