diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb
index a1bc853b..775b1947 100644
--- a/app/controllers/managements_controller.rb
+++ b/app/controllers/managements_controller.rb
@@ -1267,7 +1267,8 @@ end
if school.present?
customer = Customer.new(school_id: s)
customer.save!
- PartnerCustomer.create(partner_id: partner_id,customer_id: customer.id )
+ PartnerCustomer.create!(partner_id: partner_id,customer_id: customer.id )
+ school.update_attributes(customer_id: customer.id)
end
end
render :json => {status: 1, message: "创建成功!"}
diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb
index e0157b67..63477b9d 100644
--- a/app/controllers/myshixuns_controller.rb
+++ b/app/controllers/myshixuns_controller.rb
@@ -466,7 +466,8 @@ class MyshixunsController < ApplicationController
end
# taskId 即返回的game id
- # 返回结果:params [:stauts] 0 表示成功,其它则失败
+ # 返回结果:params [:stauts] 0 表示运行结果成功,其它则失败
+ # compile_success 1 表示成功; 0表示失败
# msg 错误信息
# output 为测试用户编译输出结果
# myshixun:status 1为完成实训
@@ -526,7 +527,7 @@ class MyshixunsController < ApplicationController
logger.info("training_task_status start#3**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")
# status:0表示评测成功
- if status == "0"
+ if compile_success.to_i == 1 && status == "0"
if !resubmit.blank?
game.update_attributes!(:retry_status => 2, :resubmit_identifier => resubmit)
#if game.had_done == 1
diff --git a/app/helpers/subjects_helper.rb b/app/helpers/subjects_helper.rb
index 0a8d659f..6c5e240f 100644
--- a/app/helpers/subjects_helper.rb
+++ b/app/helpers/subjects_helper.rb
@@ -46,7 +46,7 @@ module SubjectsHelper
content = if (shixun.status == 2 && !shixun.hidden) || User.current.manager_of_shixun?(shixun)
content_before = "查看详情"
if User.current.try(:mail).blank?
- %Q{开始实战}
+ %Q{开始实战}
elsif shixun.challenges_count > 0
if is_modify.blank?
%Q{#{link_to '开始实战', shixun_exec_shixun_path(shixun, :is_subject => subject.id), :class => "btn_auto user_bluebg_btn fl none", :id => "shixun_operation", :target => "_blank"}}