parent
8fbbbe82e0
commit
e2c034dcef
|
@ -508,6 +508,7 @@ class BidsController < ApplicationController
|
||||||
WHERE table1.t_score IS NULL")
|
WHERE table1.t_score IS NULL")
|
||||||
@cur_type = 1
|
@cur_type = 1
|
||||||
else
|
else
|
||||||
|
m_score_null = @bid.comment_status == 2 ? "IS NOT NULL" : "IS NULL"
|
||||||
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM(SELECT homework_attaches.*,
|
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM(SELECT homework_attaches.*,
|
||||||
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN #{teachers}) AS t_score,
|
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN #{teachers}) AS t_score,
|
||||||
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN #{teachers}) AS s_score,
|
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN #{teachers}) AS s_score,
|
||||||
|
@ -515,7 +516,7 @@ class BidsController < ApplicationController
|
||||||
FROM homework_attaches
|
FROM homework_attaches
|
||||||
INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id
|
INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id
|
||||||
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY s_score DESC) AS table1
|
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY s_score DESC) AS table1
|
||||||
WHERE table1.m_score IS NULL")
|
WHERE table1.m_score #{m_score_null}")
|
||||||
@is_student_batch_homework = true
|
@is_student_batch_homework = true
|
||||||
@cur_type = 4
|
@cur_type = 4
|
||||||
end
|
end
|
||||||
|
|
|
@ -98,6 +98,7 @@ class HomeworkAttachController < ApplicationController
|
||||||
|
|
||||||
#获取学生匿评列表
|
#获取学生匿评列表
|
||||||
def get_student_batch_homework
|
def get_student_batch_homework
|
||||||
|
m_score_null = @bid.comment_status == 2 ? "IS NOT NULL" : "IS NULL"
|
||||||
@is_student_batch_homework = true
|
@is_student_batch_homework = true
|
||||||
teachers = find_course_teachers @course
|
teachers = find_course_teachers @course
|
||||||
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM(SELECT homework_attaches.*,
|
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM(SELECT homework_attaches.*,
|
||||||
|
@ -107,7 +108,7 @@ class HomeworkAttachController < ApplicationController
|
||||||
FROM homework_attaches
|
FROM homework_attaches
|
||||||
INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id
|
INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id
|
||||||
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY s_score DESC) AS table1
|
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY s_score DESC) AS table1
|
||||||
WHERE table1.m_score IS NULL")
|
WHERE table1.m_score #{m_score_null}")
|
||||||
@cur_page = params[:page] || 1
|
@cur_page = params[:page] || 1
|
||||||
@cur_type = 4
|
@cur_type = 4
|
||||||
@homework_list = paginateHelper all_homework_list,10
|
@homework_list = paginateHelper all_homework_list,10
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
<% else %>
|
<% else %>
|
||||||
<ul>
|
<ul>
|
||||||
<li id="tb_5" class="hovertab">
|
<li id="tb_5" class="hovertab">
|
||||||
<%= link_to "待评作品", get_student_batch_homework_homework_attach_index_path(:bid_id => @bid.id), {id: 'student_batch_homework',:remote => true}%>
|
<%= link_to @bid.comment_status == 2 ? "已评作品" : "待评作品", get_student_batch_homework_homework_attach_index_path(:bid_id => @bid.id), {id: 'student_batch_homework',:remote => true}%>
|
||||||
</li>
|
</li>
|
||||||
<li id="tb_6" class="normaltab">
|
<li id="tb_6" class="normaltab">
|
||||||
<%= link_to "我的作品", get_my_homework_homework_attach_index_path(:bid_id => @bid.id), {id: 'my_homework',:remote => true}%>
|
<%= link_to "我的作品", get_my_homework_homework_attach_index_path(:bid_id => @bid.id), {id: 'my_homework',:remote => true}%>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<%= link_to "(#{homework.attachments.count.to_s}个附件)", zipdown_download_user_homework_path(:homework => homework)%>
|
<%= link_to "(#{homework.attachments.count.to_s}个附件)", zipdown_download_user_homework_path(:homework => homework)%>
|
||||||
</li>
|
</li>
|
||||||
<li class="wscore">
|
<li class="wscore">
|
||||||
<% if !is_student_batch_homework %>
|
<% unless is_student_batch_homework %>
|
||||||
<%= l(:label_teacher_score)%>:
|
<%= l(:label_teacher_score)%>:
|
||||||
<span class="c_red">
|
<span class="c_red">
|
||||||
<%= homework.t_score.nil? ? l(:label_without_score) : format("%.2f",homework.t_score)%>
|
<%= homework.t_score.nil? ? l(:label_without_score) : format("%.2f",homework.t_score)%>
|
||||||
|
@ -33,9 +33,9 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li class="wscore">
|
<li class="wscore">
|
||||||
<%= l(:label_student_score)%>:
|
<%= is_student_batch_homework ? l(:label_my_score) : l(:label_student_score)%>:
|
||||||
<span class="c_red">
|
<span class="c_red">
|
||||||
<%= homework.s_score.nil? ? l(:label_without_score) : format("%.2f",homework.s_score) %>
|
<%= homework.s_score.nil? ? l(:label_without_score) : format("%.2f",(is_student_batch_homework ? homework.m_score : homework.s_score)) %>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<% if is_teacher %>
|
<% if is_teacher %>
|
||||||
|
|
|
@ -2185,3 +2185,4 @@ zh:
|
||||||
label_anonymous: 匿名
|
label_anonymous: 匿名
|
||||||
label_submit_comments: 提交评论
|
label_submit_comments: 提交评论
|
||||||
field_evaluation_num: 匿评分配数量
|
field_evaluation_num: 匿评分配数量
|
||||||
|
label_my_score: 我的评分
|
Loading…
Reference in New Issue