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;}