Merge remote-tracking branch 'origin/szzh' into szzh

This commit is contained in:
lizanle 2015-07-04 09:35:16 +08:00
commit 0f9642e60b
4 changed files with 5 additions and 5 deletions

View File

@ -92,7 +92,7 @@ class HomeworkCommonController < ApplicationController
@homework.publish_time = params[:homework_common][:publish_time] @homework.publish_time = params[:homework_common][:publish_time]
@homework.homework_type = params[:homework_common][:homework_type] @homework.homework_type = params[:homework_common][:homework_type]
unless @homework.late_penalty == params[:late_penalty] unless @homework.late_penalty == params[:late_penalty]
@homework.student_works.where("created_at > #{@homework.end_time}").each do |student_work| @homework.student_works.where("created_at > '#{@homework.end_time} 23:59:59'").each do |student_work|
student_work.late_penalty = params[:late_penalty] student_work.late_penalty = params[:late_penalty]
student_work.save student_work.save
end end

View File

@ -278,7 +278,7 @@ class StudentWorkController < ApplicationController
work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")" work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")"
@stundet_works = StudentWork.find_by_sql("SELECT * FROM (SELECT *,(all_count - has_count) AS absence FROM( @stundet_works = StudentWork.find_by_sql("SELECT * FROM (SELECT *,(all_count - has_count) AS absence FROM(
SELECT * , SELECT * ,
(SELECT evaluation_num FROM homework_detail_manuals WHERE homework_detail_manuals.homework_common_id = #{@homework.id}) AS all_count, (SELECT COUNT(*) FROM `student_works_evaluation_distributions` WHERE user_id = student_works.user_id AND student_work_id IN #{work_ids}) AS all_count,
(SELECT COUNT(*) FROM `student_works_scores` WHERE user_id = student_works.user_id AND student_work_id IN #{work_ids}) AS has_count (SELECT COUNT(*) FROM `student_works_scores` WHERE user_id = student_works.user_id AND student_work_id IN #{work_ids}) AS has_count
FROM `student_works` FROM `student_works`
WHERE homework_common_id = #{@homework.id} WHERE homework_common_id = #{@homework.id}

View File

@ -1,5 +1,5 @@
<%= stylesheet_link_tag 'polls', :media => 'all' %> <%= stylesheet_link_tag 'polls', :media => 'all' %>
<div class="polls_content polls_box"> <div class="polls_content polls_box break_word">
<div class="ur_page_head" > <div class="ur_page_head" >
<h1 class="ur_page_title"> <h1 class="ur_page_title">
<%= @poll.polls_name.empty? ? l(:label_poll_new) : @poll.polls_name %> <%= @poll.polls_name.empty? ? l(:label_poll_new) : @poll.polls_name %>

View File

@ -52,7 +52,7 @@
缺评扣分 缺评扣分
<span class="c_red">&nbsp;<%= student_work.absence_penalty%>&nbsp;</span>分, <span class="c_red">&nbsp;<%= student_work.absence_penalty%>&nbsp;</span>分,
最终成绩为 最终成绩为
<span class="c_red">&nbsp;<%= score%>&nbsp;</span>分。 <span class="c_red">&nbsp;<%= format("%.1f",score)%>&nbsp;</span>分。
</div> </div>
<% else%> <% else%>
<!-- 非匿评作品不显示缺评扣分 --> <!-- 非匿评作品不显示缺评扣分 -->
@ -62,7 +62,7 @@
迟交扣分 迟交扣分
<span class="c_red">&nbsp;<%= student_work.late_penalty%>&nbsp;</span>分, <span class="c_red">&nbsp;<%= student_work.late_penalty%>&nbsp;</span>分,
最终成绩为 最终成绩为
<span class="c_red">&nbsp;<%= score%>&nbsp;</span>分。 <span class="c_red">&nbsp;<%= format("%.1f",score)%>&nbsp;</span>分。
</div> </div>
<% end%> <% end%>
<% end%> <% end%>