1.当作业未选定项目时,项目得分为灰色的N/A,选定了项目,项目得分为橘色的分数

2.当无人对作业进行互评、综评时,作业的互评、综评得分为灰色的N/A,有人进行评分则为橘色的分数
3.简化代码
This commit is contained in:
sw 2014-06-26 11:22:48 +08:00
parent 7702b746c6
commit 12087f40c7
1 changed files with 83 additions and 80 deletions

View File

@ -58,90 +58,93 @@
</td>
<td colspan="2">
<table width="580px" border="0" style="table-layout: fixed">
<tr>
<td style="width: 300px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<strong>作品名称:</strong>&nbsp;
<% if homework.name == nil || homework.name == "" %>
<% homework_filename = homework.user.name + "提交的作业" %>
<% else %>
<% homework_filename = homework.name %>
<% end %>
<strong title="<%=homework_filename%>">
<%= link_to homework_filename , homework_attach_path(homework)%>
</strong>
</td>
<td style="vertical-align: top;width: 200px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<strong>合作成员:&nbsp;</strong>
<% homework_users = homework_user_of_homework(homework,is_teacher) %>
<% if homework.users.count == 0 %>
<% else %>
<span title="<%= homework_users%>"><%= homework_users %></span>
<% end %>
</td>
<td rowspan="4" style="text-align: center;vertical-align: middle;width: 30px">
<% if Time.parse(@bid.deadline.to_s) < Time.parse(homework.created_at.to_s) %>
<span class="required">迟交</span>
<% end %>
</td>
</tr>
<tr>
<td style="width: 300px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<strong>作品名称:</strong>&nbsp;
<% if homework.name == nil || homework.name == "" %>
<% homework_filename = homework.user.name + "提交的作业" %>
<% else %>
<% homework_filename = homework.name %>
<% end %>
<strong title="<%=homework_filename%>">
<%= link_to homework_filename , homework_attach_path(homework)%>
</strong>
</td>
<td style="vertical-align: top;width: 200px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<strong>合作成员:&nbsp;</strong>
<% homework_users = homework_user_of_homework(homework,is_teacher) %>
<% if homework.users.count == 0 %>
<% else %>
<span title="<%= homework_users%>"><%= homework_users %></span>
<% end %>
</td>
<td rowspan="4" style="text-align: center;vertical-align: middle;width: 30px">
<% if Time.parse(@bid.deadline.to_s) < Time.parse(homework.created_at.to_s) %>
<span class="required">迟交</span>
<% end %>
</td>
</tr>
<tr>
<td>
<strong>开发项目</strong>:&nbsp;
<% if homework.project != nil %>
<%= link_to homework.project.name,project_path(homework.project.id)%>
<% else %>
暂无
<% end %>
</td>
<td>
<strong>项目得分:&nbsp;
<span style="color: #EC6300;">
<% if homework.project != nil %>
<%= project_score homework.project %>
<% else %>
0.00
<% end %>
</span>
</strong>
</td>
</tr>
<tr>
<td>
<strong>提交文件:&nbsp;
<% if is_evaluation || is_teacher%>
<%= link_to "打包下载", :controller => "zipdown", :action => "download_user_homework",:homework => homework%>
<% else %>
<span class="required">未开启互评功能作业不允许下载</span>
<% end %>
</strong>
</td>
<td>
<strong>互评得分:&nbsp;
<span style="color: #EC6300;"><%= student_score_for_homework(homework) %></span>&nbsp;&nbsp;
<% if is_evaluation && is_student && (!users_for_homework(homework).include? User.current)%>
<%= link_to "学生互评>>",homework_attach_path(homework) %>
<% end %>
</strong>
</td>
</tr>
<tr>
<td>
<strong>开发项目</strong>:&nbsp;
<% if homework.project != nil %>
<%= link_to homework.project.name,project_path(homework.project.id)%>
<% else %>
暂无
<% end %>
</td>
<td>
<strong>项目得分:&nbsp;
<span style="color: <%= homework.project.nil? ? "#727272" : "#EC6300"%>;">
<%= homework.project.nil? ? "N/A" : project_score(homework.project) %>
</span>
</strong>
</td>
</tr>
<tr>
<td>
<strong>提交文件:&nbsp;
<% if is_evaluation || is_teacher%>
<%= link_to "打包下载", :controller => "zipdown", :action => "download_user_homework",:homework => homework%>
<% else %>
<span class="required">未开启互评功能作业不允许下载</span>
<% end %>
</strong>
</td>
<td>
<strong>互评得分:&nbsp;
<% student_homework_score = student_score_for_homework(homework) %>
<span style="color:<%= student_homework_score == "0.00"? "#727272" : "#EC6300"%>;">
<% score = student_homework_score == "0.00"? "N/A" : student_homework_score %>
<%= score %>
</span>&nbsp;&nbsp;
<% if is_evaluation && is_student && (!users_for_homework(homework).include? User.current)%>
<%= link_to "学生互评>>",homework_attach_path(homework) %>
<% end %>
</strong>
</td>
</tr>
<tr>
<td style="vertical-align: top;width: 200px;">
<% if is_evaluation || is_teacher%>
<%= render :partial => 'app_link', :locals => {:attachments => homework.attachments} %>
<% end %>
</td>
<td>
<strong>终评得分:&nbsp;
<span style="color: #EC6300;"><%= score_for_homework homework %></span>&nbsp;&nbsp;
<% if is_teacher %>
<%= link_to "教师评分>>",homework_attach_path(homework) %>
<% end %>
</strong>
</td>
<% if is_evaluation || is_teacher%>
<%= render :partial => 'app_link', :locals => {:attachments => homework.attachments} %>
<% end %>
</td>
<td>
<strong>终评得分:&nbsp;
<% totle_homework_score = score_for_homework(homework) %>
<span style="color:<%= totle_homework_score == "0.00"? "#727272" : "#EC6300"%> ;">
<% score = totle_homework_score == "0.00"? "N/A" : totle_homework_score %>
<%= score %>
</span>&nbsp;&nbsp;
<% if is_teacher %>
<%= link_to "教师评分>>",homework_attach_path(homework) %>
<% end %>
</strong>
</td>
</tr>
</table>
</td>