From 2628ab48082e1ad618d3ddc9e7dbe2762d0ef79b Mon Sep 17 00:00:00 2001
From: z9hang
Date: Mon, 3 Nov 2014 11:01:17 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=84=E5=88=86?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/homework_attach_controller.rb | 18 ++++++++++++++----
app/helpers/homework_attach_helper.rb | 15 +++++++++++++++
app/views/homework_attach/_show.html.erb | 12 ++++++------
3 files changed, 35 insertions(+), 10 deletions(-)
diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb
index 390c4620b..a2c2ce5bc 100644
--- a/app/controllers/homework_attach_controller.rb
+++ b/app/controllers/homework_attach_controller.rb
@@ -1,7 +1,7 @@
class HomeworkAttachController < ApplicationController
layout "course_base"
include CoursesHelper
-
+ include HomeworkAttachHelper
helper :words
###############################
before_filter :can_show_course,except: []
@@ -373,10 +373,20 @@ class HomeworkAttachController < ApplicationController
@offset ||= @feedback_pages.offset
@jour = @jours[@offset, @limit]
#@comprehensive_evaluation教师评论
- @comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1").order("created_on DESC")
+ #@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1").order("created_on DESC")
+ teachers = searchTeacherAndAssistant @course
+ @comprehensive_evaluation = []
+ teachers.each do|teacher|
+ temp = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1 and user_id = #{teacher.user_id}").order("created_on DESC").first
+ @comprehensive_evaluation << temp if temp
+ end
+ #@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1 and user_id in #{convert_array(teachers)}").order("created_on DESC")
#@anonymous_comments 匿评
- @anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2").order("created_on DESC")
-
+ #@anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2").order("created_on DESC")
+ annymous_users = @homework.homework_evaluations.map(&:user)
+ unless annymous_users.nil? || annymous_users.count == 0
+ @anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in #{convert_array(annymous_users)}").order("created_on DESC")
+ end
@totle_score = score_for_homework @homework
@teaher_score = teacher_score_for_homework @homework
diff --git a/app/helpers/homework_attach_helper.rb b/app/helpers/homework_attach_helper.rb
index 8ba02136e..ec66a42d9 100644
--- a/app/helpers/homework_attach_helper.rb
+++ b/app/helpers/homework_attach_helper.rb
@@ -90,4 +90,19 @@ module HomeworkAttachHelper
seems_rateable_rate = HomeworkAttach.find_by_sql("SELECT * FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = #{homework.id} AND rater_id = #{user.id}")
seems_rateable_rate.nil? || seems_rateable_rate.count == 0 ? 0:seems_rateable_rate[0].stars
end
+
+ def convert_array array
+ ary = "("
+ if array.nil? || array.count == 0
+ return "()"
+ end
+ array.each do |member|
+ if member == array.last
+ ary += member.to_s + ")"
+ else
+ ary += member.to_s + ","
+ end
+ end
+ ary
+ end
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 22b33fbec..3a17ecb88 100644
--- a/app/views/homework_attach/_show.html.erb
+++ b/app/views/homework_attach/_show.html.erb
@@ -79,11 +79,11 @@
-
- <%= l(:label_teacher_comments) %>(<%= @comprehensive_evaluation.count == 0 ? 0:1 %>)
+ <%= l(:label_teacher_comments) %>(<%= @comprehensive_evaluation.nil? ? 0 : @comprehensive_evaluation.count %>)
-
- <%= l(:label_anonymous_comments) %>(<%= @anonymous_comments.count %>)
+ <%= l(:label_anonymous_comments) %>(<%= @anonymous_comments.nil? ? 0 : @anonymous_comments.count %>)
-
- <%= l(:label_responses) %>(<%= @jours.count %>)
+ <%= l(:label_responses) %>(<%= @jours.nil? ? 0 : @jours.count %>)
@@ -95,12 +95,12 @@
- <% if @comprehensive_evaluation.count > 0 %>
- <%= render :partial => 'homework_attach/jour',:locals => {:jour => @comprehensive_evaluation.first} %>
+ <% @comprehensive_evaluation.nil? || @comprehensive_evaluation.count == 0 || @comprehensive_evaluation.each do |jour| %>
+ <%= render :partial => 'homework_attach/jour',:locals => {:jour => jour} %>
<% end %>
- <%= @anonymous_comments.each do |jour| %>
+ <%= @anonymous_comments.nil? || @anonymous_comments.each do |jour| %>
<%= render :partial => 'homework_attach/jour',:locals => {:jour => jour} %>
<% end %>
From c2fe1b7c726ce83320359150c671c00bef7c61fc Mon Sep 17 00:00:00 2001
From: z9hang
Date: Mon, 3 Nov 2014 14:47:28 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=AF=84=E5=88=86?=
=?UTF-8?q?=E4=B8=8D=E8=83=BD=E7=82=B9=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BD=9C?=
=?UTF-8?q?=E5=93=81=E7=95=99=E8=A8=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/homework_attach_controller.rb | 12 +++----
app/helpers/homework_attach_helper.rb | 4 +--
.../homework_attach/_histoey_new.html.erb | 25 +++++++++++++
app/views/homework_attach/_jour.html.erb | 22 +++++++++---
app/views/homework_attach/_show.html.erb | 35 +------------------
app/views/homework_attach/addjours.js.erb | 18 +++++++---
config/locales/en.yml | 3 +-
config/locales/zh.yml | 3 +-
8 files changed, 69 insertions(+), 53 deletions(-)
create mode 100644 app/views/homework_attach/_histoey_new.html.erb
diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb
index a2c2ce5bc..8757ded98 100644
--- a/app/controllers/homework_attach_controller.rb
+++ b/app/controllers/homework_attach_controller.rb
@@ -426,12 +426,12 @@ class HomeworkAttachController < ApplicationController
def addjours
@homework = HomeworkAttach.find(params[:jour_id])
@add_jour = @homework.addjours User.current.id, params[:new_form][:user_message],0,params[:is_comprehensive_evaluation]
- @jours = @homework.journals_for_messages.where("is_comprehensive_evaluation is null").order("created_on DESC")
- @limit = 10
- @feedback_count = @jours.count
- @feedback_pages = Paginator.new @feedback_count, @limit, params['page']
- @offset ||= @feedback_pages.offset
- @jour = @jours[@offset, @limit]
+ @jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")
+ #@limit = 10
+ #@feedback_count = @jours.count
+ #@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
+ #@offset ||= @feedback_pages.offset
+ #@jour = @jours[@offset, @limit]
@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation is not null").order("created_on DESC")
@totle_score = score_for_homework @homework
diff --git a/app/helpers/homework_attach_helper.rb b/app/helpers/homework_attach_helper.rb
index ec66a42d9..d8d418da5 100644
--- a/app/helpers/homework_attach_helper.rb
+++ b/app/helpers/homework_attach_helper.rb
@@ -98,9 +98,9 @@ module HomeworkAttachHelper
end
array.each do |member|
if member == array.last
- ary += member.to_s + ")"
+ ary += member.id.to_s + ")"
else
- ary += member.to_s + ","
+ ary += member.id.to_s + ","
end
end
ary
diff --git a/app/views/homework_attach/_histoey_new.html.erb b/app/views/homework_attach/_histoey_new.html.erb
new file mode 100644
index 000000000..3ae103040
--- /dev/null
+++ b/app/views/homework_attach/_histoey_new.html.erb
@@ -0,0 +1,25 @@
+
+
+
+ -
+ <%= l(:label_teacher_comments) %>(<%= @comprehensive_evaluation.nil? ? 0 : @comprehensive_evaluation.count %>)
+ -
+ <%= l(:label_anonymous_comments) %>(<%= @anonymous_comments.nil? ? 0 : @anonymous_comments.count %>)
+ -
+ <%= l(:label_responses) %>(<%= @jours.nil? ? 0 : @jours.count %>)
+
+
+
+
+
+ <%= render :partial => 'homework_attach/jour',:locals => {:jours => @jours,:show_score => false,:show_name => true} %>
+
+
+
+ <%= render :partial => 'homework_attach/jour',:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true} %>
+
+
+ <%= render :partial => 'homework_attach/jour',:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false} %>
+
+
+
\ No newline at end of file
diff --git a/app/views/homework_attach/_jour.html.erb b/app/views/homework_attach/_jour.html.erb
index 06800084c..30c8b9026 100644
--- a/app/views/homework_attach/_jour.html.erb
+++ b/app/views/homework_attach/_jour.html.erb
@@ -1,11 +1,22 @@
+<% jours.nil? || jours.count == 0 || jours.each do |jour| %>
-
+
<%= link_to jour.user, user_path(jour.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%>
-
<%= jour.created_on %>
- <%= l(:label_work_rating) %>:
- <%= render :partial => 'show_score', locals: {:stars => get_homework_score(jour.user,@homework ) } %>
+ <%= jour.created_on %>
+
+ <% if show_score %>
+ <%= l(:label_work_rating) %>:
+ <%= render :partial => 'show_score', locals: {:stars => get_homework_score(jour.user,@homework ) } %>
+ <% end %>
<%= textilizable jour.notes%>
@@ -25,4 +36,5 @@
-
\ No newline at end of file
+
+<% 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 3a17ecb88..5de492f21 100644
--- a/app/views/homework_attach/_show.html.erb
+++ b/app/views/homework_attach/_show.html.erb
@@ -75,40 +75,7 @@
-
-
-
- -
- <%= l(:label_teacher_comments) %>(<%= @comprehensive_evaluation.nil? ? 0 : @comprehensive_evaluation.count %>)
- -
- <%= l(:label_anonymous_comments) %>(<%= @anonymous_comments.nil? ? 0 : @anonymous_comments.count %>)
- -
- <%= l(:label_responses) %>(<%= @jours.nil? ? 0 : @jours.count %>)
-
-
-
-
-
- <% @jours.each do |jour| %>
- <%= render :partial => 'homework_attach/jour',:locals => {:jour => jour} %>
- <% end %>
-
-
-
- <% @comprehensive_evaluation.nil? || @comprehensive_evaluation.count == 0 || @comprehensive_evaluation.each do |jour| %>
- <%= render :partial => 'homework_attach/jour',:locals => {:jour => jour} %>
- <% end %>
-
-
- <%= @anonymous_comments.nil? || @anonymous_comments.each do |jour| %>
- <%= render :partial => 'homework_attach/jour',:locals => {:jour => jour} %>
- <% end %>
-
-
-
-
+ <%= render :partial => 'histoey_new' %>
-
-
\ 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 e16609b68..ae95d2b6c 100644
--- a/app/views/homework_attach/addjours.js.erb
+++ b/app/views/homework_attach/addjours.js.erb
@@ -1,9 +1,19 @@
+//教师评论
<% if @add_jour.is_comprehensive_evaluation == 1 %>
$('#comprehensive_evaluation').html('<%= escape_javascript(render(:partial => 'comprehensive_evaluation',
:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework,:teaher_score => @teaher_score} )) %>');
+//匿评
+<% elsif @add_jour.is_comprehensive_evaluation == 2 %>
+// $('#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})) %>');
+ HoverLi(5);
+ $('#tbc_05').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @jours,:show_score => false,:show_name => true})) %>')
+ $('#new_form_user_message').val("");
+ $('#new_form_reference_user_id').val("");
+//留言
<% 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("");
+ HoverLi(3);
+ $('#tbc_03').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @jours,:show_score => false,:show_name => true})) %>')
+ $('#new_form_user_message').val("");
+ $('#new_form_reference_user_id').val("");
<% end %>
\ No newline at end of file
diff --git a/config/locales/en.yml b/config/locales/en.yml
index a8d85efed..18a4819c5 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1849,4 +1849,5 @@ en:
label_participation_person: The participation of personnel
label_homework_without_description: The homework without any description!
label_teacher_comments: Teacher comments
- label_anonymous_comments: Anonymous comments
\ No newline at end of file
+ label_anonymous_comments: Anonymous comments
+ label_anonymous: Anonymous
\ No newline at end of file
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 51b73ce24..a92832065 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -2181,4 +2181,5 @@ zh:
label_homework_without_description: 该作业无任何描述!
label_sure_exit_homework: 是否确认退出该作业
label_teacher_comments: 教师评论
- label_anonymous_comments: 匿评
\ No newline at end of file
+ label_anonymous_comments: 匿评
+ label_anonymous: 匿名
\ No newline at end of file
From 157010bdad537a61ec287481886d1e0c1190a866 Mon Sep 17 00:00:00 2001
From: z9hang
Date: Mon, 3 Nov 2014 15:28:54 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E3=80=81=E6=95=99?=
=?UTF-8?q?=E5=B8=88=E8=AF=84=E8=AE=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/homework_attach_controller.rb | 31 ++++++++++++++-----
.../homework_attach/_histoey_new.html.erb | 6 ++--
app/views/homework_attach/_jour.html.erb | 3 ++
app/views/homework_attach/_show.html.erb | 20 ++----------
app/views/homework_attach/_show_star.html.erb | 15 +++++++++
app/views/homework_attach/addjours.js.erb | 18 +++++------
6 files changed, 57 insertions(+), 36 deletions(-)
create mode 100644 app/views/homework_attach/_show_star.html.erb
diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb
index 8757ded98..0fb4be400 100644
--- a/app/controllers/homework_attach_controller.rb
+++ b/app/controllers/homework_attach_controller.rb
@@ -365,13 +365,14 @@ class HomeworkAttachController < ApplicationController
@has_evaluation = stars_reates.where("rater_id = ?",User.current).count > 0
#是否开启互评功能
@is_evaluation = @homework.bid.is_evaluation == 1 || @homework.bid.is_evaluation == nil
- @limit = 10
+ #@limit = 10
#@jours留言 is null条件用以兼容历史数据
@jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")
- @feedback_count = @jours.count
- @feedback_pages = Paginator.new @feedback_count, @limit, params['page']
- @offset ||= @feedback_pages.offset
- @jour = @jours[@offset, @limit]
+ @jour = paginateHelper @jours,10
+ #@feedback_count = @jours.count
+ #@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
+ #@offset ||= @feedback_pages.offset
+ #@jour = @jours[@offset, @limit]
#@comprehensive_evaluation教师评论
#@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1").order("created_on DESC")
teachers = searchTeacherAndAssistant @course
@@ -426,13 +427,29 @@ class HomeworkAttachController < ApplicationController
def addjours
@homework = HomeworkAttach.find(params[:jour_id])
@add_jour = @homework.addjours User.current.id, params[:new_form][:user_message],0,params[:is_comprehensive_evaluation]
- @jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")
+ if @add_jour.is_comprehensive_evaluation == 3
+ @jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")
+ elsif @add_jour.is_comprehensive_evaluation == 2
+ annymous_users = @homework.homework_evaluations.map(&:user)
+ unless annymous_users.nil? || annymous_users.count == 0
+ @anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in #{convert_array(annymous_users)}").order("created_on DESC")
+ end
+ elsif @add_jour.is_comprehensive_evaluation == 1
+ teachers = searchTeacherAndAssistant @course
+ @comprehensive_evaluation = []
+ teachers.each do|teacher|
+ temp = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1 and user_id = #{teacher.user_id}").order("created_on DESC").first
+ @comprehensive_evaluation << temp if temp
+ end
+ end
+
+
#@limit = 10
#@feedback_count = @jours.count
#@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
#@offset ||= @feedback_pages.offset
#@jour = @jours[@offset, @limit]
- @comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation is not null").order("created_on DESC")
+ #@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation is not null").order("created_on DESC")
@totle_score = score_for_homework @homework
@teaher_score = teacher_score_for_homework @homework
diff --git a/app/views/homework_attach/_histoey_new.html.erb b/app/views/homework_attach/_histoey_new.html.erb
index 3ae103040..273e8bd4c 100644
--- a/app/views/homework_attach/_histoey_new.html.erb
+++ b/app/views/homework_attach/_histoey_new.html.erb
@@ -12,14 +12,14 @@
- <%= render :partial => 'homework_attach/jour',:locals => {:jours => @jours,:show_score => false,:show_name => true} %>
+ <%= render :partial => 'homework_attach/jour',:locals => {:jours => @jour,:show_score => false,:show_name => true,:is_jour => true} %>
- <%= render :partial => 'homework_attach/jour',:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true} %>
+ <%= render :partial => 'homework_attach/jour',:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true,:is_jour => false} %>
- <%= render :partial => 'homework_attach/jour',:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false} %>
+ <%= render :partial => 'homework_attach/jour',:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false,:is_jour => false} %>
\ No newline at end of file
diff --git a/app/views/homework_attach/_jour.html.erb b/app/views/homework_attach/_jour.html.erb
index 30c8b9026..a9872d357 100644
--- a/app/views/homework_attach/_jour.html.erb
+++ b/app/views/homework_attach/_jour.html.erb
@@ -37,4 +37,7 @@
+<% end %>
+<% if is_jour%>
+ <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true%>
<% 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 5de492f21..b44380ab9 100644
--- a/app/views/homework_attach/_show.html.erb
+++ b/app/views/homework_attach/_show.html.erb
@@ -50,23 +50,9 @@
-
- <% if @is_comprehensive_evaluation == 3 %>
- <%= l(:label_work_rating) %>:
- <%= render :partial => 'show_score', locals: {:stars => @totle_score} %>
- <% elsif @is_comprehensive_evaluation == 2 %>
- <%= l(:label_work_rating) %>:
- <% if @has_evaluation || !can_anonymous_comments %>
- <%= render :partial => 'show_score', locals: {:stars => @totle_score} %>
- <% else %>
- <%= rating_for @homework, dimension: :quality, class: 'rateable div_inline' %>
- <% end %>
-
- <% elsif @is_comprehensive_evaluation == 1%>
- <%= l(:label_work_rating) %>:
- <%= rating_for @homework, dimension: :quality, class: 'rateable div_inline' %>
- <% end %>
-
+
+ <%= render :partial => 'show_star',:locals => {:is_comprehensive_evaluation => @is_comprehensive_evaluation,:totle_score => @totle_score,:has_evaluation => @has_evaluation ,
+ :can_anonymous_comments=>can_anonymous_comments,:homework => @homework} %>
<%= render :partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0, :is_comprehensive_evaluation => @is_comprehensive_evaluation} %>
diff --git a/app/views/homework_attach/_show_star.html.erb b/app/views/homework_attach/_show_star.html.erb
new file mode 100644
index 000000000..bf119dd95
--- /dev/null
+++ b/app/views/homework_attach/_show_star.html.erb
@@ -0,0 +1,15 @@
+<% if is_comprehensive_evaluation == 3 %>
+ <%= l(:label_work_rating) %>:
+ <%= render :partial => 'show_score', locals: {:stars => totle_score} %>
+<% elsif is_comprehensive_evaluation == 2 %>
+ <%= l(:label_work_rating) %>:
+ <% if has_evaluation || !can_anonymous_comments %>
+ <%= render :partial => 'show_score', locals: {:stars => totle_score} %>
+ <% else %>
+ <%= rating_for homework, dimension: :quality, class: 'rateable div_inline' %>
+ <% end %>
+
+<% elsif @is_comprehensive_evaluation == 1%>
+ <%= l(:label_work_rating) %>:
+ <%= rating_for homework, dimension: :quality, class: 'rateable div_inline' %>
+<% 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 ae95d2b6c..f843e1a1e 100644
--- a/app/views/homework_attach/addjours.js.erb
+++ b/app/views/homework_attach/addjours.js.erb
@@ -1,19 +1,19 @@
//教师评论
<% if @add_jour.is_comprehensive_evaluation == 1 %>
- $('#comprehensive_evaluation').html('<%= escape_javascript(render(:partial => 'comprehensive_evaluation',
- :locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework,:teaher_score => @teaher_score} )) %>');
+ //$('#comprehensive_evaluation').html('<#%= escape_javascript(render(:partial => 'comprehensive_evaluation',
+ //:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework,:teaher_score => @teaher_score} )) %>');
+ HoverLi(4);
+ $('#tbc_04').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true,:is_jour => false})) %>')
//匿评
<% elsif @add_jour.is_comprehensive_evaluation == 2 %>
// $('#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})) %>');
HoverLi(5);
- $('#tbc_05').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @jours,:show_score => false,:show_name => true})) %>')
- $('#new_form_user_message').val("");
- $('#new_form_reference_user_id').val("");
+ $('#tbc_05').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false,:is_jour => false})) %>')
//留言
<% else %>
HoverLi(3);
- $('#tbc_03').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @jours,:show_score => false,:show_name => true})) %>')
- $('#new_form_user_message').val("");
- $('#new_form_reference_user_id').val("");
-<% end %>
\ No newline at end of file
+ $('#tbc_03').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @jours,:show_score => false,:show_name => true,:is_jour => true})) %>')
+<% end %>
+$('#new_form_user_message').val("");
+$('#new_form_reference_user_id').val("");
\ No newline at end of file
From 4f00e974e9888d8ec1cf0593fcc00047866f4826 Mon Sep 17 00:00:00 2001
From: z9hang
Date: Mon, 3 Nov 2014 15:29:57 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E8=83=BD=E5=90=A6=E5=8C=BF=E8=AF=84?=
=?UTF-8?q?=E5=8F=82=E6=95=B0=E6=9A=82=E8=AE=BE=E4=B8=BATRUE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/homework_attach/show.js.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/homework_attach/show.js.erb b/app/views/homework_attach/show.js.erb
index 5db0f1505..e1366e1da 100644
--- a/app/views/homework_attach/show.js.erb
+++ b/app/views/homework_attach/show.js.erb
@@ -1,4 +1,4 @@
-$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show',:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework, :teaher_score => @teaher_score,:can_anonymous_comments => false}) %>');
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show',:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework, :teaher_score => @teaher_score,:can_anonymous_comments => true}) %>');
showModal('ajax-modal', '503px');
$('#ajax-modal').css('height','569px');