Merge branch 'dev_TPI' of https://bdgit.trustie.net/hushasha/bigdata into dev_TPI
This commit is contained in:
commit
f7841bcfde
|
|
@ -251,17 +251,6 @@ function code_evaluation(test_sets,
|
|||
}
|
||||
|
||||
//第二块 测试结果
|
||||
|
||||
$TestResult = "<div id=\"blacktab_con_2\" class=\" " + (language == 'Html' ? 'undis' : '') + "\">" +
|
||||
"<div class=\"fit -scroll\">" +
|
||||
"<div class=\"-layout-v -fit\">" +
|
||||
"<div class=\"-flex -scroll task-padding16 loading-center undis\" id=\"evaluating_ajax_loading\"></div>" +
|
||||
"<div class=\"-flex -scroll task-padding16\" id=\"evaluating_contents\">" +
|
||||
|
||||
"</div>" +
|
||||
"</div>" +
|
||||
"</div>" +
|
||||
"</div>";
|
||||
if (had_test_count != "0") {
|
||||
if (had_passed_testsests_error_count != "0") {
|
||||
$d = "<p class=\"-text-danger mb10\">" +
|
||||
|
|
@ -273,20 +262,14 @@ function code_evaluation(test_sets,
|
|||
"<i class=\"fa fa-check-circle font-16\" ></i>" +
|
||||
"<span class=\"ml5 mr5\">" + test_sets_count / test_sets_count + "</span> 全部通过</p>";
|
||||
}
|
||||
$("#evaluating_contents").html($d);
|
||||
|
||||
}
|
||||
console.log(test_sets.length);
|
||||
for (var i = 0; i < test_sets.length; i++) {
|
||||
console.log("test_sets[" +i+"]" + test_sets[i].result);
|
||||
console.log("test_sets[" +i+"]" + test_sets[i].is_public);
|
||||
console.log("test_sets[" +i+"]" + test_sets[i].actual_output);
|
||||
console.log("test_sets[" +i+"]" + test_sets[i].output);
|
||||
console.log("test_sets[" +i+"]" + test_sets[i].input);
|
||||
$e = "<div class=\"-task-ces-box mb15 clearfix\"></div>";
|
||||
$f = "<div class=\"-task-ces-top\" onclick=\"toggle_test_case(' test_sets[" + i + "].is_public ', ' i')\" style=\"cursor:pointer\">" +
|
||||
"<i class=\"fa fa-caret-right mr5 font-16\" ></i>" +
|
||||
"<span class=\"font-14\">测试集 " + i + "+ 1</span>" +
|
||||
"</div>";
|
||||
if (test_sets[i].result == 0) {
|
||||
$g = "<i class=\"fa fa-exclamation-circle -text-danger fr mt8 ml5\" ></i>"
|
||||
}
|
||||
|
|
@ -296,9 +279,57 @@ function code_evaluation(test_sets,
|
|||
if (test_sets[i].is_public == 0) {
|
||||
$g = "<i class=\"fa fa-lock fr mt8\" ></i>"
|
||||
}
|
||||
$("#evaluating_contents").append($e);
|
||||
$("#evaluating_contents").append($f);
|
||||
$(".-task-ces-top").html($g);
|
||||
if (test_sets[i].is_public == 1) {
|
||||
$h = "<div class=\"-task-ces-info undis\" id=\"test_case_ " + i + " \">" +
|
||||
"<ul class=\"font-14\">" +
|
||||
"<li class=\"clearfix\">" +
|
||||
"<div class=\"clearfix\">" +
|
||||
"<span class=\"-task-ces-info-left color-blue fl fb\">测试输入:</span>" +
|
||||
"<p class=\"fl\" style=\"width: 90%;\">" + test_sets[i].input == null ? "+空+" : test_sets[i].input.replace(/\r\n/g, "<br>") + " </p>" +
|
||||
"</div>" +
|
||||
"</li>" +
|
||||
"<li class=\"clearfix\">" +
|
||||
"<div class=\"clearfix\">" +
|
||||
" <span class=\"-task-ces-info-left color-blue fl fb\">预期输出:</span>" +
|
||||
"<p class=\"fl\" style=\"width: 90%;\">" + test_sets[i].output == null ? "+空+" : test_sets[i].output.replace(/\r\n/g, "<br>") + "</p>" +
|
||||
"</div>" +
|
||||
"</li>" +
|
||||
"<li class=\"clearfix\">" +
|
||||
"<div class=\"clearfix\">" +
|
||||
"<span class=\"-task-ces-info-left color-blue fl fb\">实际输出:</span>" +
|
||||
"<p class=\"fl color-orange\" style=\"width: 90%;\">" + test_sets[i].actual_output == null ? "+空+" : test_sets[i].actual_output.replace(/\r\n/g, "<br>") + "</p>" +
|
||||
"</div>" +
|
||||
"</li>" +
|
||||
"</ul>" +
|
||||
"</div>";
|
||||
}
|
||||
if (test_sets[i].is_public == 0) {
|
||||
$h = "<div class=\"-task-ces-info undis\" id=\"test_case_ " + i + " \">" +
|
||||
" <ul class=\"font-14\">" +
|
||||
" <li class=\"clearfix\">" +
|
||||
"<div class=\"clearfix\">" +
|
||||
"<p class=\"fl color-orange\" style=\"width: 90%;margin-left: 34px;\">此为隐藏测试项,暂不支持查看</p>" +
|
||||
" </div>" +
|
||||
"</li>" +
|
||||
" </ul>" +
|
||||
"</div>";
|
||||
|
||||
}
|
||||
$e = "<div class=\"-task-ces-box mb15 clearfix\">"+$h+"</div>";
|
||||
$f = "<div class=\"-task-ces-top\" onclick=\"toggle_test_case(' test_sets[" + i + "].is_public ', ' i')\" style=\"cursor:pointer\">" +
|
||||
"<i class=\"fa fa-caret-right mr5 font-16\" ></i>" +
|
||||
"<span class=\"font-14\">测试集 " + i + "+ 1</span>" +$g+"</div>";
|
||||
if (test_sets[i].result == 0) {
|
||||
$g = "<i class=\"fa fa-exclamation-circle -text-danger fr mt8 ml5\" ></i>"
|
||||
}
|
||||
if (test_sets[i].result == 1) {
|
||||
$g = "<i class=\"fa fa-check-circle color-light-green fr mt8 ml5 font-16\" ></i>"
|
||||
}
|
||||
if (test_sets[i].is_public == 0) {
|
||||
$g = "<i class=\"fa fa-lock fr mt8\" ></i>"
|
||||
}
|
||||
|
||||
//$(".-task-ces-top").html($g);
|
||||
|
||||
if (test_sets[i].is_public == 1) {
|
||||
$h = "<div class=\"-task-ces-info undis\" id=\"test_case_ " + i + " \">" +
|
||||
|
|
@ -336,17 +367,39 @@ function code_evaluation(test_sets,
|
|||
"</div>";
|
||||
|
||||
}
|
||||
$(".-task-ces-box").append($h);
|
||||
//$(".-task-ces-box").append($h);
|
||||
}
|
||||
$TestResult = "<div id=\"blacktab_con_2\" class=\" " + (language == 'Html' ? 'undis' : '') + "\">" +
|
||||
"<div class=\"fit -scroll\">" +
|
||||
"<div class=\"-layout-v -fit\">" +
|
||||
"<div class=\"-flex -scroll task-padding16 loading-center undis\" id=\"evaluating_ajax_loading\"></div>" +
|
||||
"<div class=\"-flex -scroll task-padding16\" id=\"evaluating_contents\">" +$d+$e+$f+"</div>" +
|
||||
"</div>" +
|
||||
"</div>" +
|
||||
"</div>";
|
||||
|
||||
console.log(test_sets.length);
|
||||
|
||||
|
||||
//第三块 评测信息
|
||||
if (had_test_count != "0") {
|
||||
if (had_passed_testsests_error_count != "0") {
|
||||
$n = "<p class=\"-text-danger mb10\">" +
|
||||
"<i class=\"fa fa-exclamation-circle font-16\" ></i>" +
|
||||
"<span class=\"ml5 mr5 -text-danger\">" + had_passed_testsests_error_count / test_sets_count + "</span> " + latest_output + "</p>";
|
||||
|
||||
} else {
|
||||
$n = "<p class=\"color-light-green mb10\">" +
|
||||
"<i class=\"fa fa-check-circle font-16 \" ></i>" +
|
||||
"<span class=\"ml5 mr5\">" + test_sets_count / test_sets_count + "</span> 全部通过</p>";
|
||||
}
|
||||
// $("#evaluating_info").html($n);
|
||||
}
|
||||
$EvaluationInformation = "<div id=\"blacktab_con_3\" class=\"undis\" >" +
|
||||
"<div class=\"fit -scroll\">" +
|
||||
"<div class=\"-layout-v -fit\">" +
|
||||
"<div class=\"-flex -scroll task-padding16 loading-center undis\" id=\"info_ajax_loading\"></div>" +
|
||||
"<div class=\"-flex -scroll task-padding16\" id=\"evaluating_info\">" +
|
||||
|
||||
"<div class=\"-task-ces-box mb10 clearfix\">" +
|
||||
"<div class=\"-flex -scroll task-padding16\" id=\"evaluating_info\">" +$n+"<div class=\"-task-ces-box mb10 clearfix\">" +
|
||||
"<div class=\"-task-ces-info\">" +
|
||||
"<ul>" +
|
||||
"<li>" +
|
||||
|
|
@ -374,23 +427,13 @@ function code_evaluation(test_sets,
|
|||
"</div>";
|
||||
|
||||
|
||||
if (had_test_count != "0") {
|
||||
if (had_passed_testsests_error_count != "0") {
|
||||
$n = "<p class=\"-text-danger mb10\">" +
|
||||
"<i class=\"fa fa-exclamation-circle font-16\" ></i>" +
|
||||
"<span class=\"ml5 mr5 -text-danger\">" + had_passed_testsests_error_count / test_sets_count + "</span> " + latest_output + "</p>";
|
||||
|
||||
} else {
|
||||
$n = "<p class=\"color-light-green mb10\">" +
|
||||
"<i class=\"fa fa-check-circle font-16 \" ></i>" +
|
||||
"<span class=\"ml5 mr5\">" + test_sets_count / test_sets_count + "</span> 全部通过</p>";
|
||||
}
|
||||
$("#evaluating_info").html($n);
|
||||
}
|
||||
var $html = $EffectDisplay + $TestResult + $EvaluationInformation;
|
||||
console.log("第一块区域:" + $EffectDisplay);
|
||||
console.log("第二块区域:" + $TestResult);
|
||||
console.log("第三块区域:" + $EvaluationInformation);
|
||||
console.log($("#evaluating_info"));
|
||||
console.log($(".-task-ces-box"));
|
||||
console.log("had_test_count: " + had_test_count);
|
||||
console.log("test_sets_count: " + test_sets_count);
|
||||
console.log("had_passed_testsests_error_count: " + had_passed_testsests_error_count);
|
||||
|
|
@ -402,5 +445,7 @@ function code_evaluation(test_sets,
|
|||
console.log("language: " + language);
|
||||
$("#game_test_set_results").html($html);
|
||||
}
|
||||
console.log($("#evaluating_info"));
|
||||
console.log($(".-task-ces-box"));
|
||||
// end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue