分组作业关联项目提示

This commit is contained in:
Tim 2016-10-21 17:12:05 +08:00
parent f6e86866cb
commit 6b6584d764
1 changed files with 94 additions and 75 deletions

View File

@ -1,75 +1,94 @@
<div class="sy_courses_open f14 fontGrey3">
<span class="icons_sy_open fl mr5" title="点击展开/收起详情" style="cursor: pointer;"></span>
<span class="fl" style="width:280px;">
<span class="hidden fl" style="max-width:220px;"><%=student_work.name %></span>
<span class="fontGrey2 ml5 fl">
<% if student_work.work_status%>
<%=get_status student_work.work_status %>
<% end %>
</span>
</span>
<% if @homework.homework_detail_group.base_on_project == 1 %>
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
<%= link_to student_work.project.name, project_path(student_work.project.id), :class => 'link-blue fr hidden', :style => "max-width:200px;", :title => "项目名称"%>
<% else %>
<span class="fontBlue fr hidden" style="max-width:200px;" title="该项目是私有的"><%= student_work.project.name %></span>
<% end %>
<span class="fr">关联项目:</span>
<% end %>
<div class="cl"></div>
</div>
<div class="fl sy_p_grey">
<span class="fl" style="width:255px;">提交时间:<%=format_date(student_work.commit_time) %></span>
<div class="flex-container fl" style="width:376px;">
<div class="flex-cell">教师:<span class="<%= score_color student_work.teacher_score%>"><%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%></span></div>
<div class="flex-cell">助教:<span class="<%= score_color student_work.teaching_asistant_score%>"><%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%></span></div>
<% if @homework.anonymous_comment == 0 %>
<div class="flex-cell">匿评:
<div class="<%= score_color student_work.student_score%> student_score_info pr" style="display: inline">
<% if student_work.student_score.nil? %>
<span title="该作品未被匿评">未参与</span>
<% else %>
<%= format("%.1f", student_work.student_score) %>
<% end %>
<% unless student_work.student_score.nil? %>
<span class="linkBlue">
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>)
</span>
<div class="g_infoNi none">
现共有
<span class="c_red">&nbsp;<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>&nbsp;</span>
名学生进行了匿评,平均分为
<span class="c_red">&nbsp;<%= format("%.1f", student_work.student_score) %>&nbsp;</span>分。
</div>
<% end %>
</div>
</div>
<% end %>
<div class="flex-cell">成绩:
<% score = student_work.work_score %>
<div class="<%= score_color score%> student_final_scor_info pr" style="display: inline">
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
<% unless score.nil?%>
<div class="score-tip none tl" style="top:-48px; right:-229px;">
<em></em>
<font></font>
作品最终评分为
<span class="c_red">&nbsp;<%= student_work.final_score%>&nbsp;</span>分。<br/>
迟交扣分
<span class="c_red">&nbsp;
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
&nbsp;</span>分,<br/>
缺评扣分
<span class="c_red">&nbsp;
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%>
&nbsp;</span>分,<br/>
最终成绩为
<span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分。
</div>
<% end%>
</div>
</div>
</div>
<a href="javascript:void(0)" onclick="show_student_work('<%= student_work_path(student_work)%>');" class="link-blue fr ml5" style="width:28px; text-align:right;">评分</a>
</div>
<div class="cl"></div>
<div class="sy_courses_open f14 fontGrey3">
<span class="icons_sy_open fl mr5" title="点击展开/收起详情" style="cursor: pointer;"></span>
<span class="fl" style="width:280px;">
<span class="hidden fl" style="max-width:220px;"><%=student_work.name %></span>
<span class="fontGrey2 ml5 fl">
<% if student_work.work_status%>
<%=get_status student_work.work_status %>
<% end %>
</span>
</span>
<% if @homework.homework_detail_group.base_on_project == 1 %>
<div class="pr fr projectName">
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
<%= link_to student_work.project.name, project_path(student_work.project.id), :class => 'link-blue fr hidden', :style => "max-width:200px;", :title => "项目名称"%>
<% else %>
<span class="fontBlue fr hidden" style="max-width:200px;" title="该项目是私有的"><%= student_work.project.name %></span>
<% end %>
<div class="score-tip none tl f12" style="width:300px; top:-48px; right:-362px;">
<em style="bottom:45px;"></em>
<font style="bottom:45px;"></font>
<p class="fb"><%= student_work.project.name %></p>
<p class="mb10"><span class="mr15">创建者:刘逸舟</span><span>成员数量5</span></p>
<p>项目综合得分106703</p>
<p>= 代码提交得分 + issue得分 + 资源得分 + 讨论区得分</p>
<p>= 67716 + 38679 + 80 + 20</p>
</div>
</div>
<span class="fr">关联项目:</span>
<% end %>
<div class="cl"></div>
</div>
<div class="fl sy_p_grey">
<span class="fl" style="width:255px;">提交时间:<%=format_date(student_work.commit_time) %></span>
<div class="flex-container fl" style="width:376px;">
<div class="flex-cell">教师:<span class="<%= score_color student_work.teacher_score%>"><%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%></span></div>
<div class="flex-cell">助教:<span class="<%= score_color student_work.teaching_asistant_score%>"><%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%></span></div>
<% if @homework.anonymous_comment == 0 %>
<div class="flex-cell">匿评:
<div class="<%= score_color student_work.student_score%> student_score_info pr" style="display: inline">
<% if student_work.student_score.nil? %>
<span title="该作品未被匿评">未参与</span>
<% else %>
<%= format("%.1f", student_work.student_score) %>
<% end %>
<% unless student_work.student_score.nil? %>
<span class="linkBlue">
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>)
</span>
<div class="g_infoNi none">
现共有
<span class="c_red">&nbsp;<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>&nbsp;</span>
名学生进行了匿评,平均分为
<span class="c_red">&nbsp;<%= format("%.1f", student_work.student_score) %>&nbsp;</span>分。
</div>
<% end %>
</div>
</div>
<% end %>
<div class="flex-cell">成绩:
<% score = student_work.work_score %>
<div class="<%= score_color score%> student_final_scor_info pr" style="display: inline">
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
<% unless score.nil?%>
<div class="score-tip none tl" style="top:-48px; right:-229px;">
<em></em>
<font></font>
作品最终评分为
<span class="c_red">&nbsp;<%= student_work.final_score%>&nbsp;</span>分。<br/>
迟交扣分
<span class="c_red">&nbsp;
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
&nbsp;</span>分,<br/>
缺评扣分
<span class="c_red">&nbsp;
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%>
&nbsp;</span>分,<br/>
最终成绩为
<span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分。
</div>
<% end%>
</div>
</div>
</div>
<a href="javascript:void(0)" onclick="show_student_work('<%= student_work_path(student_work)%>');" class="link-blue fr ml5" style="width:28px; text-align:right;">评分</a>
</div>
<div class="cl"></div>
<script>
$(".projectName").mouseenter(function(){
$(this).children().next().show();
}).mouseleave(function(){
$(this).children().next().hide();
});
</script>