对于编程作业,系统评分的前几名能否也显示出来
This commit is contained in:
parent
947e6ea469
commit
fd8b40a36e
|
@ -128,7 +128,7 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if activity.student_works.count != 0 %>
|
<% if activity.student_works.count != 0 %>
|
||||||
<% sw = activity.student_works.reorder("created_at desc").first %>
|
<% sw = activity.student_works.reorder("created_at desc").first %>
|
||||||
<div class="mt10 homepagePostDeadline">
|
<div class="mt10 homepagePostDeadline mb10">
|
||||||
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -139,12 +139,19 @@
|
||||||
<%# student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
|
<%# student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
|
||||||
<% unless student_work_scores.empty? %>
|
<% unless student_work_scores.empty? %>
|
||||||
<% last_score = student_work_scores.first %>
|
<% last_score = student_work_scores.first %>
|
||||||
<div class="mt10">
|
<div>
|
||||||
<p class="mb10 fontGrey2"># <%=time_from_now last_score.created_at %>
|
<p class="mb10 fontGrey2"># <%=time_from_now last_score.created_at %>
|
||||||
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
||||||
</p>
|
</p>
|
||||||
<% ids = '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
<% if activity.homework_type != 2 %>
|
||||||
|
<% ids = student_work_scores.empty? ? "(-1)" : '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
||||||
<% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where("student_works.id in #{ids}").order("score desc") %>
|
<% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where("student_works.id in #{ids}").order("score desc") %>
|
||||||
|
<% else %>
|
||||||
|
<% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("score desc") %>
|
||||||
|
<% end %>
|
||||||
<% student_works.each_with_index do |sw, i| %>
|
<% student_works.each_with_index do |sw, i| %>
|
||||||
<div class="fl mr10 w100" style="text-align:center;">
|
<div class="fl mr10 w100" style="text-align:center;">
|
||||||
<a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %>
|
<a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %>
|
||||||
|
@ -163,7 +170,6 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
|
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
|
||||||
<% projects = activity.student_work_projects.where("is_leader = 1") %>
|
<% projects = activity.student_work_projects.where("is_leader = 1") %>
|
||||||
|
|
|
@ -128,7 +128,7 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if activity.student_works.count != 0 %>
|
<% if activity.student_works.count != 0 %>
|
||||||
<% sw = activity.student_works.reorder("created_at desc").first %>
|
<% sw = activity.student_works.reorder("created_at desc").first %>
|
||||||
<div class="mt10 homepagePostDeadline">
|
<div class="mt10 homepagePostDeadline mb10">
|
||||||
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -138,12 +138,19 @@
|
||||||
<% student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %>
|
<% student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %>
|
||||||
<% unless student_work_scores.empty? %>
|
<% unless student_work_scores.empty? %>
|
||||||
<% last_score = student_work_scores.first %>
|
<% last_score = student_work_scores.first %>
|
||||||
<div class="mt10">
|
<div>
|
||||||
<p class="mb10 fontGrey2"># <%=time_from_now last_score.created_at %>
|
<p class="mb10 fontGrey2"># <%=time_from_now last_score.created_at %>
|
||||||
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
||||||
</p>
|
</p>
|
||||||
<% ids = '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
<% if activity.homework_type != 2 %>
|
||||||
|
<% ids = student_work_scores.empty? ? "(-1)" : '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
||||||
<% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where("student_works.id in #{ids}").order("score desc") %>
|
<% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where("student_works.id in #{ids}").order("score desc") %>
|
||||||
|
<% else %>
|
||||||
|
<% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("score desc") %>
|
||||||
|
<% end %>
|
||||||
<% student_works.each_with_index do |sw, i| %>
|
<% student_works.each_with_index do |sw, i| %>
|
||||||
<div class="fl mr10 w100" style="text-align:center;">
|
<div class="fl mr10 w100" style="text-align:center;">
|
||||||
<a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %>
|
<a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %>
|
||||||
|
@ -162,7 +169,6 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
|
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
|
||||||
<% projects = activity.student_work_projects.where("is_leader = 1") %>
|
<% projects = activity.student_work_projects.where("is_leader = 1") %>
|
||||||
|
|
|
@ -131,7 +131,7 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if homework_common.student_works.count != 0 %>
|
<% if homework_common.student_works.count != 0 %>
|
||||||
<% sw = homework_common.student_works.reorder("created_at desc").first %>
|
<% sw = homework_common.student_works.reorder("created_at desc").first %>
|
||||||
<div class="mt10 homepagePostDeadline">
|
<div class="mt10 homepagePostDeadline mb10">
|
||||||
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -142,12 +142,19 @@
|
||||||
<%# student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
|
<%# student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
|
||||||
<% unless student_work_scores.empty? %>
|
<% unless student_work_scores.empty? %>
|
||||||
<% last_score = student_work_scores.first %>
|
<% last_score = student_work_scores.first %>
|
||||||
<div class="mt10">
|
<div>
|
||||||
<p class="mb10 fontGrey2"># <%=time_from_now last_score.created_at %>
|
<p class="mb10 fontGrey2"># <%=time_from_now last_score.created_at %>
|
||||||
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
||||||
</p>
|
</p>
|
||||||
<% ids = '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
<% if homework_common.homework_type != 2 %>
|
||||||
|
<% ids = student_work_scores.empty? ? "(-1)" : '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
||||||
<% student_works = homework_common.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where("student_works.id in #{ids}").order("score desc") %>
|
<% student_works = homework_common.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where("student_works.id in #{ids}").order("score desc") %>
|
||||||
|
<% else %>
|
||||||
|
<% student_works = homework_common.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("score desc") %>
|
||||||
|
<% end %>
|
||||||
<% student_works.each_with_index do |sw, i| %>
|
<% student_works.each_with_index do |sw, i| %>
|
||||||
<div class="fl mr10 w100" style="text-align:center;">
|
<div class="fl mr10 w100" style="text-align:center;">
|
||||||
<a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => homework_common.id), :alt => "学生头像" %>
|
<a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => homework_common.id), :alt => "学生头像" %>
|
||||||
|
@ -166,7 +173,6 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 %>
|
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 %>
|
||||||
<% projects = homework_common.student_work_projects.where("is_leader = 1") %>
|
<% projects = homework_common.student_work_projects.where("is_leader = 1") %>
|
||||||
|
|
Loading…
Reference in New Issue