From ec56f1f05a8bddb87cabc4344abdee46900886da Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 25 Sep 2017 16:50:51 +0800 Subject: [PATCH 01/27] =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 8 ++++ .../challenges/_evaluating_form.html.erb | 38 ++++++++++++++++++- config/routes.rb | 1 + 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index d11285bc7..609f1eec4 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -14,6 +14,14 @@ class ShixunsController < ApplicationController CODES = %W(2 3 4 5 6 7 8 9 A B C D E F G H J K L N M O P Q R S T U V W X Y Z) DCODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z) + # 获取版本库文件目录 + def search_file_list + path = params[:path] + g = Gitlab.client + dir = g.trees(@shixun.gpid).map{|tree| tree.name} + logger.info("dir is ##{dir}") + render :json => {:dir => dir} + end def statistics_students @statistics = @shixun.myshixuns.order("created_at desc") diff --git a/app/views/challenges/_evaluating_form.html.erb b/app/views/challenges/_evaluating_form.html.erb index 46e28bf47..45702ef51 100644 --- a/app/views/challenges/_evaluating_form.html.erb +++ b/app/views/challenges/_evaluating_form.html.erb @@ -18,8 +18,10 @@
  • - <%= f.text_field :path, :class => "panel-form-width-690 panel-box-sizing fl", :no_label => true, :placeholder => "进入实训后将默认打开该文件,如:src/test/welcome.java", :maxlength => "256" %> + <%#= f.text_field :path, :class => "panel-form-width-690 panel-box-sizing fl", :no_label => true, :placeholder => "进入实训后将默认打开该文件,如:src/test/welcome.java", :maxlength => "256" %> + +
    • @@ -100,6 +102,13 @@ bt.LEFT_DELIMITER = ''; + // 获取版本库路径 + $("#shixun_file_path").on('click', function (e) { + alert("test"); + search_shixun_files_ajax(); +// throttle(search_not_teacher_f, window, e); + }); + $("#shixun_form").on('click', 'a.test_icon_add', function () { var html = bt('t:test-answer-list', null); $(this).parent().parent('.clearfix').after(html); @@ -155,8 +164,33 @@ $(inputs_labels[j]).html("组" + (j + 1)); } }); - }); + + function search_shixun_files_ajax(){ + $.ajax({ + url: '<%= search_file_list_shixun_path(@shixun) %>', + type: 'get', + success: function (data) { + alert(data.dir); + if(data.dir.length > 0){ + alert(data.dir); + $(".course_list_ul").empty(); + for(var i=0; i

      " + data.dir[i][0] + "

    • "); + } + $(".course_list_ul").show(); + if($(".course_list_ul").find("li").length>5){ + $(".course_list_ul").css("overflow-y","scroll"); + } else{ + $(".course_list_ul").css("overflow-y","hidden"); + } + } else{ + $(".course_list_ul").hide(); + } + } + }); + } + // 判断测试集是否锁定, 0未锁定,1锁定 function test_set_whether_lock(){ var lock = document.getElementsByName("test_set[lock][]"); diff --git a/config/routes.rb b/config/routes.rb index 700d20d6a..9fb0d4d72 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -106,6 +106,7 @@ RedmineApp::Application.routes.draw do get 'search_user_courses' post 'send_to_course' get 'statistics_students' + get 'search_file_list' end collection do get 'shixun_courses' From ce9630b6cd8da06fc8846044f4a4ae53b314de4a Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 26 Sep 2017 10:01:03 +0800 Subject: [PATCH 02/27] =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 4 ++-- app/views/challenges/_evaluating_form.html.erb | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 609f1eec4..ee87d34bc 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -17,8 +17,9 @@ class ShixunsController < ApplicationController # 获取版本库文件目录 def search_file_list path = params[:path] + path = to_path_param(path) g = Gitlab.client - dir = g.trees(@shixun.gpid).map{|tree| tree.name} + dir = g.trees(@shixun.gpid, :path => path).map{|tree| [tree.type,tree.name]} logger.info("dir is ##{dir}") render :json => {:dir => dir} end @@ -31,7 +32,6 @@ class ShixunsController < ApplicationController @statistic_pages = Paginator.new @statistics_count, @limit, params['page'] || 1 @offset ||= @statistic_pages.offset @statistics = paginateHelper @statistics, @limit - end # push代码的时候会触发gitlab hook diff --git a/app/views/challenges/_evaluating_form.html.erb b/app/views/challenges/_evaluating_form.html.erb index 45702ef51..b1f943818 100644 --- a/app/views/challenges/_evaluating_form.html.erb +++ b/app/views/challenges/_evaluating_form.html.erb @@ -21,8 +21,9 @@ <%#= f.text_field :path, :class => "panel-form-width-690 panel-box-sizing fl", :no_label => true, :placeholder => "进入实训后将默认打开该文件,如:src/test/welcome.java", :maxlength => "256" %> -
        + +
      • <%= f.text_field :exec_path, :class => "panel-form-width-690 panel-box-sizing fl", :no_label => true, :placeholder => "输入关卡需要执行的文件路径,如:src/test/main.java", :maxlength => "256" %> From 74f97f79ad4f1d3808f652b30a5390978fca89e1 Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Wed, 27 Sep 2017 15:09:18 +0800 Subject: [PATCH 03/27] =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E7=9A=84=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 ++ app/views/shixuns/_achieve_ ways.html.erb | 33 +++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 app/views/shixuns/_achieve_ ways.html.erb diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 609f1eec4..5710a81ed 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -22,7 +22,9 @@ class ShixunsController < ApplicationController logger.info("dir is ##{dir}") render :json => {:dir => dir} end + def achieve_ways + end def statistics_students @statistics = @shixun.myshixuns.order("created_at desc") @statistics_count = @statistics.count diff --git a/app/views/shixuns/_achieve_ ways.html.erb b/app/views/shixuns/_achieve_ ways.html.erb new file mode 100644 index 000000000..22c32b233 --- /dev/null +++ b/app/views/shixuns/_achieve_ ways.html.erb @@ -0,0 +1,33 @@ + +
        +
        +

        文件路径

        + +
        +
        +
        +
          +
        • +
        +
        +
        +
        + + \ No newline at end of file From adb0aa3f667295cea28aabdcb3c2f461573a749f Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Sat, 30 Sep 2017 10:48:43 +0800 Subject: [PATCH 04/27] =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 1 + .../challenges/_evaluating_form.html.erb | 5 ++ app/views/shixuns/_achieve_ ways.html.erb | 33 ----------- app/views/shixuns/_achieve_ways.html.erb | 58 +++++++++++++++++++ 4 files changed, 64 insertions(+), 33 deletions(-) delete mode 100644 app/views/shixuns/_achieve_ ways.html.erb create mode 100644 app/views/shixuns/_achieve_ways.html.erb diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 5710a81ed..9eab2c97a 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -23,6 +23,7 @@ class ShixunsController < ApplicationController render :json => {:dir => dir} end def achieve_ways + @entries = Gitlab.client.trees(@shixun.gpid).map{|tree| tree.name} end def statistics_students diff --git a/app/views/challenges/_evaluating_form.html.erb b/app/views/challenges/_evaluating_form.html.erb index 45702ef51..25acfe256 100644 --- a/app/views/challenges/_evaluating_form.html.erb +++ b/app/views/challenges/_evaluating_form.html.erb @@ -106,6 +106,7 @@ $("#shixun_file_path").on('click', function (e) { alert("test"); search_shixun_files_ajax(); + achieve_ways(); // throttle(search_not_teacher_f, window, e); }); @@ -190,7 +191,11 @@ } }); } + function achieve_ways(){ + var htmlvalue = "<%= escape_javascript( render :partial => 'shixuns/achieve_ways') %>"; + pop_box_new(htmlvalue, 600, 400); + } // 判断测试集是否锁定, 0未锁定,1锁定 function test_set_whether_lock(){ var lock = document.getElementsByName("test_set[lock][]"); diff --git a/app/views/shixuns/_achieve_ ways.html.erb b/app/views/shixuns/_achieve_ ways.html.erb deleted file mode 100644 index 22c32b233..000000000 --- a/app/views/shixuns/_achieve_ ways.html.erb +++ /dev/null @@ -1,33 +0,0 @@ - -
        -
        -

        文件路径

        - -
        -
        -
        -
          -
        • -
        -
        -
        -
        - - \ No newline at end of file diff --git a/app/views/shixuns/_achieve_ways.html.erb b/app/views/shixuns/_achieve_ways.html.erb new file mode 100644 index 000000000..6a3a2e964 --- /dev/null +++ b/app/views/shixuns/_achieve_ways.html.erb @@ -0,0 +1,58 @@ + +
        +
        +

        文件路径

        + +
        +
        +
        +
          + <% @entries.each do |entry| %> + <% tr_id = Digest::MD5.hexdigest(entry.path) + depth = params[:depth].to_i %> + <% sub_path = entry.path[0] == "/" ? entry.path.sub("/", "") : entry.path %> + <% ent_path = Redmine::CodesetUtil.replace_invalid_utf8(sub_path) %> + <% ent_name = Redmine::CodesetUtil.replace_invalid_utf8(entry.name) %> +
        • + +
        • + <% end %> +
        + +
        +
        +
        + + \ No newline at end of file From c8262cfeaa0f531f20c5b2e4f5dd262a07b17144 Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Sat, 30 Sep 2017 15:32:27 +0800 Subject: [PATCH 05/27] =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E7=9A=84=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/challenges_controller.rb | 3 ++ app/controllers/shixuns_controller.rb | 10 ++++-- app/views/shixuns/_achieve_ways.html.erb | 41 ++++++++++++------------ config/routes.rb | 1 + 4 files changed, 33 insertions(+), 22 deletions(-) diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index aef0170ff..2881e53f5 100644 --- a/app/controllers/challenges_controller.rb +++ b/app/controllers/challenges_controller.rb @@ -91,6 +91,9 @@ class ChallengesController < ApplicationController end def edit + @repository = @shixun.repository + @entries = @repository.entries(@path, @rev) + @st = @challenge.st challenge_num = Challenge.where(:shixun_id => @shixun).count challenge_pos = @challenge.position diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 9eab2c97a..54a35e8f6 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -16,16 +16,22 @@ class ShixunsController < ApplicationController # 获取版本库文件目录 def search_file_list + @repository = @shixun.repository + @entries = @repository.entries(@path, @rev) + path = params[:path] g = Gitlab.client dir = g.trees(@shixun.gpid).map{|tree| tree.name} logger.info("dir is ##{dir}") render :json => {:dir => dir} end - def achieve_ways - @entries = Gitlab.client.trees(@shixun.gpid).map{|tree| tree.name} + def achieve_ways + @repository = @shixun.repository + @entries = @repository.entries(@path, @rev) + # @entries = Gitlab.client.trees(@shixun.gpid).map{|tree| tree.name} end + def statistics_students @statistics = @shixun.myshixuns.order("created_at desc") @statistics_count = @statistics.count diff --git a/app/views/shixuns/_achieve_ways.html.erb b/app/views/shixuns/_achieve_ways.html.erb index 6a3a2e964..ca47ea645 100644 --- a/app/views/shixuns/_achieve_ways.html.erb +++ b/app/views/shixuns/_achieve_ways.html.erb @@ -1,5 +1,5 @@ -
        +

        文件路径

        @@ -33,26 +33,27 @@
      • <% end %> - + 取消 + 确定
        - \ No newline at end of file + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 9fb0d4d72..f79c60837 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -107,6 +107,7 @@ RedmineApp::Application.routes.draw do post 'send_to_course' get 'statistics_students' get 'search_file_list' + get 'achieve_ways' end collection do get 'shixun_courses' From 7588aa39a8eab6db8426c495d8c3a7bf15962bb2 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 30 Sep 2017 16:10:37 +0800 Subject: [PATCH 06/27] 0 --- app/controllers/challenges_controller.rb | 3 -- .../challenges/_evaluating_form.html.erb | 28 +++++-------------- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index 14665d7a1..375596075 100644 --- a/app/controllers/challenges_controller.rb +++ b/app/controllers/challenges_controller.rb @@ -91,9 +91,6 @@ class ChallengesController < ApplicationController end def edit - @repository = @shixun.repository - @entries = @repository.entries(@path, @rev) - @st = @challenge.st challenge_num = Challenge.where(:shixun_id => @shixun).count challenge_pos = @challenge.position diff --git a/app/views/challenges/_evaluating_form.html.erb b/app/views/challenges/_evaluating_form.html.erb index 948386fc7..837264d33 100644 --- a/app/views/challenges/_evaluating_form.html.erb +++ b/app/views/challenges/_evaluating_form.html.erb @@ -107,7 +107,7 @@ $("#shixun_file_path").on('click', function (e) { alert("test"); search_shixun_files_ajax(); - achieve_ways(); +// achieve_ways(); // throttle(search_not_teacher_f, window, e); }); @@ -173,30 +173,16 @@ url: '<%= search_file_list_shixun_path(@shixun) %>', type: 'get', success: function (data) { - alert(data.dir); - if(data.dir.length > 0){ - alert(data.dir); - $(".course_list_ul").empty(); - for(var i=0; i

        " + data.dir[i][0] + "

        "); - } - $(".course_list_ul").show(); - if($(".course_list_ul").find("li").length>5){ - $(".course_list_ul").css("overflow-y","scroll"); - } else{ - $(".course_list_ul").css("overflow-y","hidden"); - } - } else{ - $(".course_list_ul").hide(); - } + var htmlvalue = "ffffffffffffffffffffff<%#= escape_javascript( render :partial => 'shixuns/achieve_ways') %>"; + pop_box_new(htmlvalue, 600, 400); } }); } - function achieve_ways(){ - var htmlvalue = "<%= escape_javascript( render :partial => 'shixuns/achieve_ways') %>"; - pop_box_new(htmlvalue, 600, 400); - } +// function search_shixun_files_ajax(){ +// +// +// } // 判断测试集是否锁定, 0未锁定,1锁定 function test_set_whether_lock(){ var lock = document.getElementsByName("test_set[lock][]"); From 60707b1ed8caa77f4c26ab708e4f16a4262248d6 Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Sat, 30 Sep 2017 16:56:55 +0800 Subject: [PATCH 07/27] =?UTF-8?q?=E4=BA=8C=E6=AC=A1=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E7=9A=84=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_game_show.html.erb | 4 ++-- app/views/games/_shixun_comment_list.html.erb | 1 - app/views/shixuns/index.html.erb | 6 +++--- public/stylesheets/css/edu-public.css | 1 - public/stylesheets/css/taskstyle.css | 6 +++--- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/views/games/_game_show.html.erb b/app/views/games/_game_show.html.erb index 18e5eded5..7068bfccb 100644 --- a/app/views/games/_game_show.html.erb +++ b/app/views/games/_game_show.html.erb @@ -83,10 +83,10 @@ <%= render :partial => "games/shixun_comment_block" %>
      • 发送
      • - " onclick="game_praise('<%= @game_challenge.id %>', '<%= @game_challenge.class %>')" id="game_praise_tread" class="pt5 color-grey mr20"> + " onclick="game_praise('<%= @game_challenge.id %>', '<%= @game_challenge.class %>')" id="game_praise_tread" class="pt5 color-grey mr20"> " alt="赞" ><%= @praise_count %> - " onclick="game_tread('<%= @game_challenge.id %>')" id="game_tread" class="color-grey" style="padding-top:7px;"> + " onclick="game_tread('<%= @game_challenge.id %>')" id="game_tread" class="color-grey" style="padding-top:7px;"> " ><%= @tread_count %>
      • diff --git a/app/views/games/_shixun_comment_list.html.erb b/app/views/games/_shixun_comment_list.html.erb index d4a50066d..3bfb2a3fe 100644 --- a/app/views/games/_shixun_comment_list.html.erb +++ b/app/views/games/_shixun_comment_list.html.erb @@ -86,7 +86,6 @@ $points.show(); }); $("#comment_news").bind("input propertychange",function(){ - console.log(1); if($("#comment_news").val() != ''){ $points.hide(); } diff --git a/app/views/shixuns/index.html.erb b/app/views/shixuns/index.html.erb index 6c6b6d9a3..fc6235d62 100644 --- a/app/views/shixuns/index.html.erb +++ b/app/views/shixuns/index.html.erb @@ -98,7 +98,7 @@
      • 所有状态 -
        • <%= @syllabuses_num %>
          全部
        • -
        • <%= @create_syllabuses_count + @join_syllabuses_count %>
          我的课堂
        • +
        • <%= @my_courses_count %>
          我的课堂
        • <%= link_to "+ 新建".html_safe, new_course_path, :class => "fr font-16 white-btn orange-btn mt10" %> <%= link_to "+ 加入课堂".html_safe, join_private_courses_courses_path, :remote => true, :method => "post", :class => "fr mr30 font-16 white-btn orange-btn mt10" %> From ffe6388ef9a7df406294634d38a2ad1beccb47e7 Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 30 Sep 2017 19:17:51 +0800 Subject: [PATCH 10/27] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=8D=E9=9C=80=E8=A6=81=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=9C=AA=E8=AF=84=EF=BC=8C=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E2=80=9C=E4=BD=A0=E7=9A=84?= =?UTF-8?q?=E8=AF=84=E9=98=85=E2=80=9D=E9=9C=80=E8=A6=81=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_homework_index_list.html.erb | 10 ++++---- app/views/student_work/index.html.erb | 24 ++++++++++--------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/app/views/homework_common/_homework_index_list.html.erb b/app/views/homework_common/_homework_index_list.html.erb index cadda3248..4013d1c29 100644 --- a/app/views/homework_common/_homework_index_list.html.erb +++ b/app/views/homework_common/_homework_index_list.html.erb @@ -36,10 +36,12 @@ <%= link_to had_uncommit_studentwork_count(homework_common), student_work_index_path(:homework => homework_common.id, :tab => 2, :status => ['0']), :class => 'color-orange03 mr5', :target => '_blank' %> 未交 - - <%= link_to had_unevaluate_count(homework_common), student_work_index_path(:homework => homework_common.id, :tab => 2, :comment => ['0']), :class => 'color-orange03 mr5', :target => '_blank' %> - 未评 - + <% if homework_common.homework_type != 4 %> + + <%= link_to had_unevaluate_count(homework_common), student_work_index_path(:homework => homework_common.id, :tab => 2, :comment => ['0']), :class => 'color-orange03 mr5', :target => '_blank' %> + 未评 + + <% end %> <% else %> <%= link_to had_commit_studentwork_count(homework_common), student_work_index_path(:homework => homework_common.id, :tab => 2), :class => 'color-orange03 mr5', :target => '_blank' %> diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 4293c48ec..6f6e2511d 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -234,17 +234,19 @@ -
        • - 你的评阅: - - 不限 - - <% has_comment = User.current.student_works_scores.where(:student_work_id => @homework.student_works.map(&:id), :reviewer_role => [1, 2]).group_by(&:student_work_id).count %> - > - - > - -
        • + <% if @homework.homework_type != 4 %> +
        • + 你的评阅: + + 不限 + + <% has_comment = User.current.student_works_scores.where(:student_work_id => @homework.student_works.map(&:id), :reviewer_role => [1, 2]).group_by(&:student_work_id).count %> + > + + > + +
        • + <% end %>
        • 作品状态: From a45a85cce8b354063c3af46440d241bf3ca2230f Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Sat, 30 Sep 2017 19:23:51 +0800 Subject: [PATCH 11/27] =?UTF-8?q?=E5=BC=B9=E6=A1=86=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/_achieve_ways.html.erb | 30 +++++------------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/app/views/shixuns/_achieve_ways.html.erb b/app/views/shixuns/_achieve_ways.html.erb index ca4ec518c..aa5fd3e7d 100644 --- a/app/views/shixuns/_achieve_ways.html.erb +++ b/app/views/shixuns/_achieve_ways.html.erb @@ -1,16 +1,16 @@ -
          +

          文件路径

          -
            +
              <%= to_path_param(@path) %> <% if @dir.present? %> <% @dir.each do |entry| %> -
            • +
            • @@ -18,27 +18,9 @@ <% end %> <% end %>
            - 取消 - 确定 + + 确定 + 取消
          - - - - - - - - - - - - - - - - - - - \ No newline at end of file From b2304597b4e3a4ed1470ebce82e1cbb9225052b8 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 30 Sep 2017 19:25:35 +0800 Subject: [PATCH 12/27] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9B=AE=E5=BD=95=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- app/views/shixuns/_achieve_ways.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 64c6fb7c6..77b25309f 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -19,7 +19,7 @@ class ShixunsController < ApplicationController path = params[:path] @path = to_path_param(path) g = Gitlab.client - @dir = g.trees(@shixun.gpid, :path => path).map{|tree| [tree.type,tree.name]} + @dir = g.trees(@shixun.gpid, :path => @path).map{|tree|[tree.type, (@path.blank? ? tree.name : "#{@path}"+"/"+tree.name )]} logger.info("dir is ##{@dir}") respond_to do |format| format.js diff --git a/app/views/shixuns/_achieve_ways.html.erb b/app/views/shixuns/_achieve_ways.html.erb index ca4ec518c..f393c1800 100644 --- a/app/views/shixuns/_achieve_ways.html.erb +++ b/app/views/shixuns/_achieve_ways.html.erb @@ -12,7 +12,7 @@ <% @dir.each do |entry| %>
        • <% end %> From 1fd9f3a9dd7739fa9e4f6b44e9888ed4956affdd Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 30 Sep 2017 19:39:13 +0800 Subject: [PATCH 13/27] =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/_achieve_ways.html.erb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/shixuns/_achieve_ways.html.erb b/app/views/shixuns/_achieve_ways.html.erb index f393c1800..5251502e0 100644 --- a/app/views/shixuns/_achieve_ways.html.erb +++ b/app/views/shixuns/_achieve_ways.html.erb @@ -7,12 +7,17 @@
            + <%= to_path_param(@path) %> <% if @dir.present? %> <% @dir.each do |entry| %>
          • <% end %> From c1b4199f24eef4630bf8835697b6baf9c7e56edc Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 30 Sep 2017 20:08:42 +0800 Subject: [PATCH 14/27] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E5=9B=9E=E9=80=80=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/_achieve_ways.html.erb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/app/views/shixuns/_achieve_ways.html.erb b/app/views/shixuns/_achieve_ways.html.erb index 5251502e0..a582638e8 100644 --- a/app/views/shixuns/_achieve_ways.html.erb +++ b/app/views/shixuns/_achieve_ways.html.erb @@ -7,8 +7,21 @@
              - - <%= to_path_param(@path) %> + <% if @path.present? %> + <% + dirs = @path.split('/') + # if 'file' == kind + # filename = dirs.pop + # end + link_path = '' + dirs.each do |dir| + next if dir.blank? + link_path << '/' unless link_path.empty? + link_path << "#{dir}" + %> + <%= link_to (h(dir)+'/'), search_file_list_shixun_path(@shixun, :path => to_path_param(to_path_param(link_path))), :class => "f14 fb", :remote => true %> + <% end %> + <% end %> <% if @dir.present? %> <% @dir.each do |entry| %>
            • From 2f0d5155efe272ab63269a5e0c1c7460a7d4c55f Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 30 Sep 2017 20:09:23 +0800 Subject: [PATCH 15/27] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/_achieve_ways.html.erb | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/views/shixuns/_achieve_ways.html.erb b/app/views/shixuns/_achieve_ways.html.erb index a582638e8..870c396bc 100644 --- a/app/views/shixuns/_achieve_ways.html.erb +++ b/app/views/shixuns/_achieve_ways.html.erb @@ -10,9 +10,6 @@ <% if @path.present? %> <% dirs = @path.split('/') - # if 'file' == kind - # filename = dirs.pop - # end link_path = '' dirs.each do |dir| next if dir.blank? From 0760e7d9e0f9fd318831ebccbcbd452997bde6dd Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Sat, 30 Sep 2017 20:10:35 +0800 Subject: [PATCH 16/27] =?UTF-8?q?=E8=B7=AF=E5=BE=84=E7=9A=84=E8=8E=B7?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../challenges/_evaluating_form.html.erb | 4 ++-- app/views/shixuns/_achieve_ways.html.erb | 20 +++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/app/views/challenges/_evaluating_form.html.erb b/app/views/challenges/_evaluating_form.html.erb index a4d3d0c80..773f44557 100644 --- a/app/views/challenges/_evaluating_form.html.erb +++ b/app/views/challenges/_evaluating_form.html.erb @@ -18,8 +18,8 @@
            • - <%#= f.text_field :path, :class => "panel-form-width-690 panel-box-sizing fl", :no_label => true, :placeholder => "进入实训后将默认打开该文件,如:src/test/welcome.java", :maxlength => "256" %> - + <%= f.text_field :path, :class => "panel-form-width-690 panel-box-sizing fl", :id => "shixun_file_path", :no_label => true, :placeholder => "进入实训后将默认打开该文件,如:src/test/welcome.java", :maxlength => "256" %> +
            • diff --git a/app/views/shixuns/_achieve_ways.html.erb b/app/views/shixuns/_achieve_ways.html.erb index bde9fb889..8a3b8b894 100644 --- a/app/views/shixuns/_achieve_ways.html.erb +++ b/app/views/shixuns/_achieve_ways.html.erb @@ -24,8 +24,24 @@ <% end %>
            - 确定 - 取消 + 确定 + 取消
          + + + \ No newline at end of file From a9826d556ae6e2bf8728607aa516962fcd834705 Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Sat, 30 Sep 2017 20:32:57 +0800 Subject: [PATCH 17/27] =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/_achieve_ways.html.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/shixuns/_achieve_ways.html.erb b/app/views/shixuns/_achieve_ways.html.erb index cf2b83713..3923370a5 100644 --- a/app/views/shixuns/_achieve_ways.html.erb +++ b/app/views/shixuns/_achieve_ways.html.erb @@ -33,6 +33,10 @@ <% end %> <% end %>
        +
        + + +
        确定 取消 @@ -45,10 +49,10 @@ var $Path = ''; $(".old-icon-file").click(function(){ $Path = $(this).html(); - return $Path; + $("#points_tusi").val($Path); }); $("#add_path").click(function(){ - $("#shixun_file_path").val($Path); + $("#shixun_file_path").val($("#points_tusi").val()); $("#popupWrap").hide(); }); $("#back_page").click(function(){ From c6c9507abe4f54cf8a01bcf72ca2b813e970a8c4 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 30 Sep 2017 20:41:05 +0800 Subject: [PATCH 18/27] =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=B9=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/_achieve_ways.html.erb | 3 ++- config/routes.rb | 5 +++++ public/stylesheets/css/taskstyle.css | 8 ++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/views/shixuns/_achieve_ways.html.erb b/app/views/shixuns/_achieve_ways.html.erb index 870c396bc..e3b31e6be 100644 --- a/app/views/shixuns/_achieve_ways.html.erb +++ b/app/views/shixuns/_achieve_ways.html.erb @@ -8,6 +8,7 @@
          <% if @path.present? %> + 根目录/ <% dirs = @path.split('/') link_path = '' @@ -16,7 +17,7 @@ link_path << '/' unless link_path.empty? link_path << "#{dir}" %> - <%= link_to (h(dir)+'/'), search_file_list_shixun_path(@shixun, :path => to_path_param(to_path_param(link_path))), :class => "f14 fb", :remote => true %> + <%= link_to (h(dir)+'/'), search_file_list_shixun_path(@shixun, :path => to_path_param(to_path_param(link_path))), :class => "f14 fb", :remote => true %> <% end %> <% end %> <% if @dir.present? %> diff --git a/config/routes.rb b/config/routes.rb index 5f33567db..958c98a7c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -252,6 +252,11 @@ RedmineApp::Application.routes.draw do get 'add_departments_part' post 'save_school' post 'update_user_message' + post 'add_auto_users_trial' + post 'create_auto_users_trial' + match 'update_auto_users_trial', :via => [:get, :post] + match 'account', :via => [:get, :post] + post 'shixun_can_copy' end end # Enable Grack support diff --git a/public/stylesheets/css/taskstyle.css b/public/stylesheets/css/taskstyle.css index d74dd10d9..566f9520a 100644 --- a/public/stylesheets/css/taskstyle.css +++ b/public/stylesheets/css/taskstyle.css @@ -70,7 +70,7 @@ a.rightbar-pause{ color:#29bd8b; font-size: 18px; margin-right:15px; margin-top: .panel-inner-title{ font-size: 14px; color: #666; max-width:85%; line-height:30px;word-wrap: break-word; margin-bottom: 10px} .panel-footer{ min-width:1000px; height: 210px!important;} /* 弹框 */ -.task-popup-text-center{ text-align: center; color: #666;} +.task-popup-text-center{ text-align: center; color: #333;} .task-popup-title{ border-bottom: 1px solid #eee; padding:10px 15px; } .task-popup-content{ padding:0px 15px 15px 15px;} .task-popup-submit{ margin: 0 auto 15px; width: 120px;} @@ -430,11 +430,11 @@ html>body #ajax-indicator-base { position: fixed; } /*二次回复的提示语的样式*/ .points-data-tip-top{position:absolute;left:100px;top:-30px;opacity:.7;width:150px;height:30px;z-index:9999;display:none;} -.data-tip-top{position:relative;box-shadow:0px 0px 8px #000;backgund:#000;color:#fff;word-wrap: break-word; +.data-tip-top1{position:relative;box-shadow:0px 0px 8px #000;background:#000;color:#fff;word-wrap: break-word; text-align:center;border-radius:4px;padding:0 10px;border:1px solid #000;} -.data-tip-top:after,.data-tip-top:before{position: absolute;content:'';width:0;height:0;left: 45%;bottom:-10px;border-left: 5px solid transparent; +.data-tip-top1:after,.data-tip-top1:before{position: absolute;content:'';width:0;height:0;left: 45%;bottom:-10px;border-left: 5px solid transparent; border-right: 5px solid transparent;border-top: 10px solid #000;} -.data-tip-top:before{bottom:-11px;} +.data-tip-top1:before{bottom:-11px;} /*选择题tab切换*/ .nav_option li{overflow: hidden;width: 110px; text-align: center;cursor: pointer;height: 38px;line-height: 38px;border-top-right-radius: 5px;border-top-left-radius: 5px;border:1px solid #e2e2e2;border-bottom: 0px;color: #FF7500;border-right: none;} .nav_option li:last-child{border-right: 1px solid #e2e2e2;} From f4ba07cc828d89b9e63c595566c9091349aedacd Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 30 Sep 2017 20:46:57 +0800 Subject: [PATCH 19/27] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E6=97=B6=EF=BC=8C=E5=BA=94=E8=AF=A5=E8=A6=86?= =?UTF-8?q?=E7=9B=96=E4=B8=8A=E4=B8=80=E6=9D=A1=E8=AF=84=E5=88=86=EF=BC=8C?= =?UTF-8?q?=E4=B8=94=E7=BB=99=E5=87=BA=E6=8F=90=E4=BA=A4=E5=BC=B9=E6=A1=86?= =?UTF-8?q?=E7=9A=84=E5=86=85=E5=AE=B9=E6=94=B9=E4=B8=BA=E2=80=9C=E8=AF=84?= =?UTF-8?q?=E5=88=86=E5=B7=B2=E6=9B=B4=E6=96=B0=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 6 ++++-- app/helpers/student_work_helper.rb | 12 ++++++------ app/views/student_work/add_score.js.erb | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index e627ef519..52fa12073 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -690,7 +690,7 @@ class StudentWorkController < ApplicationController @score = student_work_score @work,User.current @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? if (@homework.homework_detail_manual.comment_status == 3 || @homework.homework_detail_manual.comment_status == 4) && !@is_teacher && @work.user != User.current - @student_work_scores = @work.student_works_scores.where("user_id = #{User.current.id} and reviewer_role = 3").order("updated_at desc") + @student_work_scores = StudentWorksScore.where(:id => @work.student_works_scores.where("user_id = #{User.current.id} and reviewer_role = 3").select("max(id)")) else @student_work_scores = student_work_score_record(@work) end @@ -995,7 +995,9 @@ class StudentWorkController < ApplicationController @work = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:id => @work.id).first @score = @new_score if @homework.homework_detail_manual.comment_status == 3 && !@is_teacher && @work.user != User.current - @student_work_scores = @work.student_works_scores.where("user_id = #{User.current.id} and reviewer_role = 3").order("updated_at desc") + @st_cover = @work.student_works_scores.where("user_id = #{User.current.id} and reviewer_role = 3").count > 1 ? 1 : 0 + @student_work_scores = StudentWorksScore.where(:id => @work.student_works_scores.where("user_id = #{User.current.id} and reviewer_role = 3").select("max(id)")) + #@student_work_scores = @work.student_works_scores.where("user_id = #{User.current.id} and reviewer_role = 3").order("updated_at desc") else @student_work_scores = student_work_score_record(@work) end diff --git a/app/helpers/student_work_helper.rb b/app/helpers/student_work_helper.rb index 9b3c17a95..4cdcc2ea3 100644 --- a/app/helpers/student_work_helper.rb +++ b/app/helpers/student_work_helper.rb @@ -140,13 +140,13 @@ module StudentWorkHelper end end - #获取学生作品的评分记录:同一个教师或教辅只显示未隐藏的评分 + #获取学生作品的评分记录:同一个教师或教辅只显示未隐藏的评分、匿评多次评分只取最新一条 def student_work_score_record work - # sql = "SELECT MAX(id) id FROM student_works_scores WHERE (reviewer_role = 2 OR reviewer_role = 1) AND score IS NOT NULL AND is_hidden = 0 AND student_work_id = #{work.id} GROUP BY user_id" - # tea_ts_ids = StudentWorksScore.find_by_sql sql - # tea_ts_ids = tea_ts_ids.empty? ? "(-1)" : "(" + tea_ts_ids.map{|tea| tea.id}.join(",") + ")" - # scores = work.student_works_scores.where("score IS NULL or reviewer_role = 3 or id in #{tea_ts_ids}").order("updated_at desc") - scores = work.student_works_scores.where(:is_hidden => false).order("created_at desc") + sql = "SELECT MAX(id) id FROM student_works_scores WHERE reviewer_role = 3 AND score IS NOT NULL AND is_hidden = 0 AND student_work_id = #{work.id} GROUP BY user_id" + st_ts_ids = StudentWorksScore.find_by_sql sql + st_ts_ids = st_ts_ids.empty? ? "(-1)" : "(" + st_ts_ids.map{|tea| tea.id}.join(",") + ")" + scores = work.student_works_scores.where("is_hidden = 0 and(reviewer_role = 1 or reviewer_role = 2 or id in #{st_ts_ids})").order("updated_at desc") + #scores = work.student_works_scores.where(:is_hidden => false).order("created_at desc") return scores end diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb index 049e0cf3d..21a89fbc5 100644 --- a/app/views/student_work/add_score.js.erb +++ b/app/views/student_work/add_score.js.erb @@ -1,3 +1,3 @@ $("#student_work_score_div").html("<%= escape_javascript(render :partial => 'student_work/student_work_score_div') %>"); $('#score_<%= @work.id%>').peSlider({range: 'min'}); -notice_box("提交成功"); +notice_box("<%= (@st_cover && @st_cover == 1) ? '评分已更新' : '提交成功' %>"); From 500d8e1082d409ec304139f76f7737836485ac37 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 30 Sep 2017 20:51:02 +0800 Subject: [PATCH 20/27] =?UTF-8?q?=E6=8C=87=E5=AE=9A=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E4=BB=A3=E7=A0=81=E4=B8=BA=E7=A9=BA=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E7=BB=99=E5=87=BA=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/_achieve_ways.html.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/shixuns/_achieve_ways.html.erb b/app/views/shixuns/_achieve_ways.html.erb index 9987a555b..f10e2155a 100644 --- a/app/views/shixuns/_achieve_ways.html.erb +++ b/app/views/shixuns/_achieve_ways.html.erb @@ -32,6 +32,8 @@
        <% end %> + <% else %> + 指定文件路径前,请先在版本库中提交代码 <% end %>
        From 7861ed7499bb368ac956f8d4f257baa916358062 Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 30 Sep 2017 21:02:18 +0800 Subject: [PATCH 21/27] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=B8=96=E5=AD=90=E8=8F=9C=E5=8D=95=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E4=B8=8E=E5=B8=96=E5=AD=90=E5=88=97=E8=A1=A8=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E8=8F=9C=E5=8D=95=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/messages_controller.rb | 13 +++++++++---- app/views/messages/_course_show.html.erb | 1 - app/views/messages/sticky_topic.js.erb | 1 + app/views/users/_course_message.html.erb | 23 +++++++++-------------- 4 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 app/views/messages/sticky_topic.js.erb diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index ccc118f54..acd042a11 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -406,10 +406,15 @@ class MessagesController < ApplicationController def sticky_topic (render_403; return false) unless (User.current.admin? || User.current.allowed_to?(:as_teacher, @course)) @topic.update_attributes(:sticky => @topic.sticky == 1 ? 0 : 1) - if params[:is_board] - redirect_to course_boards_path(@course) - else - redirect_to board_message_path(@topic.board_id, @topic) + respond_to do |format| + format.js + format.html{ + if params[:is_board] + redirect_to course_boards_path(@course) + else + redirect_to board_message_path(@topic.board_id, @topic) + end + } end end diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index e2a125e0b..d3493ee30 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -37,7 +37,6 @@ <% if User.current.admin? || User.current.allowed_to?(:as_teacher, @course) %> <% end %> - <% if User.current.admin? || User.current.allowed_to?(:as_teacher, @course) || User.current == @topic.author %> diff --git a/app/views/messages/sticky_topic.js.erb b/app/views/messages/sticky_topic.js.erb new file mode 100644 index 000000000..936731f48 --- /dev/null +++ b/app/views/messages/sticky_topic.js.erb @@ -0,0 +1 @@ +$("#user_activity_<%= params[:user_activity_id]%>").replaceWith("<%= j(render :partial => 'users/course_message', :locals => {:activity => @topic, :user_activity_id => params[:user_activity_id],:is_course=>1,:is_board=>0}) %>"); \ No newline at end of file diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 6a00131b2..9e798a956 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -52,21 +52,16 @@
          • - <% if activity.author.id == User.current.id%> -
          • - <%= link_to( - l(:button_edit), - edit_board_message_path(activity.id,:board_id=>activity.board_id,:is_course=>is_course,:is_board=>is_board), - :class => 'postOptionLink' - ) if activity.course_editable_by?(User.current) %> -
          • - <% if activity.course_destroyable_by?(User.current) %> -
          • - 删除 -
          • - <% end %> +
          • 发       送
          • + <% if User.current.admin? || User.current.allowed_to?(:as_teacher, @course) %> +
          • <%= activity.sticky == 1 ? '取消置顶' : '置       顶'.html_safe %>
          • + <% end %> + <% if User.current.admin? || User.current.allowed_to?(:as_teacher, @course) || User.current == activity.author %> +
          • 编       辑
          • +
          • + 删       除 +
          • <% end %> -
          • <%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %>
        From 48fc5484bbe5b927919ca1b24fae1900d206a891 Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Sat, 30 Sep 2017 21:12:22 +0800 Subject: [PATCH 22/27] =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E7=9A=84=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/_evaluating_form.html.erb | 13 +++++++++++-- app/views/shixuns/_achieve_ways.html.erb | 9 ++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/views/challenges/_evaluating_form.html.erb b/app/views/challenges/_evaluating_form.html.erb index 773f44557..2d92aacf5 100644 --- a/app/views/challenges/_evaluating_form.html.erb +++ b/app/views/challenges/_evaluating_form.html.erb @@ -26,7 +26,7 @@
      • - <%= f.text_field :exec_path, :class => "panel-form-width-690 panel-box-sizing fl", :no_label => true, :placeholder => "输入关卡需要执行的文件路径,如:src/test/main.java", :maxlength => "256" %> + <%= f.text_field :exec_path, :class => "panel-form-width-690 panel-box-sizing fl",:id => "shixun_file_path_play", :no_label => true, :placeholder => "输入关卡需要执行的文件路径,如:src/test/main.java", :maxlength => "256" %>
      • @@ -105,12 +105,21 @@ // 获取版本库路径 $("#shixun_file_path").on('click', function (e) { + file_path(); + $(this).addClass("change"); + }); + $("#shixun_file_path_play").on('click', function (e) { + file_path(); + $(this).addClass("change"); + }); + function file_path(){ data = 0; $.ajax({ url: '<%= search_file_list_shixun_path(@shixun) %>', dataType: "script" }); - }); + + } $("#shixun_form").on('click', 'a.test_icon_add', function () { var html = bt('t:test-answer-list', null); diff --git a/app/views/shixuns/_achieve_ways.html.erb b/app/views/shixuns/_achieve_ways.html.erb index 9987a555b..fbe2284e8 100644 --- a/app/views/shixuns/_achieve_ways.html.erb +++ b/app/views/shixuns/_achieve_ways.html.erb @@ -53,7 +53,14 @@ $("#points_tusi").val($Path); }); $("#add_path").click(function(){ - $("#shixun_file_path").val($("#points_tusi").val()); + if($("#shixun_file_path").hasClass("change")){ + $("#shixun_file_path").val($("#points_tusi").val()); + $("#shixun_file_path").removeClass("change"); + } + if($("#shixun_file_path_play").hasClass("change")){ + $("#shixun_file_path_play").val($("#points_tusi").val()); + $("#shixun_file_path_play").removeClass("change"); + } $("#popupWrap").hide(); }); $("#back_page").click(function(){ From 918cba0f950cdbc7e49594d7dcedbe0c06a6da41 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Sat, 30 Sep 2017 21:26:22 +0800 Subject: [PATCH 23/27] =?UTF-8?q?=E6=8A=80=E8=83=BD=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_games_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/games/_games_list.html.erb b/app/views/games/_games_list.html.erb index f64b8914d..00693b5a3 100644 --- a/app/views/games/_games_list.html.erb +++ b/app/views/games/_games_list.html.erb @@ -41,7 +41,7 @@ <% if challenge.st == 0 %> 经验值<%= challenge.score.to_i %> 金币<%= challenge.score.to_i %> - 技能标签<%= challenge.challenge_tags.count %> + 技能标签<%= challenge.challenge_tags.count == 0 ? "无" : challenge.challenge_tags.count %> <% else %> 经验值<%= challenge.choose_score.to_i %> 金币<%= challenge.choose_score.to_i %> From d6517c11c1a924e4a0024eb656c7fbe5a6df5ff6 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 30 Sep 2017 21:26:52 +0800 Subject: [PATCH 24/27] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0verilog=E7=B1=BB=E5=9E=8B=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/index.html.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/shixuns/index.html.erb b/app/views/shixuns/index.html.erb index 6c6b6d9a3..69ff47b51 100644 --- a/app/views/shixuns/index.html.erb +++ b/app/views/shixuns/index.html.erb @@ -90,6 +90,10 @@
      • +
      • + + +
      • From 4e2b8184fade67e42490a7498b40368353814c17 Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Sat, 30 Sep 2017 21:27:37 +0800 Subject: [PATCH 25/27] =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E7=9A=84=E6=BB=9A=E5=8A=A8=E6=9D=A1=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/_achieve_ways.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shixuns/_achieve_ways.html.erb b/app/views/shixuns/_achieve_ways.html.erb index 966c5ff0b..72471053a 100644 --- a/app/views/shixuns/_achieve_ways.html.erb +++ b/app/views/shixuns/_achieve_ways.html.erb @@ -6,7 +6,7 @@
        -
          +
            <% if @path.present? %> 根目录/ <% From a9c5a425947aa2cdde45d2c795ff92225c96ddb7 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 30 Sep 2017 21:37:43 +0800 Subject: [PATCH 26/27] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=B8=8D=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 77b25309f..2fb901d77 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -140,7 +140,7 @@ class ShixunsController < ApplicationController @content = params[:content] code_file = g.edit_file(@shixun.gpid, :content => params[:content], :file_path => @path, :branch_name => @rev, :commit_message => "shixun entry") # if @shixun.try(:status).to_i < 2 - shixun_modify_status_without_publish(@shixun, 1) + # shixun_modify_status_without_publish(@shixun, 1) # end respond_to do |format| format.js From 880f9a7c06b29a4653a8aa76d2d0e08b798aa910 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 30 Sep 2017 22:02:04 +0800 Subject: [PATCH 27/27] =?UTF-8?q?=E8=BF=98=E5=8E=9FTPI=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 12 +- app/views/games/_game_show.html.erb | 6 +- .../games/_shixun_comment_block.html.erb | 26 +-- app/views/games/_shixun_comment_list.html.erb | 206 ++++-------------- 4 files changed, 61 insertions(+), 189 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 319604f32..77b25309f 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -769,13 +769,13 @@ class ShixunsController < ApplicationController end def shixun_discuss - @discusses = @shixun.discusses.reorder("created_at desc") + @discusses = @shixun.discusses.where(:parent_id => nil).reorder("created_at desc") @discusses_count = @discusses.count - #@limit = 15 - #@is_remote = true - #@discusses_pages = Paginator.new @discusses_count, @limit, params['page'] || 1 - # @offset ||= @discusses_pages.offset - #@discusses = paginateHelper @discusses, @limit + @limit = 15 + @is_remote = true + @discusses_pages = Paginator.new @discusses_count, @limit, params['page'] || 1 + @offset ||= @discusses_pages.offset + @discusses = paginateHelper @discusses, @limit #@game_challenge = params[:challenge_id].blank? ? Challenge.find(@discusses.challenge_id) : Challenge.find(params[:challenge_id]) @game_challenge = Challenge.find(params[:challenge_id].to_i) end diff --git a/app/views/games/_game_show.html.erb b/app/views/games/_game_show.html.erb index e0595ab34..98e1391c5 100644 --- a/app/views/games/_game_show.html.erb +++ b/app/views/games/_game_show.html.erb @@ -81,12 +81,12 @@ -
        -
        - - -<% if false %> -
        -
        -
        -
        - <% if @shixun.discusses.blank? %> - <%= render :partial => "welcome/no_data" %> - <% else %> - <% @discusses.each do |dis| %> -
        - <%= link_to image_tag(url_to_avatar(dis.user), :alt => "头像", :width => 35, :height => 35), user_path(dis.user),:class => "fl mt5", :target => '_blank' %> -
        -

        - <%= link_to dis.user.show_name, user_path(dis.user), :class => "fl link-color-grey mr20" ,:style => "display: block" %> - <%= time_from_now dis.created_at %> - <% if dis.try(:challenge_id).present? %> - [第<%= Challenge.find(dis.try(:challenge_id)).try(:position) %>关] - <% end %> - + <% @discusses.each do |dis| %> +

        + <%= link_to image_tag(url_to_avatar(dis.user), :alt => "头像", :width => 35, :height => 35), user_path(dis.user),:class => "fl mt5", :target => '_blank' %> +
        +

        + <%= link_to dis.user.show_name, user_path(dis.user), :class => "fl link-color-grey mr20" ,:style => "display: block" %> + <%= time_from_now dis.created_at %> + <% if dis.try(:challenge_id).present? %> + [第<%= Challenge.find(dis.try(:challenge_id)).try(:position) %>关] + <% end %> + <%= render :partial => "discusses/dis_praise", :locals => {:discuss => dis} %> @@ -138,15 +27,15 @@ <% end %> -

        -

        <%= dis.content %>

        +

        +

        <%= dis.content %>

        -
        - <% dis.children.each do |child| %> -
        -

        - 老师回复 - <%= time_from_now child.created_at %> +

        + <% dis.children.each do |child| %> +
        +

        + 老师回复 + <%= time_from_now child.created_at %> <%= render :partial => "discusses/dis_praise", :locals => {:discuss => child} %> @@ -155,9 +44,9 @@ 删除 <% end %> -

        -

        <%= child.content %>

        - -
        -
        - <% end %> -
        -
        - <% end %> - -
        -
        -
          - <%= pagination_links_full @discusses_pages, @discusses_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %> -
        -
        +
        +
        + <% end %>
        <% end %> -
        - -
        + +
        +
        +
          + <%= pagination_links_full @discusses_pages, @discusses_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %> +
        +
        +
        +
        + <% end %>
        +
        -<% end %> +
        +
        + \ No newline at end of file