dev_local
daiao 6 years ago
parent 1b2b3bfbbc
commit 2c38ada3d5

@ -144,8 +144,8 @@ class ChallengesController < ApplicationController
@shixun.myshixuns.update_all(:system_tip => 0)
end
# 关卡评测执行文件如果被修改,需要修改脚本内容
script = modify_shixun_script @shixun, @shixun.evaluate_script
@shixun.update_column(:evaluate_script, script)
#script = modify_shixun_script @shixun, @shixun.evaluate_script
#@shixun.update_column(:evaluate_script, script)
if path != params[:challenge][:path]
shixun_modify_status_without_publish(@shixun, 1)
end

@ -1,5 +1,5 @@
class TestSet < ActiveRecord::Base
default_scope :order => 'id asc'
attr_accessible :challenge_id, :input, :output, :actual_output, :is_public, :result, :position
attr_accessible :challenge_id, :input, :output, :actual_output, :is_public, :result, :position, :score
belongs_to :challenge
end

@ -166,7 +166,7 @@
<label class="panel-form-label fl">得分规范:</label>
<div class="radioStyle ml10">
<input type="radio" name="challenge[test_set_score]" value="0" id="All_tests" class="ml-3 mr5 magic-radio" onchange="hideSystem_score_percentage()"/>
<input type="radio" name="challenge[test_set_score]" <%= @challenge.test_set_score ? "" : "checked" %> value="0" id="All_tests" class="ml-3 mr5 magic-radio" onchange="hideSystem_score_percentage()"/>
<label class="mt3 maxwidth600" for="All_tests">通过全部测试集
<span class="color979797">(学员评测,仅当所有测试集都正确时,才获得一次性奖励)</span>
</label>
@ -178,7 +178,7 @@
<label class="panel-form-label fl transparent">得分规范:</label>
<div class="fl ml10">
<input type="radio" name="challenge[test_set_score]" value="1" id="Partial_test" class="ml5 mr5 magic-radio" onchange="showSystem_score_percentage()"/>
<input type="radio" name="challenge[test_set_score]" <%= @challenge.test_set_score ? "checked" : "" %> value="1" id="Partial_test" class="ml5 mr5 magic-radio" onchange="showSystem_score_percentage()"/>
<label class="mt3 maxwidth600" for="Partial_test">通过部分测试集
<span class="color979797">(学员评测,当至少有一组测试集正确时,即可获得其对应比例的奖励)</span>
</label>
@ -186,7 +186,7 @@
</li>
<li class="clearfix none" id="System_score_percentage">
<li class="clearfix <%= @challenge.test_set_score ? "" : "none" %>" id="System_score_percentage">
<label class="panel-form-label fl">系统评分占比:</label>
@ -211,7 +211,7 @@
<span class="fl mt5 mr10 color-orange">*</span><span class="color-blue font-16 fl mr20" name="sample_inputs_label">组1</span>
<!---------填写百分比----------->
<span class="fl color-grey-6 width90px mt3 none" name="percentagenumbox">
<span class="fl color-grey-6 width90px mt3 <%= @challenge.test_set_score ? "" : "none" %>" name="percentagenumbox">
<input class="fl martopf4 width44pxinline" name="test_set[score][]">
<span class="mr15 wid10px">%</span>
</span>
@ -237,8 +237,8 @@
<span class="color-blue font-16 fl mr20" name="sample_inputs_label">组<%= index + 1 %></span>
<!---------填写百分比----------->
<span class="fl color-grey-6 width90px mt3 none" name="percentagenumbox">
<input class="fl martopf4 width44pxinline" name="test_set[score][]">
<span class="fl color-grey-6 width90px mt3 <%= @challenge.test_set_score ? "" : "none" %>" name="percentagenumbox">
<input class="fl martopf4 width44pxinline" name="test_set[score][]" value="<%= test.score %>">
<span class="mr15 wid10px">%</span>
</span>
<!-------------------->
@ -328,10 +328,10 @@
$(function(){
//填写百分比初始化
$("#All_tests").attr('checked', 'checked');
if($("#All_tests").is(":checked")){
$("#System_score_percentage").hide()
}
//$("#All_tests").attr('checked', 'checked');
//if($("#All_tests").is(":checked")){
// $("#System_score_percentage").hide()
// }
// 设置textarea的宽度到140以后出现滚动条
var test_set_inputs = document.getElementsByName("test_set[input][]");

Loading…
Cancel
Save