<%= l(:label_task_plural)%>(<%= @homework_list.count%>)
<%= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), remote: false, class: "button_submit button_submit_font_white", style: "margin: 5px 10px;line-height: 20px;height: 20px;display: inline-block;" if(
- User.current.admin? ||
- !(User.current.roles_for_project(@bid.courses.first).map(&:id) & ([7,9])).empty? ) ||
+ User.current.admin? ||
+ !(User.current.roles_for_project(@bid.courses.first).map(&:id) & ([7,9])).empty? ) ||
(Rails.env.development?) %>
|
@@ -25,8 +27,8 @@
<% @homework_list.each do |homework|%>
<% if homework.attachments.any?%>
-
- <%= image_tag(url_to_avatar(homework.user), :class => "avatar")%> |
+
+ <%= image_tag(url_to_avatar(homework.user), :class => "avatar")%> |
@@ -44,8 +46,12 @@
<% end %>
- <% if display_id %>
+ <% if is_student %>
<%= link_to "互评>>" , homework_attach_path(homework)%>
+ <% else %>
+ <% if is_teacher %>
+ <%= link_to "综评>>" , homework_attach_path(homework)%>
+ <% end %>
<% end %>
|
@@ -71,7 +77,7 @@
- <% if display_id %>
+ <% if is_cur_course_user? @bid %>
<%= l(:label_bidding_user_studentcode) %> : <%= homework.user.user_extensions.student_id%>
<% end %>
|
diff --git a/app/views/homework_attach/_addjour.html.erb b/app/views/homework_attach/_addjour.html.erb
index a5e7bed66..6cb35bccc 100644
--- a/app/views/homework_attach/_addjour.html.erb
+++ b/app/views/homework_attach/_addjour.html.erb
@@ -56,6 +56,7 @@
:url => {:controller => 'homework_attach',
:action => 'addjours',
:jour_id => homework_attach.id,
+ :is_comprehensive_evaluation => is_comprehensive_evaluation,
:sta => sta}) do |f|%>
diff --git a/app/views/homework_attach/_comprehensive_evaluation.html.erb b/app/views/homework_attach/_comprehensive_evaluation.html.erb
new file mode 100644
index 000000000..df0c03b21
--- /dev/null
+++ b/app/views/homework_attach/_comprehensive_evaluation.html.erb
@@ -0,0 +1,50 @@
+<% 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.stars * 2 * 10 %>
+
+
+
+ <%= comprehensive_evaluation.first.notes%>
+
+ <% if is_teacher %>
+ 评分:
+ <%= rating_for homework, dimension: :quality, class: 'rateable div_inline' %>
+ (您可以重新打分,打分结果以最后一次打分为主!)
+
+ <% end %>
+
+<% else %>
+ <% if is_teacher %>
+
+
+ 作业综评:
+
+ 评分:
+ <%= rating_for homework, dimension: :quality, class: 'rateable div_inline' %>
+ (您可以重新打分,打分结果以最后一次打分为主!)
+
+
+ <%= render :partial => 'addjour', :locals => {:homework_attach => homework, :sta => 0,:is_comprehensive_evaluation => 1} %>
+
+
+ <% else %>
+
+
+ 作业综评:
+
+ 老师还未进行评价!
+
+ <% end %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/homework_attach/_showjour.html.erb b/app/views/homework_attach/_showjour.html.erb
index 939deff3b..529767138 100644
--- a/app/views/homework_attach/_showjour.html.erb
+++ b/app/views/homework_attach/_showjour.html.erb
@@ -38,10 +38,25 @@
<% if jour.size > 0 %>
<% for journal in jour%>
+ <% seems = homework.rates(:quality).where("rater_id = #{journal.user.id}").select("stars").first %>
-
<%= image_tag(url_to_avatar(journal.user), :class => "avatar") %>
- <%= link_to journal.user, user_path(journal.user)%>
+
+ <%= link_to journal.user, user_path(journal.user)%>
+
+
<% label = l(:label_contest_requirement) %>
<%= textilizable journal.notes%>
<%= l(:label_bids_published) %>
@@ -70,4 +85,12 @@
<% end %>
-<% end %>
\ No newline at end of file
+<% end %>
+
+
+
+
\ No newline at end of file
diff --git a/app/views/homework_attach/addjours.js.erb b/app/views/homework_attach/addjours.js.erb
index e463237e5..ed5887a7f 100644
--- a/app/views/homework_attach/addjours.js.erb
+++ b/app/views/homework_attach/addjours.js.erb
@@ -1,4 +1,9 @@
-$('#message').html('<%= escape_javascript(render(:partial => 'showjour', :locals => {:jour =>@jour, :state => false} )) %>');
-$('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
-$('#new_form_user_message').val("");
-$('#new_form_reference_user_id').val("");
\ No newline at end of file
+<% if @add_jour.is_comprehensive_evaluation == 1 %>
+ $('#comprehensive_evaluation').html('<%= escape_javascript(render(:partial => 'comprehensive_evaluation',
+ :locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework} )) %>');
+<% else %>
+ $('#message').html('<%= escape_javascript(render(:partial => 'showjour', :locals => {:jour =>@jour, :state => false,:homework => @homework} )) %>');
+ $('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
+ $('#new_form_user_message').val("");
+ $('#new_form_reference_user_id').val("");
+<% end %>
\ No newline at end of file
diff --git a/app/views/homework_attach/show.html.erb b/app/views/homework_attach/show.html.erb
index f2c37d9ac..9c39e84f1 100644
--- a/app/views/homework_attach/show.html.erb
+++ b/app/views/homework_attach/show.html.erb
@@ -6,6 +6,9 @@
height: 200px;
}
+<% is_student = is_cur_course_student? @homework.bid.courses.first %>
+<% is_teacher = is_course_teacher User.current,@homework.bid.courses.first %>
+
<%= notice %>
@@ -93,10 +96,14 @@
+ <% score = @homework.average(:quality).try(:avg).try(:round, 2).to_s %>
最终得分
- <%= @homework.average(:quality).try(:avg).try(:round, 2).to_s %>
- 分
+ <% if score == "" %>
+ 0分
+ <% else %>
+ <%= score %>分
+ <% end %>
<%= rating_for @homework, :static => true, dimension: :quality, class: 'rateable div_inline' %>
@@ -114,42 +121,32 @@
-
+
+ <%= render :partial => 'comprehensive_evaluation', :locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework} %>
-
--->
+
作业评论:
- 评分:
- <%= rating_for @homework, dimension: :quality, class: 'rateable div_inline' %>
- (您可以重新打分,打分结果以最后一次打分为主!)
-
-
+ <% if is_student %>
+ 评分:
+ <%= rating_for @homework, dimension: :quality, class: 'rateable div_inline' %>
+ (您可以重新打分,打分结果以最后一次打分为主!)
+
+ <% end %>
+<% if !is_teacher %>
-
- <%= render :partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0} %>
+
+ <%= render :partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0, :is_comprehensive_evaluation => nil} %>
+<% end %>
- <%= render :partial => 'showjour', :locals => {:jour => @jour} %>
-
-
-
-
diff --git a/db/migrate/20140527060344_add_coloum_to_homework_journals_for_message.rb b/db/migrate/20140527060344_add_coloum_to_homework_journals_for_message.rb
new file mode 100644
index 000000000..744a09d31
--- /dev/null
+++ b/db/migrate/20140527060344_add_coloum_to_homework_journals_for_message.rb
@@ -0,0 +1,5 @@
+class AddColoumToHomeworkJournalsForMessage < ActiveRecord::Migration
+ def change
+ add_column :journals_for_messages, :is_comprehensive_evaluation, :integer
+ end
+end
| |