From e24470db4c9067f08e6f04e20289be77bae4ab9c Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Sun, 15 May 2016 00:00:16 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=88=AA=E5=8F=96ERROR=5FMSG=E6=97=B6=E5=8F=AA=E5=9C=A8?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=94=99=E8=AF=AF=E4=B8=8B=E6=88=AA=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index ba2999577..589f232c5 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -123,7 +123,9 @@ class StudentWorkController < ApplicationController #-1 默认值 0全部正确并结束 2 超时 -2 编译错误 resultObj[:status] = -1 resultObj[:results] = result["results"].first #本次测试结果 - result["error_msg"] = result["error_msg"][0..2047] + if result["status"].to_i == -2 #编译错误 + result["error_msg"] = result["error_msg"][0..2047] + end resultObj[:error_msg] = result["error_msg"] #编译错误时的信息 #该状态用于存入CodeTests From 708cb35fd22e432dca25fb12f88fd0e1c9ac9ab4 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Mon, 16 May 2016 16:57:18 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E7=9A=84=E9=80=9A=E7=94=A8=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?pop=5Fup=5Fbox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 190 +++++++++++--------- app/views/admin/code_work_tests.html.erb | 8 +- app/views/blogs/_article.html.erb | 4 +- app/views/users/_course_boardlist.html.erb | 4 +- app/views/users/_course_newslist.html.erb | 4 +- app/views/users/_project_boardlist.html.erb | 4 +- app/views/users/_user_course_list.html.erb | 8 +- app/views/users/_user_project_list.html.erb | 4 +- lib/rails_kindeditor/config/routes.rb | 2 +- public/assets/kindeditor/pasteimg.js | 5 +- public/javascripts/application.js | 30 ++++ public/javascripts/homework.js | 26 ++- 12 files changed, 181 insertions(+), 108 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 589f232c5..3497e9fdd 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -81,6 +81,7 @@ class StudentWorkController < ApplicationController #根据传入的tIndex确定是第几次测试 #之后如果觉得很卡 可以改成将结果传回JS再以参数形式传回来 def program_test_ex + tStarttime = Time.now is_test = params[:is_test] == 'true' @@ -106,108 +107,123 @@ class StudentWorkController < ApplicationController tEndtime = Time.now tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000 logger.debug "program_test_ex user wait time = #{tUsedtime} 毫秒" - - #status 0:答案正确 -3http超时 -2:编译错误 -1:答案错误 2:程序运行超时 + #status 0:答案正确 -5program_test_ex 函数出错 -4judge代码出错 -3http超时 -2:编译错误 -1:答案错误 2:程序运行超时 + resultObj[:status] = -3 CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>-3,:wait_time=>tUsedtime,:student_work_id=>student_work.id) - + rescue + #-4 judge代码 出错 + logger.debug "program_test_error 1" + resultObj[:status] = -4 + tmpstatus = -4 + CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>0,:wait_time=>0,:student_work_id=>student_work.id) end - if result["status"].to_i != -2 - #result["results"].first['output'] = result["results"].first['output'].gsub(" ","□") - #result["results"].first['result'] = result["results"].first['result'].gsub(" ","□") - space_replace_1(result["results"].first['output']) - space_replace_1(result["results"].first['result']) - end - - logger.debug result - #-1 默认值 0全部正确并结束 2 超时 -2 编译错误 - resultObj[:status] = -1 - resultObj[:results] = result["results"].first #本次测试结果 - if result["status"].to_i == -2 #编译错误 - result["error_msg"] = result["error_msg"][0..2047] - end - resultObj[:error_msg] = result["error_msg"] #编译错误时的信息 + begin + if resultObj[:status] != -3 && resultObj[:status] != -4 + if result["status"].to_i != -2 + #result["results"].first['output'] = result["results"].first['output'].gsub(" ","□") + #result["results"].first['result'] = result["results"].first['result'].gsub(" ","□") + space_replace_1(result["results"].first['output']) + space_replace_1(result["results"].first['result']) + end - #该状态用于存入CodeTests - tmpstatus = -1 - if result["status"].to_i == -2 #编译错误 - resultObj[:results] = result["error_msg"] - resultObj[:status] = -2 - tmpstatus = -2 - elsif result["results"][0]["status"].to_i == 2 - resultObj[:status] = 2 - tmpstatus = 2 - end + logger.debug result + + #-1 默认值 0全部正确并结束 2 超时 -2 编译错误 + resultObj[:status] = -1 + resultObj[:results] = result["results"].first #本次测试结果 + # if result["status"].to_i == -2 #编译错误 + result["error_msg"] = result["error_msg"][0..2047] + # end + resultObj[:error_msg] = result["error_msg"] #编译错误时的信息 + + #该状态用于存入CodeTests + tmpstatus = -1 + if result["status"].to_i == -2 #编译错误 + resultObj[:results] = result["error_msg"] + resultObj[:status] = -2 + tmpstatus = -2 + elsif result["results"][0]["status"].to_i == 2 + resultObj[:status] = 2 + tmpstatus = 2 + end - if result["status"] == 0 - tmpstatus = 0 - end + if result["status"] == 0 + tmpstatus = 0 + end - unless student_work.save - resultObj[:status] = 200 - else - student_work.name = params[:title] - student_work.description = params[:src] + unless student_work.save + resultObj[:status] = 200 + else + student_work.name = params[:title] + student_work.description = params[:src] - if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") - student_work.late_penalty = @homework.late_penalty - else - student_work.late_penalty = 0 - end + if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") + student_work.late_penalty = @homework.late_penalty + else + student_work.late_penalty = 0 + end - #每次从数据库取出上次的结果加上本次的结果再存入数据库 - if result["status"].to_i != -2 - result["results"].first['user_wait'] = tUsedtime + #每次从数据库取出上次的结果加上本次的结果再存入数据库 + if result["status"].to_i != -2 + result["results"].first['user_wait'] = tUsedtime - if result["results"][0]["status"].to_i == 2 - result["status"] = 2 - end - end + if result["results"][0]["status"].to_i == 2 + result["status"] = 2 + end + end - status = result["status"] - if index == 1 - student_work_test = student_work.student_work_tests.build(status: status, - results: [resultObj[:results]],src: params[:src]) - student_work_test.save! - resultObj[:testid] = student_work_test.id - else - #先从数据库取出result - student_work_test = StudentWorkTest.find(params[:testid]) - results = student_work_test.results - results << resultObj[:results] - student_work_test.results = results - student_work_test.status = (result["status"] != 0 ? result["status"] : student_work_test.status) - student_work_test.save! - status = student_work_test.status - resultObj[:testid] = student_work_test.id - end + status = result["status"] + if index == 1 + student_work_test = student_work.student_work_tests.build(status: status, + results: [resultObj[:results]],src: params[:src]) + student_work_test.save! + resultObj[:testid] = student_work_test.id + else + #先从数据库取出result + student_work_test = StudentWorkTest.find(params[:testid]) + results = student_work_test.results + results << resultObj[:results] + student_work_test.results = results + student_work_test.status = (result["status"] != 0 ? result["status"] : student_work_test.status) + student_work_test.save! + status = student_work_test.status + resultObj[:testid] = student_work_test.id + end - #超时或编译错误则直接返回了并存入数据库 - if resultObj[:status] == 2 || resultObj[:status] == -2 || index == @homework.homework_tests.size - if status == 0 - resultObj[:status] = 0 - end - student_work.save! - resultObj[:time] = student_work_test.created_at.to_s(:db) - resultObj[:index] = student_work.student_work_tests.count - end + #超时或编译错误则直接返回了并存入数据库 + if resultObj[:status] == 2 || resultObj[:status] == -2 || index == @homework.homework_tests.size + if status == 0 + resultObj[:status] = 0 + end + student_work.save! + resultObj[:time] = student_work_test.created_at.to_s(:db) + resultObj[:index] = student_work.student_work_tests.count + end - #将每次用户等待时间都存起来以便管理界面显示用 - tEndtime = Time.now - tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000 - logger.debug "program_test_ex user wait time = #{tUsedtime} 毫秒" + #将每次用户等待时间都存起来以便管理界面显示用 + tEndtime = Time.now + tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000 + logger.debug "program_test_ex user wait time = #{tUsedtime} 毫秒" - time_used = 0 - if result["status"].to_i != -2 - #至少一毫秒 - time_used = result["results"].first['time_used'] == 0 ? 1:result["results"].first['time_used'] + time_used = 0 + if result["status"].to_i != -2 + #至少一毫秒 + time_used = result["results"].first['time_used'] == 0 ? 1:result["results"].first['time_used'] + end + #0:答案正确 -3http超时 -2:编译错误 -1:答案错误 2:程序运行超时 + CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>time_used,:wait_time=>tUsedtime,:student_work_id=>student_work.id) + end end - #0:答案正确 -3http超时 -2:编译错误 -1:答案错误 2:程序运行超时 - CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>time_used,:wait_time=>tUsedtime,:student_work_id=>student_work.id) - - #渲染返回结果 - render :json => resultObj + rescue + #-5 program_test_ex 函数出错 + logger.debug "program_test_error 2" + resultObj[:status] = -5 + tmpstatus = -5 + CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>0,:wait_time=>0,:student_work_id=>student_work.id) end + #渲染返回结果 + render :json => resultObj end end end diff --git a/app/views/admin/code_work_tests.html.erb b/app/views/admin/code_work_tests.html.erb index 64c3a41e1..2013bd322 100644 --- a/app/views/admin/code_work_tests.html.erb +++ b/app/views/admin/code_work_tests.html.erb @@ -24,8 +24,8 @@ 测试完成时间 - - 答题状态 + + 答题状态 耗时 @@ -76,6 +76,10 @@ <%= "代码超时" %> <% elsif test.status == -3 %> <%= "请求超时" %> + <% elsif test.status == -4 %> + <%= "judge代码出错!" %> + <% elsif test.status == -5 %> + <%= "trustie代码出错!" %> <% else %> <%= "答题错误" %> <% end %> diff --git a/app/views/blogs/_article.html.erb b/app/views/blogs/_article.html.erb index 4c00ee8a2..77aa3f9d8 100644 --- a/app/views/blogs/_article.html.erb +++ b/app/views/blogs/_article.html.erb @@ -43,8 +43,8 @@ <% count=activity.children.count%> <% end %>
  • - 发帖时间:<%= format_time(activity.created_on) %> - 更新时间:<%= format_time(activity.updated_on) %> + 发帖:<%= format_time(activity.created_on) %> + 更新:<%= format_time(activity.updated_on) %>

    <%= count>0 ? "#{count}" :"0" %> 回复 diff --git a/app/views/users/_course_boardlist.html.erb b/app/views/users/_course_boardlist.html.erb index c92d117ee..bf23d9a97 100644 --- a/app/views/users/_course_boardlist.html.erb +++ b/app/views/users/_course_boardlist.html.erb @@ -45,8 +45,8 @@

    <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>100} %>

    - 发帖时间:<%= format_time(activity.created_on) %> - 更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> + 发帖:<%= format_time(activity.created_on) %> + 更新:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> <% count=0 %> <% if activity.parent %> <% count=activity.parent.children.count%> diff --git a/app/views/users/_course_newslist.html.erb b/app/views/users/_course_newslist.html.erb index ff99e116e..0e5805112 100644 --- a/app/views/users/_course_newslist.html.erb +++ b/app/views/users/_course_newslist.html.erb @@ -33,8 +33,8 @@

    <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>activity.description, :maxheight=>54, :maxwordsnum=>100} %>

    - 发布时间:<%= format_time(activity.created_on) %> - 更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> + 发布:<%= format_time(activity.created_on) %> + 更新:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> <% count=0 %> <% count=activity.comments.count %>

    <%= count>0 ? "#{count}" : "0" %>回复|<%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %>

    diff --git a/app/views/users/_project_boardlist.html.erb b/app/views/users/_project_boardlist.html.erb index 5f61d26ef..928d682d8 100644 --- a/app/views/users/_project_boardlist.html.erb +++ b/app/views/users/_project_boardlist.html.erb @@ -45,8 +45,8 @@

    <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>100} %>

    - 发帖时间:<%= format_time(activity.created_on) %> - 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> + 发帖:<%= format_time(activity.created_on) %> + 更新:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> <% count=0 %> <% if activity.parent %> <% count=activity.parent.children.count%> diff --git a/app/views/users/_user_course_list.html.erb b/app/views/users/_user_course_list.html.erb index 8ef0faa9e..5e3f48963 100644 --- a/app/views/users/_user_course_list.html.erb +++ b/app/views/users/_user_course_list.html.erb @@ -28,12 +28,10 @@
  • + + 更新:<%= format_time(course.updated_on) %> - 创建时间:<%= format_time(course.created_at) %> - - 更新时间:<%= format_time(course.updated_on) %> - - 开课学期:  <%= current_time_and_term course %> + 学期:  <%= current_time_and_term course %> <% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %> <% homework_num = course.homework_commons.count %> diff --git a/app/views/users/_user_project_list.html.erb b/app/views/users/_user_project_list.html.erb index 1526da58f..6124b82d8 100644 --- a/app/views/users/_user_project_list.html.erb +++ b/app/views/users/_user_project_list.html.erb @@ -27,8 +27,8 @@
  • - 创建时间:<%= format_time(project.created_on) %> - 更新时间:<%= format_time(project.updated_at) %> + + 更新:<%= format_time(project.updated_at) %>

    <%= project.project_score.issue_num %>问题| <%= project.project_score.attach_num %>资源

  • diff --git a/lib/rails_kindeditor/config/routes.rb b/lib/rails_kindeditor/config/routes.rb index 86b888ad3..e205376d9 100644 --- a/lib/rails_kindeditor/config/routes.rb +++ b/lib/rails_kindeditor/config/routes.rb @@ -2,6 +2,6 @@ Rails.application.routes.draw do namespace :kindeditor do post "/upload" => "assets#create" get "/filemanager" => "assets#list" - get "/uploadpic" => "assets#uploadpic" + post "/uploadpic" => "assets#uploadpic" end end \ No newline at end of file diff --git a/public/assets/kindeditor/pasteimg.js b/public/assets/kindeditor/pasteimg.js index 7165b142a..97d5e33c5 100644 --- a/public/assets/kindeditor/pasteimg.js +++ b/public/assets/kindeditor/pasteimg.js @@ -370,6 +370,9 @@ function df(myself) { else sstr += that.attr("src") + "|"; } + else if (that.attr("src").indexOf("data:image") >= 0){ + that.parents().removeAttr("href"); //删除所有父节点的href + } } }); uploadpic(sstr,myself); @@ -397,7 +400,7 @@ function uploadpic(piclist,myself) { $.ajax({ url: "/kindeditor/uploadpic", data:{"pic":piclist}, - type: "GET", + type: "POST", beforeSend: function () { // $("#ajax-indicator span").text("图片上传中请稍等..."); keShadow(myself); diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 4cf64abb7..9820f66ff 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1261,3 +1261,33 @@ function description_showwords_ellipsis(id,num){ $("#intro_content_"+id).show(); } + +//by yk 弹框 tWidth = 580 tTop=30 tLeft=50 +function pop_up_box(value,tWidth,tTop,tLeft){ + + if(!tWidth){ + var tWidth = 580; + } + + if(!tTop){ + var tTop = 30; + } + + if(!tLeft){ + var tLeft = 50; + } + + $("#ajax-modal").html(value); + showModal('ajax-modal', tWidth + "px"); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').before(""); + $('#ajax-modal').parent().css("top", tTop+"%").css("left", tLeft+"%").css("padding-top", "10px").css("position", "fixed"); + $('#ajax-modal').parent().addClass("resourceUploadPopup"); + $('#ajax-modal').css("padding-left", "16px").css("padding-bottom", "16px"); + + function hideModal(){ + $('#ajax-modal').hide(); + } +} + + diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index 391774f0b..aaf70cd3f 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -66,6 +66,24 @@ $(function(){ src: src, title: title, is_test: is_test,tIndex:i, testid: testid}, function(data,status){ + if (data.status==-4 || data.status==-5 ){ +// alert("非常抱歉,您的程序引起了后台问题,请在公共贴吧提交您的代码进行意见反馈,谢谢!"); + //弹框 + var root_path = getRootPath(); + var forums_1_path = root_path + "/forums/1" + var htmlvalue = "
    您的程序引发了不知名异常,请在公共贴吧提交您的代码进行意见反馈,我们处理后会立即联系您,谢谢!
    点我进入反馈页面
    "; + pop_up_box(htmlvalue,580,30,50); + + $('#test-program-btn').show(); + return; + } + else if (data.status==-3){ + alert("对不起,服务器繁忙请稍后再试!"); + var htmlvalue = "
    对不起,服务器繁忙请稍后再试!
    "; + pop_up_box(htmlvalue,580,30,50); + $('#test-program-btn').show(); + return; + } var tSeq = data.tseq; var tCount = data.tcount; console.log("tSeq="+tSeq); @@ -100,9 +118,13 @@ $(function(){ } ).fail(function(xhr, status){ if(status == 'timeout'){ - alert("您的答案超时了, 请检查代码是否存在死循环的错误."); +// alert("您的答案超时了, 请检查代码是否存在死循环的错误."); + var htmlvalue = "
    您的答案超时了, 请检查代码是否存在死循环的错误!
    "; + pop_up_box(htmlvalue,580,30,50); } else { - alert("对不起,服务器繁忙请稍后再试!"); +// alert("对不起,服务器繁忙请稍后再试!"); + var htmlvalue = "
    对不起,服务器繁忙请稍后再试!
    "; + pop_up_box(htmlvalue,580,30,50); } $('#test-program-btn').show(); return; From 025d07e6a4ecb3039c863bc226d6218ea3817cab Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Mon, 16 May 2016 17:02:18 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E4=BF=A1=E6=81=AF=E9=95=BF=E5=BA=A6=E9=99=90?= =?UTF-8?q?=E5=88=B6=E4=B8=8D=E5=B0=8F=E5=BF=83=E6=B3=A8=E9=87=8A=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 4 ++-- public/javascripts/application.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 3497e9fdd..19fe8de9e 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -132,9 +132,9 @@ class StudentWorkController < ApplicationController #-1 默认值 0全部正确并结束 2 超时 -2 编译错误 resultObj[:status] = -1 resultObj[:results] = result["results"].first #本次测试结果 - # if result["status"].to_i == -2 #编译错误 + if result["status"].to_i == -2 #编译错误 result["error_msg"] = result["error_msg"][0..2047] - # end + end resultObj[:error_msg] = result["error_msg"] #编译错误时的信息 #该状态用于存入CodeTests diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 9820f66ff..d9f532a48 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1262,7 +1262,7 @@ function description_showwords_ellipsis(id,num){ } -//by yk 弹框 tWidth = 580 tTop=30 tLeft=50 +//by yk 弹框 value:html代码或跳转其他页面代码 tWidth = 580 tTop=30 tLeft=50 function pop_up_box(value,tWidth,tTop,tLeft){ if(!tWidth){ From c0de43ecc0c320922bc9870ff1acd143487d0f82 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Tue, 17 May 2016 10:31:10 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9KE=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E9=97=B4=E8=B7=9D=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=87=BA=E9=94=99=E6=8F=90=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_intro_content.html.erb | 2 +- .../kindeditor/plugins/code/previewcode.css | 5 +++-- public/javascripts/homework.js | 2 +- public/stylesheets/courses.css | 14 +++++++------- public/stylesheets/css.css | 4 ++-- public/stylesheets/new_user.css | 18 +++++++++--------- public/stylesheets/project.css | 18 +++++++++--------- public/stylesheets/public.css | 8 ++++---- 8 files changed, 36 insertions(+), 35 deletions(-) diff --git a/app/views/users/_intro_content.html.erb b/app/views/users/_intro_content.html.erb index c18e520ba..351f1fdb0 100644 --- a/app/views/users/_intro_content.html.erb +++ b/app/views/users/_intro_content.html.erb @@ -1,4 +1,4 @@ -
    +
    <%= content.to_s.html_safe%>
    diff --git a/public/assets/kindeditor/plugins/code/previewcode.css b/public/assets/kindeditor/plugins/code/previewcode.css index b9c8252e8..15951ce98 100644 --- a/public/assets/kindeditor/plugins/code/previewcode.css +++ b/public/assets/kindeditor/plugins/code/previewcode.css @@ -51,5 +51,6 @@ span.at {color:#269ac9;} span.at a{color:#269ac9;text-decoration: none;} /*yk*/ -.ke-content ol li{list-style-type: decimal;margin-left: 20px;} -.ke-content ul li{list-style-type: disc;margin-left: 20px;} \ No newline at end of file +.ke-content ol li{list-style-type: decimal;} +.ke-content ul li{list-style-type: disc;} +ol,ul{margin-top:0;} \ No newline at end of file diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index aaf70cd3f..b1144ebf1 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -71,7 +71,7 @@ $(function(){ //弹框 var root_path = getRootPath(); var forums_1_path = root_path + "/forums/1" - var htmlvalue = "
    您的程序引发了不知名异常,请在公共贴吧提交您的代码进行意见反馈,我们处理后会立即联系您,谢谢!
    点我进入反馈页面
    "; + var htmlvalue = "
    您的程序引发了不知名异常,请在公共贴吧提交您的代码进行意见反馈,我们处理后会立即联系您,谢谢!
    点我进入反馈页面
    "; pop_up_box(htmlvalue,580,30,50); $('#test-program-btn').show(); diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 6e55146a6..036bdeb8d 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -129,8 +129,8 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostSubmit {font-size:14px; color:#888888; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px; padding:0px 10px;} .homepagePostSubmit:hover {background-color:#d8d8d8;} .homepagePostIntro {font-size:14px; color:#484848;overflow:hidden;} -.homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;} -.homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostIntro ol li{list-style-type: decimal;margin-left: 40px;} +.homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;} .homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} .homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;} @@ -426,8 +426,8 @@ a:hover.ping_sub{ background:#14a8b9;} .ping_distop p{ color:#5f5f5f;word-break: break-all;word-wrap: break-word;} .ping_disfoot a{ float:right; color: #6883b6; margin-left:5px; margin-bottom:5px;} /*.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}*/ -.list_style ol li{list-style-type: decimal;margin-left: 20px;} -.list_style ul li{list-style-type: disc;margin-left: 20px;} +.list_style ol li{list-style-type: decimal;margin-left: 40px;} +.list_style ul li{list-style-type: disc;margin-left: 40px;} span.author { font-size: 0.9em; color: #888; } /* 创建作品 work */ @@ -1114,10 +1114,10 @@ a.link_file_a2{ background:url(../images/pic_file.png) 0 -15px no-repeat; paddin .postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} -.postDetailDes ol li{list-style-type: decimal;margin-left: 20px;} -.postDetailDes ul li{list-style-type: disc;margin-left: 20px;} +.postDetailDes ol li{list-style-type: decimal;margin-left: 40px;} +.postDetailDes ul li{list-style-type: disc;margin-left: 40px;} .postDetailDes td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} -.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;} +.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; } .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} .postDetailReply { margin-top:28px; color:#888888; float:right;} diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index b740436f9..3e21a5fda 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -120,8 +120,8 @@ a:hover.ping_sub{ background:#14a8b9;} .ping_distop span{ float:left;} .ping_distop p{ color:#5f5f5f;min-height: 24px;} .ping_disfoot a{ float:right; color:#15bccf; margin-left:5px;} -.list_style ol li{list-style-type: decimal;margin-left: 20px;} -.list_style ul li{list-style-type: disc;margin-left: 20px;} +.list_style ol li{list-style-type: decimal;margin-left: 40px;} +.list_style ul li{list-style-type: disc;margin-left: 40px;} .ping_distop span a{ float:right; /*width:20px;*/ height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 67176c761..3b2857854 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -676,8 +676,8 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;} .homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;} .homepagePostReply {width:720px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;} -.homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;} -.homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostIntro ol li{list-style-type: decimal;margin-left: 40px;} +.homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;} .homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} .homepagePostReplyBanner {width:718px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;} .borderBottomNone {border-bottom:none !important;} @@ -713,8 +713,8 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;} .homepagePostReplyDes {float:left; width:642px; margin-left:15px;} .homepagePostReplyPublisher {font-size:12px; color:#888888; margin-bottom:5px;} .homepagePostReplyContent {font-size:12px; color:#484848; margin:3px 5px 12px 5px;font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family:"微软雅黑","宋体";} -.homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 20px;} -.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 40px;} +.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 40px;} .homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} .table_maxWidth table {max-width: 642px;} .homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} @@ -857,10 +857,10 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re .postDetailTitle {width:570px; max-width:570px; margin-bottom:5px;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} -.postDetailDes ol li{list-style-type: decimal;margin-left: 20px;} -.postDetailDes ul li{list-style-type: disc;margin-left: 20px;} +.postDetailDes ol li{list-style-type: decimal;margin-left: 40px;} +.postDetailDes ul li{list-style-type: disc;margin-left: 40px;} .postDetailDes td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} -.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;} +.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; } /*line-height: 18px !important;*/ .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} .postDetailReply { color:#888888; float:right;display: inline} @@ -1351,8 +1351,8 @@ a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-l a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} .link_file_a{ display:block; max-width:450px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} -.list_style ol li{list-style-type: decimal;margin-left: 20px;} -.list_style ul li{list-style-type: disc;margin-left: 20px;} +.list_style ol li{list-style-type: decimal;margin-left: 40px;} +.list_style ul li{list-style-type: disc;margin-left: 40px;} .ul_grey li {color:#909090; list-style-position:inside; padding-left:1px;list-style-image:url('../images/news_dot2.png')} .ul_normal_color li {list-style-position:inside; padding-left:1px; list-style-image:url('../images/news_dot.png')} span.author { font-size: 0.9em; color: #888; } diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 1ef99e66b..c7ec7e1ab 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -220,8 +220,8 @@ a:hover.talk_btn{ background:#2a9dc1;} .mt0{ margin-top:0px;} .talk_info{ margin-left:60px; margin-top:10px;} /*.issue_desc li{list-style-type: decimal;margin-left: 20px;}*/ -.issue_desc ol li{list-style-type: decimal;margin-left: 20px;} -.issue_desc ul li{list-style-type: disc;margin-left: 20px;} +.issue_desc ol li{list-style-type: decimal;margin-left: 40px;} +.issue_desc ul li{list-style-type: disc;margin-left: 40px;} .talk_info img {max-width:100%;} a.talk_edit{ color:#426e9a; margin-right:5px;} a:hover.talk_edit{ color:#ff5722;} @@ -333,8 +333,8 @@ a:hover.ping_sub{ background:#14a8b9;} .ping_distop p{ color:#5f5f5f;word-break: break-all;word-wrap: break-word;} .ping_disfoot a{ float:right; color: #6883b6; margin-left:5px; margin-bottom:5px;} /*.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}*/ -.list_style ol li{list-style-type: decimal;margin-left: 20px;} -.list_style ul li{list-style-type: disc;margin-left: 20px;} +.list_style ol li{list-style-type: decimal;margin-left: 40px;} +.list_style ul li{list-style-type: disc;margin-left: 40px;} /*上传资源弹出框样式*/ .popbox_polls{position:fixed !important;} @@ -971,8 +971,8 @@ a:hover.Reply_pic{border:1px solid #64bdd9;} margin: 10px auto 0px; background-color: #F1F1F1; } -.homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;} -.homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostIntro ol li{list-style-type: decimal;margin-left: 40px;} +.homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;} .homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} .topBorder { border-top: 1px solid #E4E4E4; @@ -1111,10 +1111,10 @@ a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;} .postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} -.postDetailDes ol li{list-style-type: decimal;margin-left: 20px;} -.postDetailDes ul li{list-style-type: disc;margin-left: 20px;} +.postDetailDes ol li{list-style-type: decimal;margin-left: 40px;} +.postDetailDes ul li{list-style-type: disc;margin-left: 40px;} .postDetailDes td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} -.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;} +.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} .postDetailReply { margin-top:28px; color:#888888; float:right;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 253aaf46b..0d19724e7 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -599,8 +599,8 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostSubmit {font-size:14px; color:#888888; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px; padding:0px 10px;} .homepagePostSubmit:hover {background-color:#d8d8d8;} .homepagePostIntro {font-size:14px; color:#484848;overflow:hidden;} -.homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;} -.homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostIntro ol li{list-style-type: decimal;margin-left: 40px;} +.homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;} .homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} .homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;} .homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;} @@ -635,8 +635,8 @@ a.postReplyCancel:hover {color:#ffffff;} .homepagePostReplyDes {float:left; width:620px; margin-left:15px;} .homepagePostReplyPublisher {font-size:12px; color:#484848; margin-bottom:5px;} .homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;} -.homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 20px;} -.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 40px;} +.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 40px;} .homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} .table_maxWidth table {max-width: 642px;} .homepagePostProjectState {width:42px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} From 93fb4441d83a54c6378770c395023f8b60419598 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Tue, 17 May 2016 14:12:42 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=94=B9=E7=94=A8=E6=96=B0=E7=9A=84=E6=8F=90=E7=A4=BA=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/homework.js | 50 ++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index b1144ebf1..a4b30384a 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -11,11 +11,17 @@ $(function(){ var title = $('#program-title').val(); if (!src) { - alert('请输入正确的代码'); +// alert('请输入正确的代码'); + + var htmlvalue = "
    请输入正确的代码!

    确定
    "; + pop_up_box(htmlvalue,580,30,50); + return false; } if (!title) { - alert('请输入标题'); +// alert('请输入标题'); + var htmlvalue = "
    请输入标题!

    确定
    "; + pop_up_box(htmlvalue,580,30,50); return false; } return true; @@ -78,8 +84,8 @@ $(function(){ return; } else if (data.status==-3){ - alert("对不起,服务器繁忙请稍后再试!"); - var htmlvalue = "
    对不起,服务器繁忙请稍后再试!
    "; +// alert("对不起,服务器繁忙请稍后再试!"); + var htmlvalue = "
    对不起,服务器繁忙请稍后再试!

    确定
    "; pop_up_box(htmlvalue,580,30,50); $('#test-program-btn').show(); return; @@ -99,10 +105,8 @@ $(function(){ if (data.status==0 && is_test != 'true') { if (typeof cb == 'function') {cb(data);$('#test-program-btn').show(); return;} - var r=confirm("答题正确,是否立刻提交?"); - if (r) { - $(".HomeWorkCon form").submit(); - } + var htmlvalue = "
    答题正确,是否立刻提交?

    确定取消
    "; + pop_up_box(htmlvalue,580,30,50); $('#test-program-btn').show(); return; } @@ -119,11 +123,11 @@ $(function(){ ).fail(function(xhr, status){ if(status == 'timeout'){ // alert("您的答案超时了, 请检查代码是否存在死循环的错误."); - var htmlvalue = "
    您的答案超时了, 请检查代码是否存在死循环的错误!
    "; + var htmlvalue = "
    您的答案超时了, 请检查代码是否存在死循环的错误!

    确定
    "; pop_up_box(htmlvalue,580,30,50); } else { // alert("对不起,服务器繁忙请稍后再试!"); - var htmlvalue = "
    对不起,服务器繁忙请稍后再试!
    "; + var htmlvalue = "
    对不起,服务器繁忙请稍后再试!

    确定
    "; pop_up_box(htmlvalue,580,30,50); } $('#test-program-btn').show(); @@ -142,20 +146,30 @@ $(function(){ return; } if($('.ProResult .ProResultTop').length<=0){ - var r=confirm("测试后才能提交,是否立刻测试?"); - if (r) { +// var r=confirm("测试后才能提交,是否立刻测试?"); +// if (r) { +// test_program(); +// } + + var htmlvalue = "
    测试后才能提交,是否立刻测试?

    确定取消
    "; + pop_up_box(htmlvalue,580,30,50); + $("#code-test-button").on('click',function(){ test_program(); - } + hideModal(); + }); return; } - if (!tested) { test_program(function(data){ if (data.status!=0) { - var r=confirm("测试不通过,是否强制提交?"); - if (!r) { - return; - } +// var r=confirm("测试不通过,是否强制提交?"); +// if (!r) { +// return; +// } + var htmlvalue = "
    测试不通过,是否强制提交?

    确定取消
    "; + pop_up_box(htmlvalue,580,30,50); + return; + }; $(".HomeWorkCon form").submit(); }); From 0ac7163b0548df08fc21f1df0c321a5a6ef0c015 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Tue, 17 May 2016 15:55:24 +0800 Subject: [PATCH 6/9] =?UTF-8?q?KE=E4=BF=AE=E6=94=B9=E5=B1=85=E4=B8=AD?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E5=B1=85=E4=B8=AD=E6=B6=88=E5=A4=B1=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/kindeditor.js | 4 +-- public/javascripts/homework.js | 41 -------------------------- 2 files changed, 2 insertions(+), 43 deletions(-) diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 9ae1300e7..12db483b8 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -249,7 +249,7 @@ K.options = { themeType : 'default', langType : 'zh_CN', urlType : '', - newlineTag : 'p', + newlineTag : 'br', resizeType : 1, syncType : 'form', pasteType : 2, @@ -2539,7 +2539,7 @@ function _nativeCommand(doc, key, val) { function _nativeCommandValue(doc, key) { var val = ''; try { - val = doc.queryCommandValue(key); + val = doc.query_nativeCommand(self.doc, name, val);Value(key); } catch (e) {} if (typeof val !== 'string') { val = ''; diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index a4b30384a..45d8de48b 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -11,15 +11,12 @@ $(function(){ var title = $('#program-title').val(); if (!src) { -// alert('请输入正确的代码'); - var htmlvalue = "
    请输入正确的代码!

    确定
    "; pop_up_box(htmlvalue,580,30,50); return false; } if (!title) { -// alert('请输入标题'); var htmlvalue = "
    请输入标题!

    确定
    "; pop_up_box(htmlvalue,580,30,50); return false; @@ -39,31 +36,6 @@ $(function(){ $('#test-program-btn').show(); return; } - /* - $.post( - '/student_work/program_test_ex', - {homework: homework_id, student_work_id: student_work_id, src: src, title: title, is_test: is_test}, - function(data,status){ - tested = true; - console.log(data); - if(data.index <=0){ - data.index = $('.ProResultTop').length+1; - } - - if (typeof cb == 'function') {cb(data); return;} - - var html=bt('t:result-list',data); - $('.ProResult').prepend(html); - - if (data.status==0 && is_test != 'true') { - var r=confirm("答题正确,是否立刻提交?"); - if (r) { - $(".HomeWorkCon form").submit(); - } - } - } - ); - */ //先测试一次并返回测试集个数及结果再判断是否需要继续进行测试 var test_post = function(i, testid){ $.post( @@ -73,7 +45,6 @@ $(function(){ testid: testid}, function(data,status){ if (data.status==-4 || data.status==-5 ){ -// alert("非常抱歉,您的程序引起了后台问题,请在公共贴吧提交您的代码进行意见反馈,谢谢!"); //弹框 var root_path = getRootPath(); var forums_1_path = root_path + "/forums/1" @@ -84,7 +55,6 @@ $(function(){ return; } else if (data.status==-3){ -// alert("对不起,服务器繁忙请稍后再试!"); var htmlvalue = "
    对不起,服务器繁忙请稍后再试!

    确定
    "; pop_up_box(htmlvalue,580,30,50); $('#test-program-btn').show(); @@ -122,11 +92,9 @@ $(function(){ } ).fail(function(xhr, status){ if(status == 'timeout'){ -// alert("您的答案超时了, 请检查代码是否存在死循环的错误."); var htmlvalue = "
    您的答案超时了, 请检查代码是否存在死循环的错误!

    确定
    "; pop_up_box(htmlvalue,580,30,50); } else { -// alert("对不起,服务器繁忙请稍后再试!"); var htmlvalue = "
    对不起,服务器繁忙请稍后再试!

    确定
    "; pop_up_box(htmlvalue,580,30,50); } @@ -146,11 +114,6 @@ $(function(){ return; } if($('.ProResult .ProResultTop').length<=0){ -// var r=confirm("测试后才能提交,是否立刻测试?"); -// if (r) { -// test_program(); -// } - var htmlvalue = "
    测试后才能提交,是否立刻测试?

    确定取消
    "; pop_up_box(htmlvalue,580,30,50); $("#code-test-button").on('click',function(){ @@ -162,10 +125,6 @@ $(function(){ if (!tested) { test_program(function(data){ if (data.status!=0) { -// var r=confirm("测试不通过,是否强制提交?"); -// if (!r) { -// return; -// } var htmlvalue = "
    测试不通过,是否强制提交?

    确定取消
    "; pop_up_box(htmlvalue,580,30,50); return; From 0e016eed2a3bcd1704ea9093ab2da9075f267cd3 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Wed, 18 May 2016 14:15:39 +0800 Subject: [PATCH 7/9] =?UTF-8?q?KE=E4=B8=8A=E4=BC=A0=E9=9D=9E=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=A0=BC=E5=BC=8F=E6=97=B6=E5=BC=B9=E6=A1=86=E7=94=A8?= =?UTF-8?q?=E6=96=B0=E7=9A=84,=E5=8D=9A=E5=AE=A2=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E5=8F=91=E5=B8=96=E6=97=B6=E9=97=B4=E6=94=B9=E4=B8=BA=E5=8F=91?= =?UTF-8?q?=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/blogs/_article.html.erb | 2 +- public/assets/kindeditor/kindeditor.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/blogs/_article.html.erb b/app/views/blogs/_article.html.erb index 77aa3f9d8..550b1e4ef 100644 --- a/app/views/blogs/_article.html.erb +++ b/app/views/blogs/_article.html.erb @@ -43,7 +43,7 @@ <% count=activity.children.count%> <% end %>
  • - 发帖:<%= format_time(activity.created_on) %> + 发布:<%= format_time(activity.created_on) %> 更新:<%= format_time(activity.updated_on) %>

    <%= count>0 ? "#{count}" :"0" %> diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 12db483b8..c86a9ccd3 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -5694,7 +5694,9 @@ _plugin('core', function(K) { } } else { //alert(data.message); - alert("仅支持如下图片格式:bmp,jpeg,jpg,png,gif,BMP,JPEG,JPG,PNG,GIF"); +// alert("仅支持如下图片格式:bmp,jpeg,jpg,png,gif,BMP,JPEG,JPG,PNG,GIF"); + var htmlvalue = "

    仅支持如下图片格式:bmp,jpeg,jpg,png,gif,BMP,JPEG,JPG,PNG,GIF!

    确定
    "; + pop_up_box(htmlvalue,580,30,50); } }, afterError : function(str) { From 52724bd9ed05b1896b6ca8ac1617fd1211bcd4a5 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Wed, 18 May 2016 15:11:53 +0800 Subject: [PATCH 8/9] =?UTF-8?q?KE=20ol=20ul=E6=A0=87=E7=AD=BE=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0margin-bottom:0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/plugins/code/previewcode.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/kindeditor/plugins/code/previewcode.css b/public/assets/kindeditor/plugins/code/previewcode.css index 15951ce98..65c75d6ea 100644 --- a/public/assets/kindeditor/plugins/code/previewcode.css +++ b/public/assets/kindeditor/plugins/code/previewcode.css @@ -53,4 +53,4 @@ span.at a{color:#269ac9;text-decoration: none;} /*yk*/ .ke-content ol li{list-style-type: decimal;} .ke-content ul li{list-style-type: disc;} -ol,ul{margin-top:0;} \ No newline at end of file +.ke-content ol,.ke-content ul{margin-top:0;margin-bottom: 0;} \ No newline at end of file From c208b79e2dea9d86e45afef7119de891bcba27b3 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Wed, 18 May 2016 16:23:28 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=B8=8A=E9=9D=A2=E7=9A=84=E8=AF=AD=E8=A8=80=E5=8F=B3=E8=BE=B9?= =?UTF-8?q?=20=E5=8A=A0=E4=B8=8A=E7=BC=96=E8=AF=91=E5=99=A8=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/new_user_commit_homework.html.erb | 9 +++++++++ app/views/users/user_commit_homework.html.erb | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/app/views/users/new_user_commit_homework.html.erb b/app/views/users/new_user_commit_homework.html.erb index 4d2a091eb..99789172b 100644 --- a/app/views/users/new_user_commit_homework.html.erb +++ b/app/views/users/new_user_commit_homework.html.erb @@ -92,6 +92,15 @@
    请使用 <%= @homework.language_name %> 语言编写 + <% if @homework.language.to_i == 1 %> + 编译器信息:gcc version "4.4.7" 20120313 (Red Hat 4.4.7-11) (GCC) + <% elsif @homework.language.to_i == 2 %> + 编译器信息:gcc version "4.4.7" 20120313 (Red Hat 4.4.7-11) (GCC) + <% elsif @homework.language.to_i == 3 %> + 编译器信息:Python version "2.6.6" + <% elsif @homework.language.to_i == 4 %> + 编译器信息:java version "1.7.0_85" OpenJDK Runtime Environment + <% end %> style="display-hidden" id="data-language">
    diff --git a/app/views/users/user_commit_homework.html.erb b/app/views/users/user_commit_homework.html.erb index 6df6f2115..043886779 100644 --- a/app/views/users/user_commit_homework.html.erb +++ b/app/views/users/user_commit_homework.html.erb @@ -75,6 +75,15 @@
    请使用 <%= @homework.language_name %> 语言编写 + <% if @homework.language.to_i == 1 %> + 编译器信息:gcc version "4.4.7" 20120313 (Red Hat 4.4.7-11) (GCC) + <% elsif @homework.language.to_i == 2 %> + 编译器信息:gcc version "4.4.7" 20120313 (Red Hat 4.4.7-11) (GCC) + <% elsif @homework.language.to_i == 3 %> + 编译器信息:Python version "2.6.6" + <% elsif @homework.language.to_i == 4 %> + 编译器信息:java version "1.7.0_85" OpenJDK Runtime Environment + <% end %>
    <%= f.text_area :name, id: 'program-title', class:"InputBox W700", placeholder:"请概括你的代码的功能" %>