Merge branch 'yuanke' into develop

This commit is contained in:
yuanke 2016-03-26 15:00:30 +08:00
commit 1b4f525ad0
1 changed files with 2 additions and 0 deletions

View File

@ -90,6 +90,7 @@ class StudentWorkController < ApplicationController
resultObj[:error_msg] = result["error_msg"] #编译错误时的信息
if result["status"].to_i == -2 #编译错误
resultObj[:results] = result["error_msg"]
resultObj[:status] = -2
elsif result["results"][0]["status"].to_i == 2
resultObj[:status] = 2
@ -116,6 +117,7 @@ class StudentWorkController < ApplicationController
student_work_test.save!
resultObj[:testid] = student_work_test.id
else
#先从数据库取出result
student_work_test = StudentWorkTest.find(params[:testid])
results = student_work_test.results
results << resultObj[:results]