From 8bd27d4f3d2574fc4cedeb36cc52b71a8cad0520 Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Thu, 12 Oct 2017 16:17:06 +0800 Subject: [PATCH 01/29] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E7=94=B3=E8=AF=89?= =?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_evaluation_work.html.erb | 2 +- app/views/student_work/_student_work_score.html.erb | 4 ++-- public/stylesheets/css/edu-public.css | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index e06a1754c..454714b72 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -28,7 +28,7 @@ <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%> - <%= link_to @homework.homework_detail_manual.comment_status == 3 ? '评阅' : '查看', student_work_path(student_work), :class => 'link-color-blue', :target => "_blank" %> + <%= link_to @homework.homework_detail_manual.comment_status == 3 ? '评阅' : '查看', student_work_path(student_work), :class => '', :target => "_blank" %> <% end%> diff --git a/app/views/student_work/_student_work_score.html.erb b/app/views/student_work/_student_work_score.html.erb index 265952a84..aa704bf9d 100644 --- a/app/views/student_work/_student_work_score.html.erb +++ b/app/views/student_work/_student_work_score.html.erb @@ -54,10 +54,10 @@
- <%= link_to image_tag(url_to_avatar(show_real_name_for_appeal ? score.student_works_scores_appeal.user : ""), :width => "32", :height => "32"), show_real_name_for_appeal ? user_path(score.student_works_scores_appeal.user) : "javascript:void(0)", :target => "_blank" %> + <%= link_to image_tag(url_to_avatar(show_real_name_for_appeal ? score.student_works_scores_appeal.user : ""), :width => "32", :height => "32"), show_real_name_for_appeal ? user_path(score.student_works_scores_appeal.user) : "javascript:void(0)", :style => "cursor: text",:target => "_blank" %>
- <%= link_to show_real_name_for_appeal ? score.student_works_scores_appeal.user.show_real_name : "匿名", show_real_name_for_appeal ? user_path(score.student_works_scores_appeal.user.show_real_name) : "javascript:void(0)", :title => show_real_name ? score.student_works_scores_appeal.user.show_real_name : "匿评用户", :class => "content-username" %> + <%= link_to show_real_name_for_appeal ? score.student_works_scores_appeal.user.show_real_name : "匿名", show_real_name_for_appeal ? user_path(score.student_works_scores_appeal.user.show_real_name) : "javascript:void(0)", :style => "cursor: text", :class => "content-username color-grey-no-a" %> <%=format_time score.student_works_scores_appeal.updated_at %>
<%= score.student_works_scores_appeal.comment%>
diff --git a/public/stylesheets/css/edu-public.css b/public/stylesheets/css/edu-public.css index d179b2a74..bcac54eb8 100644 --- a/public/stylesheets/css/edu-public.css +++ b/public/stylesheets/css/edu-public.css @@ -113,7 +113,7 @@ a.panel-name-small{ display: inline-block; max-width:100px; color:#29bd8b; font- .comment_item_cont .J_Comment_Face img{ width:50px; height:50px; border-radius:100px; } .panel-comment_item .t_content{ width:93%; margin-left:15px;} .panel-comment_item a.content-username {font-size:14px; margin-right:15px; display:inline-block; max-width:100px;color: #888888} -.panel-comment_item a:hover.content-username{color:#FF7500;} +/*.panel-comment_item a:hover.content-username{color:#FF7500;}*/ .panel-comment_item .orig_user img{width:40px; height:40px;border-radius:100px; } .panel-comment_item .reply-right{ float:right; position:relative;} .panel-comment_item .reply_iconup02{ position:absolute; top:22px; left:14px; color:#d4d4d4; font-size:16px; background:#f1f1f1; line-height:13px;} From 908e131548bfb1626629deb83a19a833d5638772 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 12 Oct 2017 17:26:12 +0800 Subject: [PATCH 02/29] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_homework_reply_detail.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/student_work/_homework_reply_detail.html.erb b/app/views/student_work/_homework_reply_detail.html.erb index 7fe4d4401..acb33b8ec 100644 --- a/app/views/student_work/_homework_reply_detail.html.erb +++ b/app/views/student_work/_homework_reply_detail.html.erb @@ -10,16 +10,16 @@ });
-
-
+
+
<%= comment.content_detail.html_safe %>
<%= link_to comment.creator_user.show_real_name, user_path(comment.creator_user), :class => "content-username hide fl" %> <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %> -
+
-
+
<%= link_to('回复'.html_safe, {:controller => 'users', :action => 'reply_to_comment', From 0e1dea9aded9e30dac128cead2207fba01af9d69 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 12 Oct 2017 17:33:28 +0800 Subject: [PATCH 03/29] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E9=A2=9C=E8=89=B2333?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_resource_detail.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/files/_resource_detail.html.erb b/app/views/files/_resource_detail.html.erb index d11fa252a..cc48a8ca5 100644 --- a/app/views/files/_resource_detail.html.erb +++ b/app/views/files/_resource_detail.html.erb @@ -10,11 +10,11 @@ <% if file.attachment_histories.count == 0 %> <%= link_to truncate(file.filename,length: 40, omission: '...'), download_named_attachment_path(file.id, file.filename), - :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %> + :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "color-grey3 f_14" %> <% else %> <%= link_to truncate(file.filename,length: 40, omission: '...'), attachment_history_download_path(file.id), :title => file.filename+"\n"+file.description.to_s, - :class => "linkGrey3 f_14", + :class => "color-grey3 f_14", :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;", :remote=>true %> <% end %> <%#= file_preview_eye(file, class: 'preview') %> From f9f1e25965e4a864072dc2460c860a070c4ec254 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 12 Oct 2017 17:34:14 +0800 Subject: [PATCH 04/29] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise/_new_question.html.erb | 2 ++ app/views/exercise/_show_MC.html.erb | 2 +- app/views/exercise/_show_MCQ.html.erb | 2 +- app/views/exercise/_show_multi.html.erb | 2 +- app/views/exercise/_show_single.html.erb | 2 +- app/views/exercise/student_exercise_list.html.erb | 4 ++-- public/javascripts/application.js | 1 + public/stylesheets/css/edu-public.css | 4 ++-- 8 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/views/exercise/_new_question.html.erb b/app/views/exercise/_new_question.html.erb index 169230966..cc2d7c80e 100644 --- a/app/views/exercise/_new_question.html.erb +++ b/app/views/exercise/_new_question.html.erb @@ -55,6 +55,8 @@ } }); }); + //div_form = $("div[nhname='new_exercise_mc_q']"); + //$(".ke-edit", div_form).css("height","48px"); } } diff --git a/app/views/exercise/_show_MC.html.erb b/app/views/exercise/_show_MC.html.erb index 42af3d01a..9218eeef1 100644 --- a/app/views/exercise/_show_MC.html.erb +++ b/app/views/exercise/_show_MC.html.erb @@ -13,7 +13,7 @@

-
<%= exercise_question.question_title.html_safe %>
+
<%= exercise_question.question_title.html_safe %>
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
  • diff --git a/app/views/exercise/_show_MCQ.html.erb b/app/views/exercise/_show_MCQ.html.erb index 2cd1093d7..ffe7db1d4 100644 --- a/app/views/exercise/_show_MCQ.html.erb +++ b/app/views/exercise/_show_MCQ.html.erb @@ -13,7 +13,7 @@

  • -
    <%= exercise_question.question_title.html_safe %>
    +
    <%= exercise_question.question_title.html_safe %>
    <% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
  • diff --git a/app/views/exercise/_show_multi.html.erb b/app/views/exercise/_show_multi.html.erb index cfdb1dbc9..664453873 100644 --- a/app/views/exercise/_show_multi.html.erb +++ b/app/views/exercise/_show_multi.html.erb @@ -13,7 +13,7 @@

  • -
    <%= exercise_question.question_title.html_safe %>
    +
    <%= exercise_question.question_title.html_safe %>

    参考答案:

    <%= exercise_question.exercise_standard_answers.count > 0 ? exercise_question.exercise_standard_answers.first.answer_text : "无"%>
    diff --git a/app/views/exercise/_show_single.html.erb b/app/views/exercise/_show_single.html.erb index e1ac2918e..d810585e4 100644 --- a/app/views/exercise/_show_single.html.erb +++ b/app/views/exercise/_show_single.html.erb @@ -13,7 +13,7 @@

    -
    <%= exercise_question.question_title.html_safe %>
    +
    <%= exercise_question.question_title.html_safe %>
    <% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %>

    候选答案<%= convert_to_chi_num(index+1) %>:<%= exercise_choice.answer_text%>

    diff --git a/app/views/exercise/student_exercise_list.html.erb b/app/views/exercise/student_exercise_list.html.erb index e8a03de53..14de7ead1 100644 --- a/app/views/exercise/student_exercise_list.html.erb +++ b/app/views/exercise/student_exercise_list.html.erb @@ -164,7 +164,7 @@

    第<%= exercise_question.question_number %>题:[<%= exercise_question.question_type_name %>]<%= exercise_question.question_score %>分

    -
    <%= exercise_question.question_title.html_safe %>
    +
    <%= exercise_question.question_title.html_safe %>
    <% case exercise_question.question_type %> <% when 1 %>
    @@ -207,7 +207,7 @@

    参考答案

    -
    <%= exercise_question.exercise_standard_answers.first.answer_text%>
    +
    <%= exercise_question.exercise_standard_answers.count > 0 ? exercise_question.exercise_standard_answers.first.answer_text : "无"%>
    <% end %>
    diff --git a/public/javascripts/application.js b/public/javascripts/application.js index b9820a850..b36bfec99 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -2517,6 +2517,7 @@ function init_exercise_quetison_editor(params){ var edit = this.edit; var body = edit.doc.body; edit.iframe.height(48); + //this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight+30 : (params.kindutil.GECKO ? body.offsetHeight+26:body.offsetHeight+30)), 48)); this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+30, 48)); }, afterBlur:function(){ diff --git a/public/stylesheets/css/edu-public.css b/public/stylesheets/css/edu-public.css index 8c9774893..e3c9045b9 100644 --- a/public/stylesheets/css/edu-public.css +++ b/public/stylesheets/css/edu-public.css @@ -253,6 +253,7 @@ a.task-index-name{ display: inline-block; max-width:80px;} /*作业描述、帖子内容*/ .upload_img img{max-width: 100%;} +.table_maxWidth table {max-width: 642px;} .list_style ol li{list-style-type: decimal;margin-left: 40px;} .list_style ul li{list-style-type: disc;margin-left: 40px;} @@ -399,5 +400,4 @@ input::-ms-input-placeholder,textarea::-ms-input-placeholder {color:#cccccc;} /*评阅状态*/ .checkstatus_box_small{width: 10px;height: 10px;display: block;float: left;margin-right: 3px;} .checkstatus_box_big{cursor: default;width: 30px;height: 30px;line-height: 30px;text-align: center;margin-right: 10px;border:1px solid #CCCCCC;display: block;float: left;} -.checkstatus_box_big i{position: absolute;top:18px;left: 10px;} - +.checkstatus_box_big i{position: absolute;top:18px;left: 10px;} \ No newline at end of file From c97ebf5a2dc1676383c284b2619fe7351cc01955 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 12 Oct 2017 17:43:11 +0800 Subject: [PATCH 05/29] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8E=BB=E6=8E=89textarea=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise/student_exercise_list.html.erb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/views/exercise/student_exercise_list.html.erb b/app/views/exercise/student_exercise_list.html.erb index 14de7ead1..3411451ec 100644 --- a/app/views/exercise/student_exercise_list.html.erb +++ b/app/views/exercise/student_exercise_list.html.erb @@ -193,18 +193,12 @@ 标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>
    <% when 3 %> -
    - -
    <% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %>

    候选答案<%= convert_to_chi_num(index+1) %>:<%= exercise_choice.answer_text%>

    <% end %>
    <% when 4 %> -
    - -

    参考答案

    <%= exercise_question.exercise_standard_answers.count > 0 ? exercise_question.exercise_standard_answers.first.answer_text : "无"%>
    From f404adcf705d715ac469b4e1b56d70cdf21b8ee3 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 12 Oct 2017 17:57:35 +0800 Subject: [PATCH 06/29] =?UTF-8?q?=E8=AF=84=E6=B5=8B=E5=8E=BB=E6=8E=89waiti?= =?UTF-8?q?ng=20time?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_code_actions.html.erb | 246 ++++++++++++------------- 1 file changed, 113 insertions(+), 133 deletions(-) diff --git a/app/views/games/_code_actions.html.erb b/app/views/games/_code_actions.html.erb index 5dbeb1731..a0bb9ba76 100644 --- a/app/views/games/_code_actions.html.erb +++ b/app/views/games/_code_actions.html.erb @@ -147,140 +147,120 @@ url: '<%= game_build_myshixun_game_path(@game, :myshixun_id => @myshixun) %>', success: function (data){ timeID = setInterval(function(){ - $.ajax({ - url: '<%= get_waiting_time_myshixun_game_path(@game, :myshixun_id => @myshixun) %>', - data:{resubmit:data.resubmit}, - async: false, - success: function(data){ - console.log(data); - if(data.onRun == 1){ - clearInterval(timeID); - $("#game_wating_time").html(""); - // 每2s匹配一次状态,成功2 评测中1 评测 0 - var intId = setInterval(function(){ - var ajaxTimeoutTest = $.ajax({ - url: '<%= game_status_myshixun_game_path(@game, :myshixun_id => @myshixun) %>', - timeout : 50000, - async: false, - data:{"resubmit":data.resubmit}, - success:function(data){ - // 如果查到了,就退出 - i = i + 1; - console.log(i); - if(data.status == 2 || data.status == 0){ - if(data.language == "Html"){ - tpi_html_show(); - } - clearInterval(intId); - nEvalContent.show(); - nEvalInfo.show(); - nAjaxLoading.val(""); - nInfoAjaxLoading.val(""); - nAjaxLoading.hide(); - nInfoAjaxLoading.hide(); - // test_sets 公开测,hide_test_sets 隐藏测试集 - code_evaluation( - eval('[' + data.test_sets + ']'), - data.had_test_count, - data.test_sets_count, - data.had_passed_testsests_error_count, - data.test_sets_hidden_count, - data.test_sets_public_count, - data.had_passed_testsests_hidden_count, - data.had_passed_testsests_public_count, - data.final_score, - data.gold, - data.latest_output, - data.language, - data.compile_success - ); - $("#blacktab_nav_1").trigger("click"); - if(data.status == 2){ - clearInterval(cm); - clearInterval(intId); - var icon = $("#game_status_<%= @game_challenge.id %>"); // 实训列表的icon - $("#user_grade").html(parseInt($("#user_grade").html()) + parseInt(data.final_score)); - console.log("############################################"); - console.log(data.score); - console.log(data.tag_count); - console.log($("#shixun_exp_<%=@game_challenge.id %>")[0]); - $("#shixun_exp_<%=@game_challenge.id %>").html("经验值+"+ data.final_score + ""); - $("#shixun_grade_<%=@game_challenge.id %>").html("金币"+ (data.gold < 0 ? data.gold : ("+" + data.gold)) + ""); - $("#shixun_tag_<%=@game_challenge.id %>").html("技能标签+"+ data.tag_count + ""); - icon.find("i").attr("class", "fa fa-unlock fr font-18 mt5 color-light-green w20_center"); - icon.find("a:last").attr("title", "已完成"); - if( data.had_done == 0 ) { - $("#code_estimate").html("下一关离开"); - var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game=> @game, :myshixun => @myshixun, :had_done => 0}) %>"; - }else{ - $("#code_estimate").html("离开"); - var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game=> @game, :myshixun => @myshixun, :had_done => 1}) %>"; - } - // 传递具体屏幕的宽高,实现不同浏览器与不同分辨率都能撑满屏幕 - pop_box_new2(htmlvalue, window.innerWidth, window.innerHeight); - $("#reset_code_to_bengin").show(); // 显示加载上次通过的代码 - } - var html = "评测"; - $("#code_test").html(html); // 恢复评测 - if(data.position > 1){ - $("#prev_step_area").html("上一关") - } - var codeEstimate = $("#code_estimate").children("a").html(); - if(codeEstimate == undefined){ - return; - }else if(codeEstimate.trim() == "下一关"){ - $("#code_estimate").html("下一关离开"); - } else if(codeEstimate.trim() == "离开"){ - $("#code_estimate").html("离开"); - } - } - // 访问60次,即120s后后台还未改变状态即执行 - if(i == 60){ - if(data.language == "Html"){ - tpi_html_show(); - } - clearInterval(intId); - nEvalContent.show(); - nEvalInfo.show(); - nAjaxLoading.val(""); - nInfoAjaxLoading.val(""); - nAjaxLoading.hide(); - nInfoAjaxLoading.hide(); - if(data.position > 1){ - $("#prev_step_area").html("上一关") - } - if( data.had_done == 0 ) { - $("#code_estimate").html("下一关离开"); - } - var html = "评测"; - - var html_1 = "实训云平台繁忙(繁忙等级:88)"; - $("#code_test").html(html); - notice_box(html_1); - } - }, - complete: function(XMLHttpRequest,status){if(status=='timeout'){ - clearInterval(intId); - nEvalContent.show(); - nEvalInfo.show(); - nAjaxLoading.val(""); - nInfoAjaxLoading.val(""); - nAjaxLoading.hide(); - nInfoAjaxLoading.hide(); - ajaxTimeoutTest.abort(); - }} - }); - }, 2000); - }else if(data.onRun == 0){ - mintes = parseInt(data.waitingTime / 60); - if(mintes > 1){ - $("#game_wating_time").html("目前正有" + data.waitNum + "个任务正在等待,大约需要等待" + mintes + "分钟") - }else{ - $("#game_wating_time").html("目前正有" + data.waitNum + "个任务正在等待,大约需要等待" + data.waitingTime + "秒") + var intId = setInterval(function(){ + var ajaxTimeoutTest = $.ajax({ + url: '<%= game_status_myshixun_game_path(@game, :myshixun_id => @myshixun) %>', + timeout : 50000, + async: false, + data:{"resubmit":data.resubmit}, + success:function(data){ + // 如果查到了,就退出 + i = i + 1; + console.log(i); + if(data.status == 2 || data.status == 0){ + if(data.language == "Html"){ + tpi_html_show(); + } + clearInterval(intId); + nEvalContent.show(); + nEvalInfo.show(); + nAjaxLoading.val(""); + nInfoAjaxLoading.val(""); + nAjaxLoading.hide(); + nInfoAjaxLoading.hide(); + // test_sets 公开测,hide_test_sets 隐藏测试集 + code_evaluation( + eval('[' + data.test_sets + ']'), + data.had_test_count, + data.test_sets_count, + data.had_passed_testsests_error_count, + data.test_sets_hidden_count, + data.test_sets_public_count, + data.had_passed_testsests_hidden_count, + data.had_passed_testsests_public_count, + data.final_score, + data.gold, + data.latest_output, + data.language, + data.compile_success + ); + $("#blacktab_nav_1").trigger("click"); + if(data.status == 2){ + clearInterval(cm); + clearInterval(intId); + var icon = $("#game_status_<%= @game_challenge.id %>"); // 实训列表的icon + $("#user_grade").html(parseInt($("#user_grade").html()) + parseInt(data.final_score)); + console.log("############################################"); + console.log(data.score); + console.log(data.tag_count); + console.log($("#shixun_exp_<%=@game_challenge.id %>")[0]); + $("#shixun_exp_<%=@game_challenge.id %>").html("经验值+"+ data.final_score + ""); + $("#shixun_grade_<%=@game_challenge.id %>").html("金币"+ (data.gold < 0 ? data.gold : ("+" + data.gold)) + ""); + $("#shixun_tag_<%=@game_challenge.id %>").html("技能标签+"+ data.tag_count + ""); + icon.find("i").attr("class", "fa fa-unlock fr font-18 mt5 color-light-green w20_center"); + icon.find("a:last").attr("title", "已完成"); + if( data.had_done == 0 ) { + $("#code_estimate").html("下一关离开"); + var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game=> @game, :myshixun => @myshixun, :had_done => 0}) %>"; + }else{ + $("#code_estimate").html("离开"); + var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game=> @game, :myshixun => @myshixun, :had_done => 1}) %>"; + } + // 传递具体屏幕的宽高,实现不同浏览器与不同分辨率都能撑满屏幕 + pop_box_new2(htmlvalue, window.innerWidth, window.innerHeight); + $("#reset_code_to_bengin").show(); // 显示加载上次通过的代码 + } + var html = "评测"; + $("#code_test").html(html); // 恢复评测 + if(data.position > 1){ + $("#prev_step_area").html("上一关") + } + var codeEstimate = $("#code_estimate").children("a").html(); + if(codeEstimate == undefined){ + return; + }else if(codeEstimate.trim() == "下一关"){ + $("#code_estimate").html("下一关离开"); + } else if(codeEstimate.trim() == "离开"){ + $("#code_estimate").html("离开"); + } } - } - } - }) + // 访问60次,即120s后后台还未改变状态即执行 + if(i == 60){ + if(data.language == "Html"){ + tpi_html_show(); + } + clearInterval(intId); + nEvalContent.show(); + nEvalInfo.show(); + nAjaxLoading.val(""); + nInfoAjaxLoading.val(""); + nAjaxLoading.hide(); + nInfoAjaxLoading.hide(); + if(data.position > 1){ + $("#prev_step_area").html("上一关") + } + if( data.had_done == 0 ) { + $("#code_estimate").html("下一关离开"); + } + var html = "评测"; + + var html_1 = "实训云平台繁忙(繁忙等级:88)"; + $("#code_test").html(html); + notice_box(html_1); + } + }, + complete: function(XMLHttpRequest,status){if(status=='timeout'){ + clearInterval(intId); + nEvalContent.show(); + nEvalInfo.show(); + nAjaxLoading.val(""); + nInfoAjaxLoading.val(""); + nAjaxLoading.hide(); + nInfoAjaxLoading.hide(); + ajaxTimeoutTest.abort(); + }} + }); + }, 2000); }, 2000); } From 1e10cb8bad9e4b12123230d44822cd7ba4fcd2dc Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 12 Oct 2017 18:04:03 +0800 Subject: [PATCH 07/29] pingce --- app/views/games/_code_actions.html.erb | 244 +++++++++++++------------ 1 file changed, 132 insertions(+), 112 deletions(-) diff --git a/app/views/games/_code_actions.html.erb b/app/views/games/_code_actions.html.erb index a0bb9ba76..5dbeb1731 100644 --- a/app/views/games/_code_actions.html.erb +++ b/app/views/games/_code_actions.html.erb @@ -147,120 +147,140 @@ url: '<%= game_build_myshixun_game_path(@game, :myshixun_id => @myshixun) %>', success: function (data){ timeID = setInterval(function(){ - var intId = setInterval(function(){ - var ajaxTimeoutTest = $.ajax({ - url: '<%= game_status_myshixun_game_path(@game, :myshixun_id => @myshixun) %>', - timeout : 50000, - async: false, - data:{"resubmit":data.resubmit}, - success:function(data){ - // 如果查到了,就退出 - i = i + 1; - console.log(i); - if(data.status == 2 || data.status == 0){ - if(data.language == "Html"){ - tpi_html_show(); - } - clearInterval(intId); - nEvalContent.show(); - nEvalInfo.show(); - nAjaxLoading.val(""); - nInfoAjaxLoading.val(""); - nAjaxLoading.hide(); - nInfoAjaxLoading.hide(); - // test_sets 公开测,hide_test_sets 隐藏测试集 - code_evaluation( - eval('[' + data.test_sets + ']'), - data.had_test_count, - data.test_sets_count, - data.had_passed_testsests_error_count, - data.test_sets_hidden_count, - data.test_sets_public_count, - data.had_passed_testsests_hidden_count, - data.had_passed_testsests_public_count, - data.final_score, - data.gold, - data.latest_output, - data.language, - data.compile_success - ); - $("#blacktab_nav_1").trigger("click"); - if(data.status == 2){ - clearInterval(cm); - clearInterval(intId); - var icon = $("#game_status_<%= @game_challenge.id %>"); // 实训列表的icon - $("#user_grade").html(parseInt($("#user_grade").html()) + parseInt(data.final_score)); - console.log("############################################"); - console.log(data.score); - console.log(data.tag_count); - console.log($("#shixun_exp_<%=@game_challenge.id %>")[0]); - $("#shixun_exp_<%=@game_challenge.id %>").html("经验值+"+ data.final_score + ""); - $("#shixun_grade_<%=@game_challenge.id %>").html("金币"+ (data.gold < 0 ? data.gold : ("+" + data.gold)) + ""); - $("#shixun_tag_<%=@game_challenge.id %>").html("技能标签+"+ data.tag_count + ""); - icon.find("i").attr("class", "fa fa-unlock fr font-18 mt5 color-light-green w20_center"); - icon.find("a:last").attr("title", "已完成"); - if( data.had_done == 0 ) { - $("#code_estimate").html("下一关离开"); - var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game=> @game, :myshixun => @myshixun, :had_done => 0}) %>"; - }else{ - $("#code_estimate").html("离开"); - var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game=> @game, :myshixun => @myshixun, :had_done => 1}) %>"; - } - // 传递具体屏幕的宽高,实现不同浏览器与不同分辨率都能撑满屏幕 - pop_box_new2(htmlvalue, window.innerWidth, window.innerHeight); - $("#reset_code_to_bengin").show(); // 显示加载上次通过的代码 - } - var html = "评测"; - $("#code_test").html(html); // 恢复评测 - if(data.position > 1){ - $("#prev_step_area").html("上一关") - } - var codeEstimate = $("#code_estimate").children("a").html(); - if(codeEstimate == undefined){ - return; - }else if(codeEstimate.trim() == "下一关"){ - $("#code_estimate").html("下一关离开"); - } else if(codeEstimate.trim() == "离开"){ - $("#code_estimate").html("离开"); - } - } - // 访问60次,即120s后后台还未改变状态即执行 - if(i == 60){ - if(data.language == "Html"){ - tpi_html_show(); - } - clearInterval(intId); - nEvalContent.show(); - nEvalInfo.show(); - nAjaxLoading.val(""); - nInfoAjaxLoading.val(""); - nAjaxLoading.hide(); - nInfoAjaxLoading.hide(); - if(data.position > 1){ - $("#prev_step_area").html("上一关") - } - if( data.had_done == 0 ) { - $("#code_estimate").html("下一关离开"); - } - var html = "评测"; + $.ajax({ + url: '<%= get_waiting_time_myshixun_game_path(@game, :myshixun_id => @myshixun) %>', + data:{resubmit:data.resubmit}, + async: false, + success: function(data){ + console.log(data); + if(data.onRun == 1){ + clearInterval(timeID); + $("#game_wating_time").html(""); + // 每2s匹配一次状态,成功2 评测中1 评测 0 + var intId = setInterval(function(){ + var ajaxTimeoutTest = $.ajax({ + url: '<%= game_status_myshixun_game_path(@game, :myshixun_id => @myshixun) %>', + timeout : 50000, + async: false, + data:{"resubmit":data.resubmit}, + success:function(data){ + // 如果查到了,就退出 + i = i + 1; + console.log(i); + if(data.status == 2 || data.status == 0){ + if(data.language == "Html"){ + tpi_html_show(); + } + clearInterval(intId); + nEvalContent.show(); + nEvalInfo.show(); + nAjaxLoading.val(""); + nInfoAjaxLoading.val(""); + nAjaxLoading.hide(); + nInfoAjaxLoading.hide(); + // test_sets 公开测,hide_test_sets 隐藏测试集 + code_evaluation( + eval('[' + data.test_sets + ']'), + data.had_test_count, + data.test_sets_count, + data.had_passed_testsests_error_count, + data.test_sets_hidden_count, + data.test_sets_public_count, + data.had_passed_testsests_hidden_count, + data.had_passed_testsests_public_count, + data.final_score, + data.gold, + data.latest_output, + data.language, + data.compile_success + ); + $("#blacktab_nav_1").trigger("click"); + if(data.status == 2){ + clearInterval(cm); + clearInterval(intId); + var icon = $("#game_status_<%= @game_challenge.id %>"); // 实训列表的icon + $("#user_grade").html(parseInt($("#user_grade").html()) + parseInt(data.final_score)); + console.log("############################################"); + console.log(data.score); + console.log(data.tag_count); + console.log($("#shixun_exp_<%=@game_challenge.id %>")[0]); + $("#shixun_exp_<%=@game_challenge.id %>").html("经验值+"+ data.final_score + ""); + $("#shixun_grade_<%=@game_challenge.id %>").html("金币"+ (data.gold < 0 ? data.gold : ("+" + data.gold)) + ""); + $("#shixun_tag_<%=@game_challenge.id %>").html("技能标签+"+ data.tag_count + ""); + icon.find("i").attr("class", "fa fa-unlock fr font-18 mt5 color-light-green w20_center"); + icon.find("a:last").attr("title", "已完成"); + if( data.had_done == 0 ) { + $("#code_estimate").html("下一关离开"); + var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game=> @game, :myshixun => @myshixun, :had_done => 0}) %>"; + }else{ + $("#code_estimate").html("离开"); + var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game=> @game, :myshixun => @myshixun, :had_done => 1}) %>"; + } + // 传递具体屏幕的宽高,实现不同浏览器与不同分辨率都能撑满屏幕 + pop_box_new2(htmlvalue, window.innerWidth, window.innerHeight); + $("#reset_code_to_bengin").show(); // 显示加载上次通过的代码 + } + var html = "评测"; + $("#code_test").html(html); // 恢复评测 + if(data.position > 1){ + $("#prev_step_area").html("上一关") + } + var codeEstimate = $("#code_estimate").children("a").html(); + if(codeEstimate == undefined){ + return; + }else if(codeEstimate.trim() == "下一关"){ + $("#code_estimate").html("下一关离开"); + } else if(codeEstimate.trim() == "离开"){ + $("#code_estimate").html("离开"); + } + } + // 访问60次,即120s后后台还未改变状态即执行 + if(i == 60){ + if(data.language == "Html"){ + tpi_html_show(); + } + clearInterval(intId); + nEvalContent.show(); + nEvalInfo.show(); + nAjaxLoading.val(""); + nInfoAjaxLoading.val(""); + nAjaxLoading.hide(); + nInfoAjaxLoading.hide(); + if(data.position > 1){ + $("#prev_step_area").html("上一关") + } + if( data.had_done == 0 ) { + $("#code_estimate").html("下一关离开"); + } + var html = "评测"; - var html_1 = "实训云平台繁忙(繁忙等级:88)"; - $("#code_test").html(html); - notice_box(html_1); + var html_1 = "实训云平台繁忙(繁忙等级:88)"; + $("#code_test").html(html); + notice_box(html_1); + } + }, + complete: function(XMLHttpRequest,status){if(status=='timeout'){ + clearInterval(intId); + nEvalContent.show(); + nEvalInfo.show(); + nAjaxLoading.val(""); + nInfoAjaxLoading.val(""); + nAjaxLoading.hide(); + nInfoAjaxLoading.hide(); + ajaxTimeoutTest.abort(); + }} + }); + }, 2000); + }else if(data.onRun == 0){ + mintes = parseInt(data.waitingTime / 60); + if(mintes > 1){ + $("#game_wating_time").html("目前正有" + data.waitNum + "个任务正在等待,大约需要等待" + mintes + "分钟") + }else{ + $("#game_wating_time").html("目前正有" + data.waitNum + "个任务正在等待,大约需要等待" + data.waitingTime + "秒") } - }, - complete: function(XMLHttpRequest,status){if(status=='timeout'){ - clearInterval(intId); - nEvalContent.show(); - nEvalInfo.show(); - nAjaxLoading.val(""); - nInfoAjaxLoading.val(""); - nAjaxLoading.hide(); - nInfoAjaxLoading.hide(); - ajaxTimeoutTest.abort(); - }} - }); - }, 2000); + } + } + }) }, 2000); } From 71dafc8dd4da27af3692ed1ad49c35602475d136 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 12 Oct 2017 18:07:54 +0800 Subject: [PATCH 08/29] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_edu.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/base_edu.html.erb b/app/views/layouts/base_edu.html.erb index ef5b5a61c..c6b2e1eba 100644 --- a/app/views/layouts/base_edu.html.erb +++ b/app/views/layouts/base_edu.html.erb @@ -9,7 +9,7 @@ <%= favicon %> <%= javascript_heads %> <%= heads_for_theme %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/structure','css/edu-common', 'css/edu-public','css/taskstyle', 'css/font-awesome', 'css/edu-class', 'css/edu-popup', 'css/ketang','css/edu-subject', 'css/magic-check', "css/edu-admin", "bootstrap/bootstrap-min.css" %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/structure','css/edu-common', 'css/edu-public','css/taskstyle', 'css/font-awesome', 'css/edu-class', 'css/edu-popup', 'css/ketang','css/edu-subject', 'css/magic-check', "css/edu-admin", "bootstrap/bootstrap-min.css", 'prettify.css' %> <%= javascript_include_tag "edu/application",'edu/base_edu','baiduTemplate','jquery.datetimepicker.js','edu/course','attachments' %> <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> From ccb43b3063d7b8a60b71aec08eff4670e3bffd76 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 12 Oct 2017 18:11:52 +0800 Subject: [PATCH 09/29] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E6=B5=81=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/memo.rb | 2 +- app/views/games/_code_actions.html.erb | 10 +++++----- app/views/games/_repository.html.erb | 5 ----- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/app/models/memo.rb b/app/models/memo.rb index 1eb8f29aa..dc12fe367 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -11,7 +11,7 @@ class Memo < ActiveRecord::Base # 若是主题帖,则内容可以是空 #validates :content, presence: true, if: Proc.new{|o| !o.parent_id.nil? } validates_length_of :subject, maximum: 50 - validates_length_of :content, maximum: 30000 + validate :cannot_reply_to_locked_topic, :on => :create diff --git a/app/views/games/_code_actions.html.erb b/app/views/games/_code_actions.html.erb index 5dbeb1731..9d026ad1a 100644 --- a/app/views/games/_code_actions.html.erb +++ b/app/views/games/_code_actions.html.erb @@ -146,16 +146,16 @@ $.ajax({ url: '<%= game_build_myshixun_game_path(@game, :myshixun_id => @myshixun) %>', success: function (data){ - timeID = setInterval(function(){ + /* timeID = setInterval(function(){ $.ajax({ - url: '<%= get_waiting_time_myshixun_game_path(@game, :myshixun_id => @myshixun) %>', + url: '<%#= get_waiting_time_myshixun_game_path(@game, :myshixun_id => @myshixun) %>', data:{resubmit:data.resubmit}, async: false, success: function(data){ console.log(data); if(data.onRun == 1){ clearInterval(timeID); - $("#game_wating_time").html(""); + $("#game_wating_time").html("");*/ // 每2s匹配一次状态,成功2 评测中1 评测 0 var intId = setInterval(function(){ var ajaxTimeoutTest = $.ajax({ @@ -271,7 +271,7 @@ }} }); }, 2000); - }else if(data.onRun == 0){ + /*}else if(data.onRun == 0){ mintes = parseInt(data.waitingTime / 60); if(mintes > 1){ $("#game_wating_time").html("目前正有" + data.waitNum + "个任务正在等待,大约需要等待" + mintes + "分钟") @@ -281,7 +281,7 @@ } } }) - }, 2000); + }, 2000);*/ } }); diff --git a/app/views/games/_repository.html.erb b/app/views/games/_repository.html.erb index 2faefaefa..f735604cc 100644 --- a/app/views/games/_repository.html.erb +++ b/app/views/games/_repository.html.erb @@ -54,11 +54,6 @@
    <%= file_update_myshixun_game_path(@game, :myshixun_id => @myshixun, :path => @path) %>
    \ No newline at end of file From 7885f297e41bda78a12524f32b1a33abebba11fe Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 12 Oct 2017 19:56:43 +0800 Subject: [PATCH 14/29] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 6ffabcbbb..117217c1a 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -1578,7 +1578,7 @@ end @sub_type = 5 @type = trial_authorization_status params[:type] # sql = select * from apply_actions where dealer_id is null - @authorizations = ApplyAction.where(:container_type => "ApplyShixun", :status => @type, :dealer_id =>'').order("created_at desc") + @authorizations = ApplyAction.where(:container_type => "ApplyShixun", :status => @type).order("created_at desc") search = params[:search] unless search.blank? @authorizations = @authorizations.where(:container_id => Shixun.where(:id => @authorizations.map(&:container_id)).where("name like '%#{search}%'").map(&:id)).order("created_at desc") From ea860db2994fce4ea11767036375b3fad911480b Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 12 Oct 2017 21:54:56 +0800 Subject: [PATCH 15/29] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0PHP=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/index.html.erb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/views/shixuns/index.html.erb b/app/views/shixuns/index.html.erb index cee2e50e1..21ba7e96f 100644 --- a/app/views/shixuns/index.html.erb +++ b/app/views/shixuns/index.html.erb @@ -94,6 +94,14 @@ +
  • + + +
  • +
  • + + +
  • From 4c42d42cf20509da0a06594bcf968fb3097e991f Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Fri, 13 Oct 2017 09:57:47 +0800 Subject: [PATCH 16/29] =?UTF-8?q?=E5=88=86=E7=8F=AD=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E8=B0=83=E6=95=B4=E4=BB=A5=E5=8F=8A=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=9A=84=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/settings/_all_student_list.html.erb | 6 +++--- app/views/courses/settings/_all_teacher_list_ul.erb | 6 +++--- .../courses/settings/_has_group_student_list.html.erb | 6 +++--- app/views/courses/settings/_no_group_student_list.html.erb | 6 +++--- app/views/files/_attachment_history_popub_delete.html.erb | 7 ++++--- public/stylesheets/css/edu-class.css | 2 +- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/app/views/courses/settings/_all_student_list.html.erb b/app/views/courses/settings/_all_student_list.html.erb index ad54ce938..c0be48c37 100644 --- a/app/views/courses/settings/_all_student_list.html.erb +++ b/app/views/courses/settings/_all_student_list.html.erb @@ -9,14 +9,14 @@ <% if @no_group_count > 0 %>
  • -

    未分班<%= @no_group_count %>

    +

    未分班<%= @no_group_count %>

  • <% end %> <% unless @course.course_groups.empty? %> <% @course.course_groups.each do |group| %>
  • - <%= group.name %> + <%= group.name %> <%= group.members.count %>

    @@ -31,7 +31,7 @@