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/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 9788e36ba..33957a6b4 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -162,6 +162,10 @@ module ApplicationHelper
end
end
+ def match_specific_symbol(str)
+ str.gsub(" ", "").gsub(/\r\n$/, "").gsub("\r\n", "
").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 %>
<%= test.input.gsub(" ", "").gsub(/\r\n$/, "
").html_safe unless test.input.blank? %>
<%= test.output.gsub(" ", "").gsub(/\r\n$/, "
").html_safe unless test.output.blank? %>
<%= match_specific_symbol test.input unless test.input.blank? %>
<%= match_specific_symbol test.output unless test.output.blank? %>
<%= 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) %>
<% if User.current.logged? %> diff --git a/app/views/shixuns/shixun_discuss.js.erb b/app/views/shixuns/shixun_discuss.js.erb index fac26ce2e..685e7e762 100644 --- a/app/views/shixuns/shixun_discuss.js.erb +++ b/app/views/shixuns/shixun_discuss.js.erb @@ -3,7 +3,7 @@ $(".-tab-nav li").removeClass("tab_hover"); $('#tab_nav_4').addClass("tab_hover"); $(".tab-info").hide(); $('#tab_con_4').show().html("<%= j(render :partial => "games/shixun_comment_list") %>"); - +$("#discusses_count").html("<%= @discusses_count %>"); // 评论区域的回复按钮 function reply_to_dis(id, name){ $("#comment_news").attr("placeholder", "回复"+name+":"); diff --git a/app/views/users/_share_message_to_course.html.erb b/app/views/users/_share_message_to_course.html.erb index dcfbe133a..86a59b22f 100644 --- a/app/views/users/_share_message_to_course.html.erb +++ b/app/views/users/_share_message_to_course.html.erb @@ -1,17 +1,17 @@当前金币:<%= @user.grade %>,您可以通过<%= link_to '完善基本资料', my_account_path(), :class => "color-orange03" %>
diff --git a/app/views/users/share_message_to_course.js.erb b/app/views/users/share_message_to_course.js.erb
index 5a5046dfa..d1d5bd39a 100644
--- a/app/views/users/share_message_to_course.js.erb
+++ b/app/views/users/share_message_to_course.js.erb
@@ -1,2 +1 @@
-hideModal();
-alert("发送成功!");
\ No newline at end of file
+notice_box("发送成功!");
\ No newline at end of file
diff --git a/public/javascripts/edu/edu_tpi.js b/public/javascripts/edu/edu_tpi.js
index ad20d65f8..0c5846370 100644
--- a/public/javascripts/edu/edu_tpi.js
+++ b/public/javascripts/edu/edu_tpi.js
@@ -358,6 +358,12 @@ function setupAjaxIndicatorBase() {
}
});
}
+
+function match_specific_symbol(str){
+ str = str.replace(/ /g, "").replace(/\r\n$/, "").replace(/\r\n/g, "
").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,
"
" + ( test_sets[i].output == null ? "空" : test_sets[i].output.replace(/\r\n/g, "
").replace(/\t/g, " ").replace(/ /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$/, "
").replace(/ /g, "") : test_sets[i].actual_output.replace(/\r\n/g, "
"))) + "
" + (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, "
"))) + "