From acc3f6dadf38cc18a28fc05abb39bf35cf282046 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 2 Jul 2015 16:04:26 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=BF=9F=E4=BA=A4=E6=89=A3=E5=88=86=E3=80=81?= =?UTF-8?q?=E7=BC=BA=E8=AF=84=E6=89=A3=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/homework_common_helper.rb | 2 +- app/views/homework_common/_homework_common_form.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/homework_common_helper.rb b/app/helpers/homework_common_helper.rb index b9940f4be..465df62da 100644 --- a/app/helpers/homework_common_helper.rb +++ b/app/helpers/homework_common_helper.rb @@ -15,7 +15,7 @@ module HomeworkCommonHelper #教辅评分比例下拉框 def ta_proportion_option type = [] - i = 10 + i = 0 while i <= 100 option = [] option << i.to_s + "%" diff --git a/app/views/homework_common/_homework_common_form.html.erb b/app/views/homework_common/_homework_common_form.html.erb index fa45397f0..21ed8900c 100644 --- a/app/views/homework_common/_homework_common_form.html.erb +++ b/app/views/homework_common/_homework_common_form.html.erb @@ -47,7 +47,7 @@

基本规则设置(总分为100分)

\ No newline at end of file diff --git a/app/views/student_work/_student_work_title.html.erb b/app/views/student_work/_student_work_title.html.erb index 23e29b01b..0e4151065 100644 --- a/app/views/student_work/_student_work_title.html.erb +++ b/app/views/student_work/_student_work_title.html.erb @@ -36,8 +36,8 @@ <% end%>
  • - <%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "final_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%> - <% if @show_all && @order == "final_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "final_score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%> + <%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%> + <% if @show_all && @order == "score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%> <% end%>
  • \ No newline at end of file From 194ab98361ab0f2d9acba4fbd83902bd4934583c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 2 Jul 2015 17:44:58 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=88=91=E7=9A=84=E8=AF=84=E5=88=86?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 9a5e7c9fa..2815fc63e 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -21,7 +21,7 @@ class StudentWorkController < ApplicationController @stundet_works = search_homework_member @homework.student_works.select("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name end else #剩余情况: 学生 && 非匿评作业 如果未提交作品,只能看到自己的,提交了作品,能看到所有作品 - my_work = @homework.student_works.select("*,final_score - absence_penalty - late_penalty as score").where(:user_id => User.current.id) + my_work = @homework.student_works.select("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) if my_work.empty? @stundet_works = [] else From 1e12b680275f404c1499ea48cd69d7399cc8b17f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 3 Jul 2015 10:09:49 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E9=81=AE=E4=BD=8F=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 0d956819b..177e8202d 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -654,7 +654,7 @@ a.down_btn{ border:1px solid #CCC; color:#999; padding:0px 5px; font-size:12px; a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;} .fr{ float:right;} .li_min_search{ float:right; margin-right:-10px;} -.info_ni{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 110px;margin-top: 10px;} +.info_ni{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 200px;margin-top: 10px;} /*返回顶部*/ .to_top{width: 19px;height: 74px;position: fixed;top: 50px;right: 1px;color: white;background: #15bccf; line-height: 1.2; padding-top: 10px;padding-left: 5px;font-size: 14px;cursor: pointer;} .hwork_num_ab{ width:120px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;min-height: 1px;} From 642fa8dd5d4747531d2f38b3f6a711ccce46ba48 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 3 Jul 2015 10:47:10 +0800 Subject: [PATCH 7/8] =?UTF-8?q?1=E3=80=81=E7=BC=BA=E8=AF=84=E3=80=81?= =?UTF-8?q?=E8=BF=9F=E4=BA=A4=E6=89=A3=E5=88=86=202=E3=80=81=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E6=8F=90=E7=A4=BA=E6=A1=86=E3=80=81=E6=9C=80=E7=BB=88?= =?UTF-8?q?=E6=88=90=E7=BB=A9=E8=AE=A1=E7=AE=97=E6=8F=90=E7=A4=BA=E6=A1=86?= =?UTF-8?q?=203=E3=80=81=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 34 +++++++++++++++---- app/controllers/student_work_controller.rb | 1 + app/views/student_work/_student_work.html.erb | 27 ++++++++++++++- app/views/student_work/add_score.js.erb | 16 +++++++-- app/views/student_work/index.html.erb | 2 +- public/javascripts/course.js | 15 ++++++-- public/stylesheets/courses.css | 3 +- 7 files changed, 85 insertions(+), 13 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 86f555daa..6b33a38ec 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -91,15 +91,37 @@ class HomeworkCommonController < ApplicationController @homework.end_time = params[:homework_common][:end_time] @homework.publish_time = params[:homework_common][:publish_time] @homework.homework_type = params[:homework_common][:homework_type] - @homework.late_penalty = params[:late_penalty] + unless @homework.late_penalty == params[:late_penalty] + @homework.student_works.where("late_penalty != 0").each do |student_work| + student_work.late_penalty = params[:late_penalty] + student_work.save + end + @homework.late_penalty = params[:late_penalty] + end @homework.course_id = @course.id #匿评作业相关属性 - @homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6 - @homework_detail_manual.evaluation_start = params[:evaluation_start] - @homework_detail_manual.evaluation_end = params[:evaluation_end] - @homework_detail_manual.evaluation_num = params[:evaluation_num] - @homework_detail_manual.absence_penalty = params[:absence_penalty] + if @homework.homework_type == 1 + @homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6 + @homework_detail_manual.evaluation_start = params[:evaluation_start] + @homework_detail_manual.evaluation_end = params[:evaluation_end] + @homework_detail_manual.evaluation_num = params[:evaluation_num] + unless @homework_detail_manual.absence_penalty == params[:absence_penalty] + if @homework_detail_manual.comment_status == 3 #当前作业处于匿评结束状态,修改缺评扣分才会修改每个作品应扣分的值 + @homework.student_works.where("absence_penalty != 0").each do |student_work| + student_work.absence_penalty = student_work.absence_penalty / @homework_detail_manual.absence_penalty * params[:absence_penalty].to_i + student_work.save + end + end + @homework_detail_manual.absence_penalty = params[:absence_penalty] + end + else #不是匿评作业,缺评扣分为0分,每个作品的缺评扣分改为0分,防止某些作业在结束匿评之后改为普通作业 + @homework.student_works.where("absence_penalty != 0").each do |student_work| + student_work.late_penalty = 0 + student_work.save + end + @homework_detail_manual.absence_penalty = 0 + end @homework.save_attachments(params[:attachments]) render_attachment_warning_if_needed(@homework) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 2815fc63e..954ab733f 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -42,6 +42,7 @@ class StudentWorkController < ApplicationController end end @homework_commons = @course.homework_commons.order("created_at desc") + @homework_commons = @course.homework_commons.order("created_at desc") @score = @b_sort == "desc" ? "asc" : "desc" respond_to do |format| format.html diff --git a/app/views/student_work/_student_work.html.erb b/app/views/student_work/_student_work.html.erb index 302c513b1..6e4cc65f1 100644 --- a/app/views/student_work/_student_work.html.erb +++ b/app/views/student_work/_student_work.html.erb @@ -39,8 +39,33 @@ <% end%> <% score = student_work.respond_to?("score") ? student_work.score : student_work.final_score - student_work.absence_penalty - student_work.late_penalty%> -
  • +
  • <%= score.nil? ? "--" : format("%.1f",score)%> + <% unless score.nil?%> + <% if @homework.homework_type == 1%> + +
    + 作品最终评分为 +  <%= student_work.final_score%> 分。 + 迟交扣分 +  <%= student_work.late_penalty%> 分, + 缺评扣分 +  <%= student_work.absence_penalty%> 分, + 最终成绩为 +  <%= score%> 分。 +
    + <% else%> + +
    + 作品最终评分为 +  <%= student_work.final_score%> 分。 + 迟交扣分 +  <%= student_work.late_penalty%> 分, + 最终成绩为 +  <%= score%> 分。 +
    + <% end%> + <% end%>
  • \ No newline at end of file diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb index 0ba275d5d..4474ab3b5 100644 --- a/app/views/student_work/add_score.js.erb +++ b/app/views/student_work/add_score.js.erb @@ -16,14 +16,26 @@ $("#score_list_<%= @work.id%>").removeAttr("style"); $(function(){ + //匿评评分提示 $(".student_score_info").bind("mouseover",function(e){ //alert($(this).html()); $(this).find("div").show(); - $(this).find("div").css("top",e.pageY); - $(this).find("div").css("left",e.pageX); +// $(this).find("div").css("top",e.pageY); +// $(this).find("div").css("left",e.pageX); }); $(".student_score_info").bind("mouseout",function(e){ //alert($(this).html()); $(this).find("div").hide(); }); + //最终成绩提示 + $(".student_final_scor_info").bind("mouseover",function(e){ + //alert($(this).html()); + $(this).find("div").show(); +// $(this).find("div").css("top",e.pageY); +// $(this).find("div").css("left",e.pageX); + }); + $(".student_final_scor_info").bind("mouseout",function(e){ + //alert($(this).html()); + $(this).find("div").hide(); + }); }); diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 167829ec3..c5bc5858d 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -60,7 +60,7 @@ <%= link_to "附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json), remote: true, class: "down_btn fr zip_download_alert", :id => "download_homework_attachments" %> <% end%> -
    +
    使用 winzip 工具进行解压可能会导致 diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 172e630f0..c8e3b533e 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -788,13 +788,24 @@ $(function(){ $(".student_score_info").bind("mouseover",function(e){ //alert($(this).html()); $(this).find("div").show(); - $(this).find("div").css("top",e.pageY); - $(this).find("div").css("left",e.pageX); + //$(this).find("div").css("top",e.pageY); + //$(this).find("div").css("left",e.pageX); }); $(".student_score_info").bind("mouseout",function(e){ //alert($(this).html()); $(this).find("div").hide(); }); + //最终成绩提示 + $(".student_final_scor_info").bind("mouseover",function(e){ + //alert($(this).html()); + $(this).find("div").show(); + //$(this).find("div").css("top",e.pageY); + //$(this).find("div").css("left",e.pageX); + }); + $(".student_final_scor_info").bind("mouseout",function(e){ + //alert($(this).html()); + $(this).find("div").hide(); + }); $("#about_project label").eq(1).remove(); diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 177e8202d..c25821b80 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -654,7 +654,8 @@ a.down_btn{ border:1px solid #CCC; color:#999; padding:0px 5px; font-size:12px; a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;} .fr{ float:right;} .li_min_search{ float:right; margin-right:-10px;} -.info_ni{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 200px;margin-top: 10px;} +.info_ni_download{ width:100px; padding:5px;position: fixed;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 200px;margin-top: 10px;} +.info_ni{ width:100px; padding:5px;position: fixed;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 50px;margin-top: -5px;} /*返回顶部*/ .to_top{width: 19px;height: 74px;position: fixed;top: 50px;right: 1px;color: white;background: #15bccf; line-height: 1.2; padding-top: 10px;padding-left: 5px;font-size: 14px;cursor: pointer;} .hwork_num_ab{ width:120px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;min-height: 1px;} From d2b76e92f270942924f26ef379df2a781d65fd7e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 3 Jul 2015 10:55:22 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E5=B1=95=E5=BC=80=E5=90=8E=E6=88=90?= =?UTF-8?q?=E7=BB=A9=E5=BE=97=E5=88=86=E6=A1=86=E6=98=BE=E7=A4=BA=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index c25821b80..be0e4de71 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -654,8 +654,8 @@ a.down_btn{ border:1px solid #CCC; color:#999; padding:0px 5px; font-size:12px; a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;} .fr{ float:right;} .li_min_search{ float:right; margin-right:-10px;} -.info_ni_download{ width:100px; padding:5px;position: fixed;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 200px;margin-top: 10px;} -.info_ni{ width:100px; padding:5px;position: fixed;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 50px;margin-top: -5px;} +.info_ni_download{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 200px;margin-top: 10px;} +.info_ni{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 50px;margin-top: -5px;} /*返回顶部*/ .to_top{width: 19px;height: 74px;position: fixed;top: 50px;right: 1px;color: white;background: #15bccf; line-height: 1.2; padding-top: 10px;padding-left: 5px;font-size: 14px;cursor: pointer;} .hwork_num_ab{ width:120px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;min-height: 1px;}