dev_forum
cxt 5 years ago
commit 6a00d20e08

@ -319,6 +319,7 @@ class ApplicationController < ActionController::Base
# 通关后,把最后一次成功的代码存到数据库 # 通关后,把最后一次成功的代码存到数据库
# type 0 创始内容, 1 最新内容 # type 0 创始内容, 1 最新内容
def game_passed_code(path, myshixun, game_id) def game_passed_code(path, myshixun, game_id)
# 如果代码窗口是隐藏的,则不用保存代码
return if myshixun.shixun.hide_code return if myshixun.shixun.hide_code
file_content = git_fle_content myshixun.repo_path, path file_content = git_fle_content myshixun.repo_path, path
unless file_content.present? unless file_content.present?

@ -94,6 +94,7 @@ class MyshixunsController < ApplicationController
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
begin begin
t1 = Time.now t1 = Time.now
Rails.logger.info("@@@222222#{params[:jsonTestDetails]}")
jsonTestDetails = JSON.parse(params[:jsonTestDetails]) jsonTestDetails = JSON.parse(params[:jsonTestDetails])
timeCost = JSON.parse(params[:timeCost]) timeCost = JSON.parse(params[:timeCost])
brige_end_time = Time.parse(timeCost['evaluateEnd']) if timeCost['evaluateEnd'].present? brige_end_time = Time.parse(timeCost['evaluateEnd']) if timeCost['evaluateEnd'].present?
@ -130,8 +131,8 @@ class MyshixunsController < ApplicationController
# is_public = test_sets.where(:position => j_test_set['caseId']).first.try(:is_public) # is_public = test_sets.where(:position => j_test_set['caseId']).first.try(:is_public)
logger.info "actual_output:################################################# #{actual_output}" logger.info "actual_output:################################################# #{actual_output}"
ts_time = format("%.2f", j_test_set['testSetTime'].to_f/1000000000).to_f ts_time = format("%.2f", j_test_set['testSetTime'].to_f/1000000000).to_f if j_test_set['testSetTime']
ts_mem = format("%.2f", j_test_set['testSetMem'].to_f/1024/1024).to_f ts_mem = format("%.2f", j_test_set['testSetMem'].to_f/1024/1024).to_f if j_test_set['testSetMem']
Output.create!(:code => status, :game_id => game_id, :out_put => outPut, :test_set_position => j_test_set['caseId'], Output.create!(:code => status, :game_id => game_id, :out_put => outPut, :test_set_position => j_test_set['caseId'],
:actual_output => actual_output, :result => j_test_set['passed'].to_i, :query_index => max_query_index, :actual_output => actual_output, :result => j_test_set['passed'].to_i, :query_index => max_query_index,
@ -210,10 +211,10 @@ class MyshixunsController < ApplicationController
end end
uid_logger("training_task_status start#4**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}") uid_logger("training_task_status start#4**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")
sucess_status sucess_status
rescue Exception => e # rescue Exception => e
tip_exception(e.message) # tip_exception(e.message)
uid_logger_error("training_task_status error: #{e}") # uid_logger_error("training_task_status error: #{e}")
raise ActiveRecord::Rollback # raise ActiveRecord::Rollback
end end
end end
end end

@ -258,15 +258,15 @@ class InterestpageComponent extends Component {
<div className="ysldivhome1" > <div className="ysldivhome1" >
<div className="ysldivhomediv" style={{marginLeft:"30px"}} > <div className="ysldivhomediv" style={{marginLeft:"30px"}} >
<div className="ysldivhomedivtxt" onClick={()=>this.Clickteacher("teacher")}>{gouxuans ==="teacher"? <img src={gouxuan} className="gouxuanimg"/>:<img className="gouxuanimg" src={meigouxuan}/>}老师</div> <div className="ysldivhomedivtxt" onClick={()=>this.Clickteacher("teacher")}>{gouxuans ==="teacher"? <img src={gouxuan} className="gouxuanimg"/>:<img className="gouxuanimg" src={meigouxuan}/>}老师</div>
<div className="ysldivhomedivimgsy" ><img src={skzbdx} className="ysldivhomedivimg"/></div> <div className="ysldivhomedivimgsy" ><img onClick={()=>this.Clickteacher("teacher")} src={skzbdx} className="ysldivhomedivimg"/></div>
</div> </div>
<div className="ysldivhomediv" style={{ marginLeft:"101px",marginRight:"101px"}}> <div className="ysldivhomediv" style={{ marginLeft:"101px",marginRight:"101px"}}>
<div className="ysldivhomedivtxt" onClick={()=>this.Clickteacher("student")}>{gouxuans==="student"? <img src={gouxuan} className="gouxuanimg"/>:<img className="gouxuanimg" src={meigouxuan}/>}学生</div> <div className="ysldivhomedivtxt" onClick={()=>this.Clickteacher("student")}>{gouxuans==="student"? <img src={gouxuan} className="gouxuanimg"/>:<img className="gouxuanimg" src={meigouxuan}/>}学生</div>
<div className="ysldivhomedivimgsy"><img src={mytc} className="ysldivhomedivimg"/></div> <div className="ysldivhomedivimgsy"><img onClick={()=>this.Clickteacher("student")} src={mytc} className="ysldivhomedivimg"/></div>
</div> </div>
<div className="ysldivhomediv" > <div className="ysldivhomediv" >
<div className="ysldivhomedivtxt" onClick={()=>this.Clickteacher("professional")}>{gouxuans==="professional"?<img src={gouxuan} className="gouxuanimg"/>:<img className="gouxuanimg" src={meigouxuan}/>}专业人士</div> <div className="ysldivhomedivtxt" onClick={()=>this.Clickteacher("professional")}>{gouxuans==="professional"?<img src={gouxuan} className="gouxuanimg"/>:<img className="gouxuanimg" src={meigouxuan}/>}专业人士</div>
<div className="ysldivhomedivimgsy"><img src={zyrs1} className="ysldivhomedivimg"/></div> <div className="ysldivhomedivimgsy"><img onClick={()=>this.Clickteacher("professional")} src={zyrs1} className="ysldivhomedivimg"/></div>
</div> </div>
</div> </div>
<p className="yslspans2">选择你可能感兴趣的内容</p> <p className="yslspans2">选择你可能感兴趣的内容</p>

@ -260,15 +260,15 @@ class InterestpageMax extends Component {
<div className="ysldivhome12" > <div className="ysldivhome12" >
<div className="ysldivhomediv222" style={{marginLeft:"30px"}} > <div className="ysldivhomediv222" style={{marginLeft:"30px"}} >
<div className="ysldivhomedivtxt2" onClick={()=>this.Clickteacher("teacher")}>{gouxuans ==="teacher"? <img src={gouxuan} className="gouxuanimg2"/>:<img className="gouxuanimg2" src={meigouxuan}/>}老师</div> <div className="ysldivhomedivtxt2" onClick={()=>this.Clickteacher("teacher")}>{gouxuans ==="teacher"? <img src={gouxuan} className="gouxuanimg2"/>:<img className="gouxuanimg2" src={meigouxuan}/>}老师</div>
<div className="ysldivhomedivimg2" ><img src={skzbdx} className="ysldivhomedivimg2"/></div> <div className="ysldivhomedivimg2" ><img onClick={()=>this.Clickteacher("teacher")} src={skzbdx} className="ysldivhomedivimg2"/></div>
</div> </div>
<div className="ysldivhomediv222" style={{ marginLeft:"101px",marginRight:"101px"}}> <div className="ysldivhomediv222" style={{ marginLeft:"101px",marginRight:"101px"}}>
<div className="ysldivhomedivtxt2" onClick={()=>this.Clickteacher("student")}>{gouxuans==="student"? <img src={gouxuan} className="gouxuanimg2"/>:<img className="gouxuanimg2" src={meigouxuan}/>}学生</div> <div className="ysldivhomedivtxt2" onClick={()=>this.Clickteacher("student")}>{gouxuans==="student"? <img src={gouxuan} className="gouxuanimg2"/>:<img className="gouxuanimg2" src={meigouxuan}/>}学生</div>
<div className="ysldivhomedivimg2"><img src={mytc} className="ysldivhomedivimg2"/></div> <div className="ysldivhomedivimg2"><img onClick={()=>this.Clickteacher("student")} src={mytc} className="ysldivhomedivimg2"/></div>
</div> </div>
<div className="ysldivhomediv222" > <div className="ysldivhomediv222" >
<div className="ysldivhomedivtxt2" onClick={()=>this.Clickteacher("professional")}>{gouxuans==="professional"?<img src={gouxuan} className="gouxuanimg2"/>:<img className="gouxuanimg2" src={meigouxuan}/>}专业人士</div> <div className="ysldivhomedivtxt2" onClick={()=>this.Clickteacher("professional")}>{gouxuans==="professional"?<img src={gouxuan} className="gouxuanimg2"/>:<img className="gouxuanimg2" src={meigouxuan}/>}专业人士</div>
<div className="ysldivhomedivimg2"><img src={zyrs1} className="ysldivhomedivimg2"/></div> <div className="ysldivhomedivimg2"><img onClick={()=>this.Clickteacher("professional")} src={zyrs1} className="ysldivhomedivimg2"/></div>
</div> </div>
</div> </div>
<div><span className="yslspans22">选择你可能感兴趣的内容</span></div> <div><span className="yslspans22">选择你可能感兴趣的内容</span></div>

Loading…
Cancel
Save