From 491d92848ea77610bf6078827cfc0156bb6bcb94 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 15 Sep 2017 22:48:42 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E8=AF=84=E8=AE=BA=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=95=B0=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 1 + app/views/games/_game_show.html.erb | 3 ++- app/views/shixuns/shixun_discuss.js.erb | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index ee9696828..335db9cb0 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -48,6 +48,7 @@ class GamesController < ApplicationController @rev = @rev.nil? ? "master" : @rev @type = params[:type] challenge_path = @game_challenge.path + @discusses_count = @shixun.discusses.where(:parent_id => nil).count # 用户选项 #@user_answer = @game.outputs.first.actual_output.split("") unless @st == 0 || @game.outputs.blank? # 默认打开文件 diff --git a/app/views/games/_game_show.html.erb b/app/views/games/_game_show.html.erb index 470efa95d..ed5c677a5 100644 --- a/app/views/games/_game_show.html.erb +++ b/app/views/games/_game_show.html.erb @@ -33,7 +33,8 @@ <% end %>
当前金币:<%= @user.grade %>,您可以通过<%= link_to '完善基本资料', my_account_path(), :class => "color-orange03" %>
From a696e9d56da727ff5f473af981d7adef77cff56c Mon Sep 17 00:00:00 2001
From: huang
<%= link_to @course.name, course_path(@course) %>
- > <%= link_to "#{@homework.homework_type_ch}作业", homework_common_index_path(:course => @course.id, :homework_type => @homework.homework_type) %> > #<%= link_to (get_hw_index(@homework, @is_teacher, @homework.homework_type) + 1), student_work_index_path(:homework => @homework.id) %>
+ > <%= link_to "#{@homework.homework_type_ch}作业", homework_common_index_path(:course => @course.id, :homework_type => @homework.homework_type) %> > #<%= link_to (get_hw_index(@homework, @is_teacher, @homework.homework_type).to_i + 1), student_work_index_path(:homework => @homework.id) %>
- <%= link_to @topic.author.show_real_name, user_path(@topic.author), :class => 'panel-name-small hide fl font-12 mt5 mr5 color-grey' %>
- 发表于<%= time_from_now(@topic.created_on) %>
+ <%= link_to @topic.author.show_real_name, user_path(@topic.author), :class => 'panel-name-small hide fl font-14 mr15 color-grey' %>
+ 发表于<%= time_from_now(@topic.created_on) %>
<%= test.input.gsub(" ", "").gsub(/\r\n$/, " <%= test.output.gsub(" ", "").gsub(/\r\n$/, " <%= match_specific_symbol test.input unless test.input.blank? %> <%= match_specific_symbol test.output unless test.output.blank? %> " + ( test_sets[i].output == null ? "空" : test_sets[i].output.replace(/\r\n/g, " " + ( test_sets[i].output == null ? "空" : match_specific_symbol(test_sets[i].output)) + " " + (test_sets[i].actual_output == null ? "空" : (test_sets[i].compile_success == "1" ? test_sets[i].actual_output.replace(/\r\n$/, " " + (test_sets[i].actual_output == null ? "空" : (test_sets[i].compile_success == "1" ? match_specific_symbol(test_sets[i].actual_output) : test_sets[i].actual_output.replace(/\r\n/g, "
").gsub(/\t/, "").html_safe
+ end
+
# 积分表中建立记录行为,有过奖励则不重复奖励
def reward_grade(user, container_id, container_type, score)
grade = Grade.where(:user_id => user.id, :container_id => container_id, :container_type => container_type).first
diff --git a/app/views/challenges/_edit_evaluating.html.erb b/app/views/challenges/_edit_evaluating.html.erb
index 97cc18ed7..51d998feb 100644
--- a/app/views/challenges/_edit_evaluating.html.erb
+++ b/app/views/challenges/_edit_evaluating.html.erb
@@ -48,8 +48,8 @@
<% end %>
-
").html_safe unless test.input.blank? %>
").html_safe unless test.output.blank? %>
").replace(/\t/g, "")
+ return str
+};
+
$(document).ready(setupAjaxIndicatorBase);
// test_sets:测试集;had_test_count:输出集的个数;test_sets_count:测试集的个数;had_passed_testsests_error_count:测试集报错数;test_sets_hidden_count:隐藏测试集的个数
// test_sets_public_count:公开测试集的个人;had_passed_testsests_hidden_count:通过的隐藏集个数;had_passed_testsests_public_count:通过的公开测试集个数
@@ -437,13 +443,13 @@ function code_evaluation(test_sets,
"
").replace(/\t/g, " ").replace(/ /g, "") ) + "
").replace(/ /g, "") : test_sets[i].actual_output.replace(/\r\n/g, "
"))) + "
"))) + "