+
+
+
+ <%= image_tag(url_to_avatar(homework.user), :class => "avatar")%> |
+
+
+
+
+ <%= link_to (is_teacher ? homework.user.realname : homework.user ), user_path(homework.user)%>
+
+ |
+
+
+
+ <% if (users_for_homework(homework).include?(User.current) || is_teacher) %>
+ <%= link_to l(:button_edit), edit_homework_attach_path(homework) %>
+ <% if homework.user == User.current || is_teacher %>
+ <%= link_to(l(:label_bid_respond_delete), homework,
+ method: :delete, :confirm => l(:text_are_you_sure)) %>
+ <% end %>
+ <% end %>
+ |
+
+
+
+ |
+
+
- 作业 :
+ 作业名称:
<% if homework.name == nil || homework.name == "" %>
- <% attachments = homework.attachments.map %>
- <% for attachment in attachments %>
- <% if attachments.count > 1 %>
- <% homework_filename = attachment.filename + "等" + attachments.count.to_s + "个文件" %>
- <% else %>
- <% homework_filename = attachment.filename %>
- <% end %>
- <% end %>
+ <% homework_filename = homework.user.name + "提交的作业" %>
<% else %>
<% homework_filename = homework.name %>
<% end %>
- <% if is_evaluation || is_teacher%>
- <%= link_to homework_filename, :controller => "zipdown", :action => "download_user_homework",:homework => homework%>
+ <%= link_to homework_filename , homework_attach_path(homework)%>
+
+ |
+
+ 参与人员:
+ <% homework_users = "" %>
+ <% homework.users.each do |user| %>
+ <% homework_users = homework_users + (is_teacher ? user.realname : user.name) %>
+ <% if user != homework.users.last %>
+ <% homework_users = homework_users + "、" %>
+ <% end %>
+ <% end %>
+ <% if homework.users.count == 0 %>
+ 无
<% else %>
- <%= homework_filename %>
+ <%= homework_users %>
<% end %>
-
|
-
- <% if is_student %>
- <% if is_evaluation %>
- <%= link_to "互评>>" , homework_attach_path(homework)%>
+ |
+ <% if Time.parse(@bid.deadline.to_s) < Time.parse(homework.created_at.to_s) %>
+ 迟交
+ <% end %>
+ |
+
+
+
+
+ 开发项目:
+ <% if homework.project != nil %>
+ <%= link_to homework.project.name,project_path(homework.project.id)%>
+ <% else %>
+ 该作业暂无项目
+ <% end %>
+ |
+
+ 项目得分:
+
+ <% if homework.project != nil %>
+ 0分
<% else %>
- <%= link_to "查看详细" , homework_attach_path(homework)%>
+ 0分
<% end %>
- <% else %>
- <% if is_teacher %>
- <%= link_to "综评>>" , homework_attach_path(homework)%>
+
+ |
+
+
+
+
+ 提交文件:
+ <% if is_evaluation %>
+ <%= link_to "打包下载", :controller => "zipdown", :action => "download_user_homework",:homework => homework%>
+ <% else %>
+ 未开启互评功能作业不允许下载
+ <% end %>
+
+ |
+
+ 互评得分:
+ <%= student_score_for_homework(homework) %>分
+ <% if is_evaluation && is_student && (!users_for_homework(homework).include? User.current)%>
+ <%= link_to "学生互评>>",homework_attach_path(homework) %>
<% end %>
- <% end %>
+
|
+
-
- 发布人: <%= link_to ( is_teacher ? homework.user.realname : homework.user ), user_path(homework.user)%>
+ |
+ <% if is_evaluation %>
+ <%= render :partial => 'app_link', :locals => {:attachments => homework.attachments} %>
+ <% end %>
|
- 作业评分:
-
- <%= format("%.2f", homework.rate_averages.first.try(:avg).to_f ) %>
- |
-
- <% if Time.parse(@bid.deadline.to_s) < Time.parse(homework.created_at.to_s) %>
- 迟交
- <% end %>
- |
-
-
-
- <% if User.current.member_of?(@bid.courses.first) %>
- <%= l(:label_bidding_user_studentcode) %> : <%= homework.user.student_id%>
+ 综评得分:
+ <%= score_for_homework homework %>分
+ <% if is_teacher %>
+ <%= link_to "教师评分>>",homework_attach_path(homework) %>
<% end %>
- |
-
- <% if (users_for_homework(homework).include?(User.current) || is_teacher) %>
- <%= link_to l(:button_edit), edit_homework_attach_path(homework) %>
- <% if homework.user == User.current || is_teacher %>
- <%= link_to(l(:label_bid_respond_delete), homework,
- method: :delete, :confirm => l(:text_are_you_sure)) %>
- <% end %>
- <% end %>
+
|
diff --git a/app/views/homework_attach/_comprehensive_evaluation.html.erb b/app/views/homework_attach/_comprehensive_evaluation.html.erb
index 08db30542..786659d95 100644
--- a/app/views/homework_attach/_comprehensive_evaluation.html.erb
+++ b/app/views/homework_attach/_comprehensive_evaluation.html.erb
@@ -1,23 +1,9 @@
<% is_teacher = is_course_teacher User.current,homework.bid.courses.first %>
<% if comprehensive_evaluation != nil && comprehensive_evaluation.count > 0 %>
- <% stars = homework.rates(:quality).where("rater_id = #{comprehensive_evaluation.first.user.id}").select("stars").first %>
作业综评:
-
-
- <% if stars != nil %>
-
- <% else %>
-
- <% end %>
-
-
-
-
-
+ <%= render :partial => 'show_score', locals: {:stars => teaher_score} %>
<%= comprehensive_evaluation.first.notes%>
diff --git a/app/views/homework_attach/_show_score.html.erb b/app/views/homework_attach/_show_score.html.erb
new file mode 100644
index 000000000..7c2403e10
--- /dev/null
+++ b/app/views/homework_attach/_show_score.html.erb
@@ -0,0 +1,14 @@
+
+
+ <% if stars != nil %>
+
+ <% else %>
+
+ <% end %>
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/homework_attach/new.html.erb b/app/views/homework_attach/new.html.erb
index c74d17bdd..46ab0ce88 100644
--- a/app/views/homework_attach/new.html.erb
+++ b/app/views/homework_attach/new.html.erb
@@ -23,7 +23,7 @@
:bid_id => @bid
}) do |f|%>
- 标 题:
+ 标 题:
<%= f.text_field "name", :required => true, :size => 60, :style => "width:490px;" %>
@@ -33,7 +33,7 @@
提交项目可以为空
- 描 述:
+ 描 述:
<%= f.text_area "description", :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>
diff --git a/app/views/homework_attach/show.html.erb b/app/views/homework_attach/show.html.erb
index 4ab6141dc..915485fee 100644
--- a/app/views/homework_attach/show.html.erb
+++ b/app/views/homework_attach/show.html.erb
@@ -49,7 +49,7 @@
平均评分:
- <%= rating_for @homework, :static => true, dimension: :quality, class: 'rateable div_inline' %>
+ <%= render :partial => 'show_score', :locals => {:stars => @totle_score} %>
|
发布时间:<%=format_time @homework.created_at %> |
@@ -110,17 +110,12 @@
- <% score = @homework.average(:quality).try(:avg).try(:round, 2).to_s %>
最终得分
- <% if score == "" %>
- 0分
- <% else %>
- <%= score %>分
- <% end %>
+ <%= @totle_score %>分
- <%= rating_for @homework, :static => true, dimension: :quality, class: 'rateable div_inline' %>
+ <%= render :partial => 'show_score', :locals => {:stars => @totle_score} %>
@@ -137,7 +132,7 @@
- <%= render :partial => 'comprehensive_evaluation', :locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework} %>
+ <%= render :partial => 'comprehensive_evaluation', :locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework, :teaher_score => @teaher_score} %>
|