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 %>
  • - <%= link_to '评论', shixun_discuss_shixun_path(@myshixun.shixun), :class => "tab_type", :style => "font-size: 16px", :remote => true %> + 评论<%= @discusses_count %> + <%#= link_to '', shixun_discuss_shixun_path(@myshixun.shixun), :class => "tab_type", :style => "font-size: 16px", :remote => true %>
  • <% if @st == 0 %> 经验值:<%= @game_challenge.score %> 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+":"); From 27645d172d524162781214b56b46d3181979da90 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 15 Sep 2017 23:14:17 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E6=88=90=E9=95=BF?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E4=B8=AD=E5=BF=83-=E9=87=91=E5=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_grade.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_user_grade.html.erb b/app/views/users/_user_grade.html.erb index 6e3741ce6..891b89484 100644 --- a/app/views/users/_user_grade.html.erb +++ b/app/views/users/_user_grade.html.erb @@ -1,5 +1,5 @@
    - <%= link_to "金币收入", user_grade_user_path(@user), :class => 'edu-filter-cir-grey fl active', :remote => true, :id => 'score_income' %> + <%= link_to "金币收入", user_grade_user_path(@user), :class => 'edu-filter-cir-grey fl active mr10', :remote => true, :id => 'score_income' %> <%= link_to "金币支出", user_grade_user_path(@user, :type => 2), :class => 'edu-filter-cir-grey fl', :remote => true, :id => 'score_expand' %>

    当前金币:<%= @user.grade %>,您可以通过<%= link_to '完善基本资料', my_account_path(), :class => "color-orange03" %> From a696e9d56da727ff5f473af981d7adef77cff56c Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 15 Sep 2017 23:15:24 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=8F=AA=E8=AF=BE=E5=A0=82500=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_common/setting.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/homework_common/setting.html.erb b/app/views/homework_common/setting.html.erb index d72c520e3..34c969abc 100644 --- a/app/views/homework_common/setting.html.erb +++ b/app/views/homework_common/setting.html.erb @@ -6,7 +6,7 @@

    <%= 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) %>

    From 1f1fbbfb274745680334834d532a64c9f93bc7e2 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 15 Sep 2017 23:31:22 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=8F=91=E9=80=81=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_share_message_to_course.html.erb | 6 +++--- app/views/users/share_message_to_course.js.erb | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) 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 @@
    -

    发送资源

    +

    发送帖子

    - 选择的资源将会发送到指定课堂 + 选择的帖子将会发送到指定课堂
    - <%= form_tag search_user_course_user_path(user, :send_message => 1),:method => 'get', :remote => true, :id => 'course_list_form', :class=> '' do %> + <%= form_tag search_user_course_user_path(user, :send_message => 1),:method => 'get', :remote => true, :id => '', :class=> '' do %> <%= hidden_field_tag(:send_id, send_id) %> <%= hidden_field_tag(@send_ids,send_ids) %> 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 From a6b99d1a908c1a8d359b5a3eedd412775e6e4d20 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sun, 17 Sep 2017 09:41:06 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=90=88=E4=BD=9C=E8=80=85=E7=9A=84=E8=BA=AB=E4=BB=BD=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/settings/_search_not_teachers_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/courses/settings/_search_not_teachers_list.html.erb b/app/views/courses/settings/_search_not_teachers_list.html.erb index 90a5d01ea..4c69f8452 100644 --- a/app/views/courses/settings/_search_not_teachers_list.html.erb +++ b/app/views/courses/settings/_search_not_teachers_list.html.erb @@ -7,7 +7,7 @@ From c4657764162f1b7f3822ba517295100d1ff20633 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Sun, 17 Sep 2017 11:06:22 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=B8=96=E5=AD=90=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/messages/_course_show.html.erb | 6 +++--- public/stylesheets/css/edu-common.css | 2 +- public/stylesheets/css/edu-public.css | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 68592a773..40e308dda 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -25,10 +25,10 @@
    <%= link_to image_tag(url_to_avatar(@topic.author), :width => 60, :height => 60, :alt => "用户头像", :class => "panel-list-img mr15"), user_path(@topic.author),:class => "fl" %> -
    +

    - <%= 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/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index b13bf741c..dff21d46b 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -96,7 +96,7 @@ a:hover.link-color-grey03{color:#3498db!important;} .font-28{ font-size: 28px!important;} .font-30{ font-size: 30px!important;} /*通用内外边距*/ -.mt-10{ margin-top:-10px;}.mt3{ margin-top:3px;}.mt5{ margin-top:5px;}.mt6{ margin-top:6px;}.mt7{ margin-top:7px;}.mt8{ margin-top:8px;}.mt10{ margin-top:10px;}.mt12{ margin-top:12px;}.mt15{ margin-top:15px;}.mt20{ margin-top:20px;}.mt25{ margin-top:25px;}.mt30{ margin-top:30px;}.mt50{ margin-top:50px;} +.mt-10{ margin-top:-10px;}.mt2{ margin-top:2px;}.mt3{ margin-top:3px;}.mt5{ margin-top:5px;}.mt6{ margin-top:6px;}.mt7{ margin-top:7px;}.mt8{ margin-top:8px;}.mt10{ margin-top:10px;}.mt12{ margin-top:12px;}.mt15{ margin-top:15px;}.mt20{ margin-top:20px;}.mt25{ margin-top:25px;}.mt30{ margin-top:30px;}.mt50{ margin-top:50px;} .mb5{ margin-bottom: 5px;}.mb10{ margin-bottom: 10px;}.mb15{ margin-bottom: 15px;}.mb20{ margin-bottom: 20px;}.mb25{ margin-bottom: 25px;}.mb30{ margin-bottom: 30px;}.mb40{ margin-bottom: 40px;}.mb50{ margin-bottom: 50px;} .ml-3{ margin-left: -3px;}.ml5{ margin-left: 5px;}.ml6{ margin-left: 6px;}.ml10{ margin-left: 10px;}.ml15{ margin-left: 15px;}.ml20{ margin-left: 20px;}.ml25{ margin-left: 25px;}.ml30{ margin-left: 30px;}.ml33{ margin-left: 33px;}.ml35{ margin-left:35px;}.ml40{margin-left:40px;}.ml42{margin-left:42px;}.ml50{ margin-left: 50px;}.ml75{ margin-left: 75px;}.ml95{ margin-left: 95px;}.ml115{margin-left: 115px}.ml230{ margin-left: 230px;} .mr3{margin-right: 3px}.mr5{ margin-right: 5px;}.mr10{ margin-right: 10px;}.mr15{ margin-right: 15px;}.mr18{ margin-right: 18px;}.mr20{ margin-right: 20px;}.mr25{ margin-right: 25px;}.mr30{ margin-right:30px;}.mr40{margin-right:40px;}.mr50{ margin-right: 50px;}.mr60{ margin-right:60px;} diff --git a/public/stylesheets/css/edu-public.css b/public/stylesheets/css/edu-public.css index 729ca4470..31779d857 100644 --- a/public/stylesheets/css/edu-public.css +++ b/public/stylesheets/css/edu-public.css @@ -95,7 +95,7 @@ a:hover.panel-list-title{color:#FF7500;} a.panel-name-small{ display: inline-block; max-width:100px; color:#29bd8b; font-size:12px; } .panel-list-infobox{ width: 92%; margin-left:8%; margin-top:-70px;} .panel-lightgrey,.panel-lightgrey span{ font-size:12px; color:#888;} -.panel-inner-info{ width: 92%; margin-left:8%;} +.panel-inner-info{ width: 93%; margin-left:7%;} .panel-bg-grey{ padding:5px 0;background:#f6f6f6; width: 100%; color:#666;} .panel-list-nodata{ width: 420px; margin:100px auto; text-align: center;} From 39064be34b11a3e71ac49e8d9459aeddf8d92a96 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sun, 17 Sep 2017 11:08:03 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=9B=86=E6=8F=90=E7=A4=BA=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 4 ++++ app/views/challenges/_edit_evaluating.html.erb | 4 ++-- public/javascripts/edu/edu_tpi.js | 10 ++++++++-- public/stylesheets/css/taskstyle.css | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) 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? %>

    <% end %> <% else %> 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, "
    "))) + "

    " + "
    " + "
  • " + "" + diff --git a/public/stylesheets/css/taskstyle.css b/public/stylesheets/css/taskstyle.css index 61aa8718b..3ead512f1 100644 --- a/public/stylesheets/css/taskstyle.css +++ b/public/stylesheets/css/taskstyle.css @@ -415,5 +415,5 @@ html>body #ajax-indicator-base { position: fixed; } .save-tip{display:none;position: fixed;top:0px;left: 0px;width: 100%;height: 100%;} .save-tip-content{position: absolute;top:50%;left: 50%;margin-left: -36px;margin-top:-19px;background: rgba(0,0,0,0.7);color:#fff;padding:5px 15px;border-radius: 4px} .empty{background: #494A4C;display: inline; margin: 0 2px; padding: 0 3px;} - +.tab-key{background: #494A4C;display: inline; margin: 0 2px; padding: 0 12px;} .nav_check_item li{padding: 0px 17px!important;}