From 065900b02a3ee5dc416bda4f71f12c6780322fb2 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 12 Dec 2016 11:23:44 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=AD=E3=80=81=E4=BD=9C=E5=93=81=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=B8=AD=E7=82=B9=E5=87=BB=E5=A7=93=E5=90=8D=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5=EF=BC=8C=E5=BB=BA?= =?UTF-8?q?=E8=AE=AE=E6=98=AF=E5=BC=B9=E5=87=BA=E6=96=B0=E7=9A=84tab?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_new_member_list.html.erb | 4 ++-- .../_evaluation_un_group_member_work.html.erb | 14 +++++++------- .../student_work/_evaluation_un_work.html.erb | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/views/courses/_new_member_list.html.erb b/app/views/courses/_new_member_list.html.erb index 85b228586..28c8874b6 100644 --- a/app/views/courses/_new_member_list.html.erb +++ b/app/views/courses/_new_member_list.html.erb @@ -79,8 +79,8 @@ <% sum = hw_score + ex_score + act_score %> <%= (@page - 1) * @limit + i + 1 %> - <%= link_to image_tag(url_to_avatar(user), :width => "30", :height => "30", :style => "display:block;"), user_path(user), :class => 'sy_class_users_st fl mt5 mr5' ,:alt => "用户头像" %> - <%= link_to user.show_name, user_path(user), :class => 'fl sy_class_users_st_name' ,:title => "#{user.show_name}" %> + <%= link_to image_tag(url_to_avatar(user), :width => "30", :height => "30", :style => "display:block;"), user_path(user), :class => 'sy_class_users_st fl mt5 mr5' ,:alt => "用户头像", :target => '_blank' %> + <%= link_to user.show_name, user_path(user), :class => 'fl sy_class_users_st_name' ,:title => "#{user.show_name}", :target => '_blank' %> <%= user.user_extensions.student_id %> diff --git a/app/views/student_work/_evaluation_un_group_member_work.html.erb b/app/views/student_work/_evaluation_un_group_member_work.html.erb index 2f0d5185e..bcdfd5636 100644 --- a/app/views/student_work/_evaluation_un_group_member_work.html.erb +++ b/app/views/student_work/_evaluation_un_group_member_work.html.erb @@ -2,24 +2,24 @@ <% is_expand = st.student_work_projects.empty? %> @@ -54,7 +60,7 @@
-

邀 请 码
+

邀 请 码
<% if @course.invite_code_halt == 0 %> <% if User.current.admin? || User.current.member_of_course?(@course) %> @@ -66,11 +72,6 @@ 已停用 <% end %> - <% if is_teacher && @course.invite_code_halt == 0 %> - 停    用 - <% elsif is_teacher && @course.invite_code_halt == 1 %> - 启    用 - <% end %>

@@ -79,22 +80,16 @@ <%=@course.name %> -

- 教师:<%= course_teacher_link teacher_num %> - 学生:<%= course_student_link student_num %> - 资源:<%= link_to course_file_num, course_files_path(@course), :class => 'sy_cblue',:id=>'courses_files_count_info' %> -

- 主讲老师:<%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cblue') %> - 学时:<%= @course.class_period %>学时 - 学期:<%= current_time_and_term @course %> - 单位:<%= get_occupation_from_user(@course.teacher).blank? ? '无' : get_occupation_from_user(@course.teacher) %> + 学期:<%= current_time_and_term @course %> + 教师:<%= course_teacher_link teacher_num %> + 学生:<%= course_student_link student_num %> +

+

+ 单位:<%= get_occupation_from_user(@course.teacher).blank? ? '无' : get_occupation_from_user(@course.teacher) %>

- <% if is_teacher %> - <%= link_to "班级设置", {:controller => 'courses', :action => 'settings', :id => @course}, :class => "sy_btn_grey mr10 fl" %> - <% end %> <% is_TA = get_user_member_roles_course @course, User.current, 7 %> <% is_TE = get_user_member_roles_course @course, User.current, 9 %> <% is_ST = get_user_member_roles_course @course, User.current, 10 %> @@ -114,7 +109,7 @@
-

<%= @course.invite_code_halt == 0 ? "请将邀请码告诉学生和教辅" : "邀请码已停用,学生和教辅" %>

-

<%= @course.invite_code_halt == 0 ? "他们可以主动加入班级" : "不可以主动加入班级了" %>

+

<%= @course.invite_code_halt == 0 ? "请将邀请码告诉成员" : "邀请码已停用" %>

+

<%= @course.invite_code_halt == 0 ? "他们可以主动加入" : "暂时停止成员主动加入" %>

<% end %> \ No newline at end of file diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index 8127753c5..c2ff5c841 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -1441,7 +1441,7 @@ a.syllabusbox_a_blue { .resource_tip_box span {display:block; border-width:10px; position:absolute;top:35px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;} /*邀请码提示框*/ -.invite_code_tip_box {position:absolute; padding:5px 10px; white-space:nowrap; background-color:#fff; right:-185px; top:50px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);} +.invite_code_tip_box {position:absolute; padding:5px 10px; white-space:nowrap; background-color:#fff; right:-160px; top:50px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);} .invite_code_tip_box em {display:block; border-width:10px; position:absolute;top:26px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;} .invite_code_tip_box span {display:block; border-width:10px; position:absolute;top:26px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;} diff --git a/public/stylesheets/syllabus.css b/public/stylesheets/syllabus.css index c38e1bd79..90d62c6c2 100644 --- a/public/stylesheets/syllabus.css +++ b/public/stylesheets/syllabus.css @@ -289,10 +289,11 @@ a.sy_class_option:hover { } .sy_class_id{ width:94px; - height:94px; + height:70px; border:1px solid #f1f1f1; background:#fff; text-align:center; + padding-top:24px; } .sy_class_id p{ font-size:16px; @@ -302,7 +303,7 @@ a.sy_class_option:hover { font-size: 18px; font-weight: normal; margin-bottom: 5px; - max-width:440px; + max-width:650px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; From 8c1e2da2d3b7ce3414494d940beb727257176ee7 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 14 Dec 2016 09:16:50 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E7=9A=84=E6=A0=87=E9=A2=98=E6=A0=8F=EF=BC=8C?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E8=BE=93=E5=85=A5=E4=BE=8B=E7=9A=84=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/article_homepages/_article_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/article_homepages/_article_form.html.erb b/app/views/article_homepages/_article_form.html.erb index f72b51c60..c55a4c2fa 100644 --- a/app/views/article_homepages/_article_form.html.erb +++ b/app/views/article_homepages/_article_form.html.erb @@ -4,7 +4,7 @@ <% end %>
- +

From 5ef8f19fbdfa9453d5ab9b91bc204e827ab51b2b Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 14 Dec 2016 09:38:19 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E7=9A=84=E5=BD=92?= =?UTF-8?q?=E6=A1=A3=E6=8F=90=E7=A4=BA=E4=B8=8D=E5=AE=8C=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_courses_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_courses_list.html.erb b/app/views/users/_courses_list.html.erb index bee64a059..a243e031a 100644 --- a/app/views/users/_courses_list.html.erb +++ b/app/views/users/_courses_list.html.erb @@ -33,7 +33,7 @@ <% if course.is_delete == 0 %> 此班级的信息将不再显示
您和您的学生将不能在此班级中继续互动
- 但您可以点击上方的“归档管理” + 但您可以点击“归档管理”重新恢复 <% else %> 此班级的信息将恢复显示
您和您的学生将可以重新在此班级中互动 From 23e1f2b3bd04a4c6f08b72523820d2449863ef43 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 14 Dec 2016 13:37:52 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E6=9C=9F=E9=97=B4=EF=BC=8C=E5=B0=8F=E9=93=83=E9=93=9B=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E3=80=81=E4=BD=9C=E4=B8=9A=E5=8A=A8=E6=80=81=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E4=BD=9C=E5=93=81=E8=AF=A6=E6=83=85=E7=9A=84=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E6=98=BE=E7=A4=BA=EF=BC=8C=E6=9A=B4=E9=9C=B2=E4=BA=86?= =?UTF-8?q?=E8=AF=84=E9=98=85=E4=BA=BA=E6=88=96=E5=8C=BF=E8=AF=84=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E7=9A=84=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_show_messages_list.html.erb | 3 ++- app/views/student_work/_jour_replay.html.erb | 4 ++-- app/views/users/_homework_base_info.html.erb | 2 +- app/views/users/_user_message_course.html.erb | 10 +++++----- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/views/layouts/_show_messages_list.html.erb b/app/views/layouts/_show_messages_list.html.erb index 8e7be1fe1..64516221c 100644 --- a/app/views/layouts/_show_messages_list.html.erb +++ b/app/views/layouts/_show_messages_list.html.erb @@ -61,7 +61,8 @@ <% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
  • <%=ma.course_message.user.show_name %> <%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= message_content(ma.course_message.notes)%>
  • <% else %> -
  • <%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> 回复了作品评论:<%= message_content(ma.course_message.notes)%>
  • + <% show_name = ma.course_message.jour.reviewer_role != 3 || ma.course_message.user.allowed_to?(:as_teacher, ma.course) %> +
  • 回复了作品评论:<%= message_content(ma.course_message.notes)%>"><%=show_name ? ma.course_message.user.show_name + "#{ma.course_message.user.allowed_to?(:as_teacher, ma.course)?"老师":"同学"}" : "匿名用户" %> 回复了作品评论:<%= message_content(ma.course_message.notes)%>
  • <% end %> <% elsif ma.course_message_type == "StudentWork" && !ma.course_message.homework_common.nil? && !User.current.allowed_to?(:as_teacher, ma.course_message.homework_common.course) %>
  • <%=ma.course_message.homework_common.user.show_name %>老师 发布的作业:<%=ma.course_message.homework_common.name %>,由于迟交作业,您及您的作品都不能参与该作业的匿评
  • diff --git a/app/views/student_work/_jour_replay.html.erb b/app/views/student_work/_jour_replay.html.erb index eba5b2c08..1887614fb 100644 --- a/app/views/student_work/_jour_replay.html.erb +++ b/app/views/student_work/_jour_replay.html.erb @@ -1,8 +1,8 @@
    - <%= link_to image_tag(url_to_avatar(jour.user), :width => "32", :height => "32"), user_path(jour.user),:class => "st_img fl" %> + <%= link_to image_tag(url_to_avatar(show_real_name ? jour.user : ""), :width => "32", :height => "32"), show_real_name ? user_path(jour.user) : "javascript:void(0)",:class => "st_img fl" %>
    - <%= link_to show_real_name ? jour.user.show_name : "匿名", user_path(jour.user), :title => jour.user.show_name, :class => "c_blue fl" %> + <%= link_to show_real_name ? jour.user.show_name : "匿名", show_real_name ? user_path(jour.user) : "javascript:void(0)", :title => jour.user.show_name, :class => "c_blue fl" %> <% if jour.user==User.current || User.current.admin? %> <%= link_to(l(:label_bid_respond_delete), destroy_score_reply_student_work_index_path(:jour_id => jour.id), diff --git a/app/views/users/_homework_base_info.html.erb b/app/views/users/_homework_base_info.html.erb index 53f968328..3c4200e9d 100644 --- a/app/views/users/_homework_base_info.html.erb +++ b/app/views/users/_homework_base_info.html.erb @@ -33,7 +33,7 @@ <% last_score = student_work_scores.first %>

    # <%=time_from_now last_score.created_at %> - <%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行: + <%= link_to last_score.reviewer_role == 3 && !is_teacher ? '学生匿名' : last_score.user.show_name, last_score.reviewer_role == 3 && !is_teacher ? "javascript:void(0)" : user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:

    <% end %> diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index 87d448944..e59d6fce8 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -367,7 +367,7 @@
    • <% if ma.course_message.reviewer_role == 3 %> - <%=link_to image_tag(url_to_avatar(""), :width => "30", :height => "30"), :target => '_blank' %> + <%=link_to image_tag(url_to_avatar(""), :width => "30", :height => "30"), "javascript:void(0);", :target => '_blank' %> <% else %> <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %> <% end %> @@ -470,15 +470,15 @@
    <% else %>
    @@ -106,5 +138,10 @@ <% end %> } }); + <% if homework.anonymous_appeal == 1 %> + $("#anonymous_appeal").attr("checked", "checked"); + <% else %> + $("#no_anonymous_appeal").attr("checked", "checked"); + <% end %> }); \ No newline at end of file diff --git a/app/views/homework_common/_set_score_rule_pro.html.erb b/app/views/homework_common/_set_score_rule_pro.html.erb index 0a2c01b6f..22fdd6d26 100644 --- a/app/views/homework_common/_set_score_rule_pro.html.erb +++ b/app/views/homework_common/_set_score_rule_pro.html.erb @@ -1,4 +1,4 @@ -
    +

    评分设置

    @@ -21,6 +21,23 @@
  • + +
      +
    • + + +
    • +
    • + + +
    • +
    +
  • +
  • + + +
  • +
  • @@ -40,7 +57,7 @@ 助教评分
  • - + 学生匿评
  • @@ -60,12 +77,27 @@ + + +
    @@ -116,5 +148,10 @@ <% end %> } }); + <% if homework.anonymous_appeal == 1 %> + $("#anonymous_appeal").attr("checked", "checked"); + <% else %> + $("#no_anonymous_appeal").attr("checked", "checked"); + <% end %> }); \ No newline at end of file diff --git a/app/views/homework_common/score_rule_set.js.erb b/app/views/homework_common/score_rule_set.js.erb index abe8800e7..289698de9 100644 --- a/app/views/homework_common/score_rule_set.js.erb +++ b/app/views/homework_common/score_rule_set.js.erb @@ -1,7 +1,7 @@ <% if @homework.homework_type == 2 %> <% if @homework.anonymous_comment == 0 %> var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>"; - pop_box_new(htmlvalue, 570, 355); + pop_box_new(htmlvalue, 600, 580); <% else %> var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro_anon',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>"; pop_box_new(htmlvalue, 500, 285); @@ -9,19 +9,22 @@ <% else %> <% if @homework.anonymous_comment == 0 %> var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_non_pro',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>"; - pop_box_new(htmlvalue, 500, 325); + pop_box_new(htmlvalue, 600, 550); <% else %> var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_none_pro_anon',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>"; pop_box_new(htmlvalue, 500, 225); <% end %> <% end %> function set_score_rule_submit() { - if($("#late_penalty_num").val() == ""){ + if($("#late_penalty_num").val().trim() == ""){ $("#late_penalty_num").val("0"); } - if($("#absence_penalty_num").val() == ""){ + if($("#absence_penalty_num").val().trim() == ""){ $("#absence_penalty_num").val("0"); } + if($("#appeal_penalty").val().trim() == ""){ + $("#appeal_penalty").val("0"); + } $('#muban_popup_box').find('form').submit(); hideModal(); } \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_group_member_work.html.erb b/app/views/student_work/_evaluation_un_group_member_work.html.erb index bcdfd5636..d170c676d 100644 --- a/app/views/student_work/_evaluation_un_group_member_work.html.erb +++ b/app/views/student_work/_evaluation_un_group_member_work.html.erb @@ -82,10 +82,18 @@   <%= st.late_penalty %>  
    - 缺评扣分 -   - <%= st.absence_penalty%> -  
    + <% if @homework.anonymous_comment == 0 %> + 缺评扣分 +   + <%= st.absence_penalty%> +  
    + <% if @homework.anonymous_appeal == 1 %> + 违规匿评扣分 +   + <%= student_work.appeal_penalty%> +  
    + <% end %> + <% end %> 最终成绩为  <%= format("%.1f",score<0 ? 0 : score)%> 
    diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index 6cd3bff68..ace071f2a 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -120,10 +120,18 @@   <%= student_work.late_penalty %>  
    - 缺评扣分 -   - <%= student_work.absence_penalty%> -  
    + <% if @homework.anonymous_comment == 0%> + 缺评扣分 +   + <%= student_work.absence_penalty%> +  
    + <% if @homework.anonymous_appeal == 1 %> + 违规匿评扣分 +   + <%= student_work.appeal_penalty%> +  
    + <% end %> + <% end %> 最终成绩为  <%= format("%.1f",score<0 ? 0 : score)%> 
    diff --git a/db/migrate/20161214060728_add_anonymous_appeal_to_homework.rb b/db/migrate/20161214060728_add_anonymous_appeal_to_homework.rb new file mode 100644 index 000000000..af81d26f4 --- /dev/null +++ b/db/migrate/20161214060728_add_anonymous_appeal_to_homework.rb @@ -0,0 +1,8 @@ +class AddAnonymousAppealToHomework < ActiveRecord::Migration + def change + add_column :homework_commons, :anonymous_appeal, :integer, :default => 0 + add_column :homework_detail_manuals, :appeal_penalty, :integer, :default => 0 + add_column :student_works, :appeal_penalty, :integer, :default => 0 + add_column :student_works_scores, :appeal_status, :integer, :default => 0 + end +end From 710c06e41a1e0a69a002aba7858ebfc0fc42ba97 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 16 Dec 2016 11:01:58 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E6=88=90=E7=BB=A9?= =?UTF-8?q?=E7=9A=84=E7=94=B3=E8=AF=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 80 ++++++++++++++++++- app/models/applied_message.rb | 2 +- app/models/course_message.rb | 2 + app/models/student_works_score.rb | 1 + app/models/student_works_scores_appeal.rb | 4 + app/models/user.rb | 1 + .../layouts/_show_messages_list.html.erb | 13 +++ .../student_work/_evaluation_un_work.html.erb | 4 +- .../student_work/_group_member_work.html.erb | 2 +- .../student_work/_score_appeal_box.html.erb | 40 ++++++++++ .../student_work/_student_work_list.html.erb | 10 ++- .../student_work/_student_work_score.html.erb | 55 ++++++++++++- app/views/student_work/add_score.js.erb | 2 +- .../student_work/alert_appeal_box.js.erb | 2 + .../appeal_anonymous_score.js.erb | 2 + .../student_work/deal_appeal_score.js.erb | 22 +++++ .../users/_user_message_applied.html.erb | 18 +++++ app/views/users/_user_message_course.html.erb | 37 +++++++-- config/routes.rb | 3 + 19 files changed, 287 insertions(+), 13 deletions(-) create mode 100644 app/views/student_work/_score_appeal_box.html.erb create mode 100644 app/views/student_work/alert_appeal_box.js.erb create mode 100644 app/views/student_work/appeal_anonymous_score.js.erb create mode 100644 app/views/student_work/deal_appeal_score.js.erb diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 7fcd1e960..f991e73ac 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -351,6 +351,18 @@ class StudentWorkController < ApplicationController # 作品评论消息状态更新 journals_for_teacher = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @homework.course, "JournalsForMessage", 0) journals_for_teacher.update_all(:viewed => true) + #匿评申诉消息状态更新 + if params[:show_work_id] + work = @homework.student_works.where("id = #{params[:show_work_id].to_i}").first + if work && !work.student_works_scores.where("reviewer_role = 3 and appeal_status != 0").blank? + score_ids = "(" + work.student_works_scores.where("reviewer_role = 3 and appeal_status != 0").map{|score| score.id}.join(",") + ")" + score_appeal_ids = StudentWorksScoresAppeal.where("student_works_score_id in #{score_ids}").blank? ? "(-1)" : "(" + StudentWorksScoresAppeal.where("student_works_score_id in #{score_ids}").map{|score_appeal| score_appeal.id}.join(",") + ")" + anonymous_appeal =AppliedMessage.where("user_id =? and applied_id in #{score_appeal_ids} and applied_type =? and viewed =?", User.current.id, 'StudentWorksScoresAppeal', 0) + anonymous_appeal.update_all(:viewed => true) + appeal_message = CourseMessage.where("user_id =? and course_id =? and course_message_id in #{score_appeal_ids} and course_message_type =? and viewed =?", User.current.id, @homework.course, "StudentWorksScoresAppeal", 0) + appeal_message.update_all(:viewed => true) + end + end ################################################################################################################## @order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name].to_s.strip || "",params[:group] @homework_commons = @course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).order("created_at desc") @@ -697,6 +709,16 @@ class StudentWorkController < ApplicationController end def show + #匿评申诉消息状态更新 + if @work && !@work.student_works_scores.where("reviewer_role = 3 and appeal_status != 0").blank? + score_ids = "(" + @work.student_works_scores.where("reviewer_role = 3 and appeal_status != 0").map{|score| score.id}.join(",") + ")" + score_appeal_ids = StudentWorksScoresAppeal.where("student_works_score_id in #{score_ids}").blank? ? "(-1)" : "(" + StudentWorksScoresAppeal.where("student_works_score_id in #{score_ids}").map{|score_appeal| score_appeal.id}.join(",") + ")" + anonymous_appeal =AppliedMessage.where("user_id =? and applied_id in #{score_appeal_ids} and applied_type =? and viewed =?", User.current.id, 'StudentWorksScoresAppeal', 0) + anonymous_appeal.update_all(:viewed => true) + appeal_message = CourseMessage.where("user_id =? and course_id =? and course_message_id in #{score_appeal_ids} and course_message_type =? and viewed =?", User.current.id, @homework.course, "StudentWorksScoresAppeal", 0) + appeal_message.update_all(:viewed => true) + end + @score = student_work_score @work,User.current @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? if @homework.homework_detail_manual.comment_status == 2 && !@is_teacher && @work.user != User.current @@ -853,7 +875,7 @@ class StudentWorkController < ApplicationController end when 3 #学生评分 学生评分显示平均分 #@work.student_score = @work.student_works_scores.where(:reviewer_role => 3).average(:score).try(:round, 2).to_f - stu_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 3 ORDER BY created_at DESC) AS t GROUP BY user_id) AS a") + stu_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 3 AND appeal_status != 3 ORDER BY created_at DESC) AS t GROUP BY user_id) AS a") @work.student_score = stu_score.first.score.try(:round, 2).to_f if @is_group_leader add_score_to_member @work, @homework, @new_score @@ -1079,6 +1101,62 @@ class StudentWorkController < ApplicationController end end + def appeal_anonymous_score + @student_work_score = StudentWorksScore.where("id = #{params[:score_id].to_i}").first + @is_last = params[:is_last] + if @student_work_score + @student_work_score.update_column('appeal_status', 1) + score_appeal = StudentWorksScoresAppeal.create(:user_id => User.current.id, :student_works_score_id => @student_work_score.id, :comment => params[:appeal][:comment], :appeal_status => 1) + course = @student_work_score.student_work.homework_common.course + course.members.includes(:member_roles).where("member_roles.role_id in (3, 7, 9)").each do |member| + AppliedMessage.create(:user_id => member.user_id, :status => 0, :viewed => 0, :applied_id => score_appeal.id, :applied_type => 'StudentWorksScoresAppeal', :applied_user_id => User.current.id) + end + CourseMessage.create(:user_id => @student_work_score.user_id, :course_id => course.id, :viewed => false,:course_message_id=> score_appeal.id,:course_message_type=>'StudentWorksScoresAppeal',:status=>1) + end + @homework = @student_work_score.student_work.homework_common + @is_teacher = User.current.allowed_to?(:as_teacher, course) || User.current.admin? + end + + def alert_appeal_box + @student_work_score = StudentWorksScore.where("id = #{params[:score_id].to_i}").first + @is_last = params[:is_last] + end + + def deal_appeal_score + @student_work_score = StudentWorksScore.where("id = #{params[:score_id].to_i}").first + @is_last = params[:is_last] + if @student_work_score + @student_work_score.update_column('appeal_status', params[:status].to_i) + score_appeal = @student_work_score.student_works_scores_appeal + score_appeal.applied_messages.update_all(:status => params[:status].to_i == 2 ? 3 : (params[:status].to_i == 3 ? 1 : 2)) + if params[:status].to_i == 3 || params[:status].to_i == 4 + homework = @student_work_score.student_work.homework_common + if params[:status].to_i == 3 + # 申诉成功后 扣匿评学生的违规匿评扣分 + sw = homework.student_works.where("user_id = #{@student_work_score.user_id}").first + sw.update_attribute("appeal_penalty", homework.homework_detail_manual.appeal_penalty + sw.appeal_penalty) + + # 申诉成功 重新计算申诉者的匿评分 + work = @student_work_score.student_work + if work.student_works_scores.where("reviewer_role = 3 AND appeal_status != 3").count > 0 + stu_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@student_work_score.student_work_id} AND reviewer_role = 3 AND appeal_status != 3 ORDER BY created_at DESC) AS t GROUP BY user_id) AS a") + work.student_score = stu_score.first.score.try(:round, 2).to_f + else + work.student_score = nil + end + @student_work_score.student_work.save + end + course = homework.course + CourseMessage.create(:user_id => @student_work_score.user_id, :course_id => course.id, :viewed => false,:course_message_id=> score_appeal.id,:course_message_type=>'StudentWorksScoresAppeal',:status=>params[:status].to_i,:apply_result =>User.current.id) + CourseMessage.create(:user_id => score_appeal.user_id, :course_id => course.id, :viewed => false,:course_message_id=> score_appeal.id,:course_message_type=>'StudentWorksScoresAppeal',:status=>params[:status].to_i,:apply_result =>User.current.id) + end + @homework = @student_work_score.student_work.homework_common + @is_teacher = User.current.allowed_to?(:as_teacher, course) || User.current.admin? + @work = @student_work_score.student_work + @is_group_leader = !@work.student_work_projects.empty? + end + end + def forbidden_anonymous_comment @homework.update_column('anonymous_comment', @homework.anonymous_comment == 0 ? 1 : 0) homework_detail_manual = @homework.homework_detail_manual diff --git a/app/models/applied_message.rb b/app/models/applied_message.rb index cbba74f95..c5228ce83 100644 --- a/app/models/applied_message.rb +++ b/app/models/applied_message.rb @@ -1,5 +1,5 @@ class AppliedMessage < ActiveRecord::Base - # status: 0表示未批准; status:1表示已批准; status: 2表示已拒绝 + # status: 0表示未批准; status:1表示已批准; status: 2表示已拒绝; status: 3撤销 attr_accessible :applied_id, :applied_type, :status, :user_id, :viewed, :applied_user_id, :role, :project_id, :name belongs_to :applied ,:polymorphic => true diff --git a/app/models/course_message.rb b/app/models/course_message.rb index 59fcfe456..53ad5763f 100644 --- a/app/models/course_message.rb +++ b/app/models/course_message.rb @@ -5,6 +5,8 @@ class CourseMessage < ActiveRecord::Base # HomeworkCommon:status: # nil:发布了作业; 1:作业截止时间到了提醒!;2:开启匿评; 3:关闭匿评; 4:匿评开始失败; 5:申请引用作业, 6:申请结果 # apply_user_id: 申请者的用户id + # StudentWorksScoresAppeal: status: + # 1: 申诉中, 2:申诉撤销, 3:申诉成功, 4:申诉被拒绝 attr_accessible :course_id, :course_message_id, :course_message_type, :user_id, :viewed, :content, :status, :apply_user_id, :apply_result # 多态 虚拟关联 diff --git a/app/models/student_works_score.rb b/app/models/student_works_score.rb index 612fbbec2..6d08cad04 100644 --- a/app/models/student_works_score.rb +++ b/app/models/student_works_score.rb @@ -8,6 +8,7 @@ class StudentWorksScore < ActiveRecord::Base belongs_to :student_work has_many :journals_for_messages, :as => :jour, :dependent => :destroy has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy + has_one :student_works_scores_appeal, :dependent => :destroy acts_as_attachable diff --git a/app/models/student_works_scores_appeal.rb b/app/models/student_works_scores_appeal.rb index b69a942c2..787965b29 100644 --- a/app/models/student_works_scores_appeal.rb +++ b/app/models/student_works_scores_appeal.rb @@ -1,3 +1,7 @@ class StudentWorksScoresAppeal < ActiveRecord::Base attr_accessible :appeal_status, :comment, :student_works_score_id, :user_id + has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy + has_many :applied_messages, :class_name => 'AppliedMessage', :as => :applied, :dependent => :destroy + belongs_to :student_works_score + belongs_to :user end diff --git a/app/models/user.rb b/app/models/user.rb index 66a2cc5aa..0e188aa68 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -110,6 +110,7 @@ class User < Principal has_many :student_works_evaluation_distributions, :dependent => :destroy has_many :student_works_scores, :dependent => :destroy has_many :student_work_projects, :dependent => :destroy + has_many :student_works_scores_appeals, :dependent => :destroy has_many :apply_homeworks, :dependent => :destroy has_many :apply_resources, :dependent => :destroy #end diff --git a/app/views/layouts/_show_messages_list.html.erb b/app/views/layouts/_show_messages_list.html.erb index 64516221c..e0ec673c1 100644 --- a/app/views/layouts/_show_messages_list.html.erb +++ b/app/views/layouts/_show_messages_list.html.erb @@ -70,6 +70,13 @@
  • <%=ma.course_message.user.show_name %>同学 重新提交了作品:<%=ma.course_message.name %>
  • <% elsif ma.course_message_type == "StudentWork" && ma.status == 2 %>
  • <%=ma.course_message.user.show_name %>同学 追加新附件了:作业标题:<%=ma.course_message.homework_common.name %>
  • + <% elsif ma.course_message_type == "StudentWorksScoresAppeal" && ma.course_message && ma.status == 1 %> + <% student_work = ma.course_message.student_works_score.student_work %> +
  • 匿名用户 对您的评阅发起申诉:<%=student_work.homework_common.name %>
  • + <% elsif ma.course_message_type == "StudentWorksScoresAppeal" && ma.course_message && (ma.status == 3 || ma.status == 4) %> + <% deal_user = User.find ma.apply_result %> + <% student_work = ma.course_message.student_works_score.student_work %> +
  • <%= deal_user.show_name%> <%= ma.status == 3 ? '接受申诉' : '拒绝申诉' %>:<%=student_work.homework_common.name %>
  • <% elsif ma.course_message_type == "Course" %>
  • 系统提示 您成功创建了班级:班级名称:<%=ma.course_message.name %>
  • <% elsif ma.course_message_type == "JoinCourseRequest" %> @@ -115,6 +122,12 @@ <% content = "系统提示:“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!" %> <%= link_to content.html_safe, { :controller=> "my",:action => "account", :flag => 1, :applied_message_id => ma.id }, :title => "系统提示:“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%> + <% elsif ma.applied_type == "StudentWorksScoresAppeal" %> +
  • + <% homework = ma.applied.student_works_score.student_work.homework_common %> + <% content = ''+User.find(ma.applied_user_id).show_name+' 申诉匿评成绩:'+"“"+homework.name+"”" %> + <%= link_to content.html_safe, student_work_index_path(:homework => homework.id, :show_work_id => ma.applied.student_works_score.student_work_id, :tab => 2), :title => "#{User.find(ma.applied_user_id).show_name}申诉匿评成绩:“#{homework.name}”", :target => '_blank' %> +
  • <% end %> <% elsif ma.class == ForgeMessage %> <% if ma.forge_message_type == "AppliedProject" %> diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index ace071f2a..254b75321 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -94,7 +94,7 @@ 现共有 -  <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>  +  <%= student_work.student_works_scores.where("reviewer_role = 3 and appeal_status != 3").group_by(&:user_id).count%>  名学生进行了匿评,平均分为  <%= format("%.1f",student_work.student_score)%> 分。
    @@ -115,7 +115,7 @@ 作品最终评分为 -  <%= student_work.final_score%> 
    +  <%= score %> 
    迟交扣分   <%= student_work.late_penalty %> diff --git a/app/views/student_work/_group_member_work.html.erb b/app/views/student_work/_group_member_work.html.erb index d6751205b..b026cb6e3 100644 --- a/app/views/student_work/_group_member_work.html.erb +++ b/app/views/student_work/_group_member_work.html.erb @@ -1,6 +1,6 @@ <% user_ids = student_work.student_work_projects.empty? ? "(-1)" : "(" + student_work.student_work_projects.map{|st| st.user_id}.join(",") + ")" %> <% student_work_groups = @homework.student_works.where("user_id in #{user_ids}").order("created_at asc") %> -<% anon_count = student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %> +<% anon_count = student_work.student_works_scores.where("reviewer_role = 3 and appeal_status != 3").group_by(&:user_id).count %> <% student_work_groups.each_with_index do |st, j| %> <% score_open = @is_teacher || @homework.score_open == 1 || st.user == User.current %>
    diff --git a/app/views/student_work/_score_appeal_box.html.erb b/app/views/student_work/_score_appeal_box.html.erb new file mode 100644 index 000000000..4d04208f5 --- /dev/null +++ b/app/views/student_work/_score_appeal_box.html.erb @@ -0,0 +1,40 @@ +
    +
    +

    匿评成绩申诉

    + +
    +
    + <%= form_for('appeal',:url =>{:controller => 'student_work',:action => 'appeal_anonymous_score',:score_id => @student_work_score.id, :is_last => @is_last}, + :method => "post", :remote => true) do |f|%> +
    +
    + + <%= f.text_area 'comment', :id => 'appeal_comment', :style => 'height: 70px; width: 414px;', :placeholder => "请输入你的申诉理由,最多250个字符。",:maxlength => 250 %> +

    请输入申诉理由

    +
    + 教师或者助教将受到您的申诉
    + 申诉被接受后,此匿评成绩将被废弃,且评阅人的作品将被违规扣分 +
    + +
    + 确定 + 取消 +
    + +
    + <% end%> +
    + \ No newline at end of file diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb index 59b8d0ab2..1db52169f 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -53,6 +53,14 @@
    +<% if @is_evaluation && !@stundet_works.empty? %> +
    + 不参与匿评将直接影响作业成绩,请按照事实进行评分
    +

    为了保障匿评的公平,允许学生对不合理的匿评成绩进行申诉

    +

    若您给出了不合理的匿评成绩,并被申诉成功,您自己的作品将被匿评违规扣分

    +
    +<% end %> +
    <% if @homework.homework_type != 3%> <% if @is_evaluation && !@stundet_works.empty? %> @@ -61,7 +69,7 @@ <%= render :partial => "evaluation_un_title"%> <% end%> <% else %> - <% if !@is_teacher && @is_evaluation && !@stundet_works.empty? %> + <% if @is_evaluation && !@stundet_works.empty? %> <%= render :partial => "evaluation_title"%> <% else %> <%= render :partial => "evaluation_un_group"%> diff --git a/app/views/student_work/_student_work_score.html.erb b/app/views/student_work/_student_work_score.html.erb index 954dc79d5..29d1b2003 100644 --- a/app/views/student_work/_student_work_score.html.erb +++ b/app/views/student_work/_student_work_score.html.erb @@ -14,7 +14,20 @@ <% end %> 回复 - + <% if @homework.anonymous_appeal == 1 %> + <% if score.student_work.user == User.current && score.reviewer_role == 3 && score.appeal_status == 0 %> + 申诉 + <% elsif score.reviewer_role == 3 && score.appeal_status == 1 %> + 申诉中 + <% elsif score.reviewer_role == 3 && score.appeal_status == 2 %> + 申诉已撤销 + <% elsif score.reviewer_role == 3 && score.appeal_status == 3 %> + 申诉成功 + <% elsif score.reviewer_role == 3 && score.appeal_status == 4 %> + 申诉失败 + <% end %> + <% end %> + <%=format_time score.updated_at %>
    @@ -31,6 +44,24 @@ <%= render :partial => 'add_score_reply',:locals => {:score => score,:is_last => is_last}%>
    + <% unless score.student_works_scores_appeal.nil? %> +
    + 申诉 + <% if score.appeal_status == 1 && score.student_work.user == User.current %> + 撤销申诉 + <% elsif @is_teacher && score.appeal_status == 1 %> + 接受 + 拒绝 + <% end %> + + <%=format_time score.student_works_scores_appeal.updated_at %> + +
    +

    + 申诉理由:<%= score.student_works_scores_appeal.comment%> +

    +
    + <% end %>
    <% score.journals_for_messages.order("created_on desc").each do |jour|%> @@ -41,3 +72,25 @@
    + + diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb index 9c974a57f..f7fad7088 100644 --- a/app/views/student_work/add_score.js.erb +++ b/app/views/student_work/add_score.js.erb @@ -19,7 +19,7 @@ $("#score_list_<%= @work.id%>").removeAttr("style"); $("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_work', :locals => {:student_work => @work}) %>"); $("#group_member_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'group_member_work', :locals => {:student_work => @work}) %>"); <% else %> - <% anon_count = @work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %> + <% anon_count = @work.student_works_scores.where("reviewer_role = 3 and appeal_status != 3").group_by(&:user_id).count %> $("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_member_work', :locals => {:st => @work, :anon_count => anon_count, :score_open => score_open}) %>"); <% end %> <% else %> diff --git a/app/views/student_work/alert_appeal_box.js.erb b/app/views/student_work/alert_appeal_box.js.erb new file mode 100644 index 000000000..4c75e2afc --- /dev/null +++ b/app/views/student_work/alert_appeal_box.js.erb @@ -0,0 +1,2 @@ +var htmlvalue = "<%=escape_javascript(render :partial => 'student_work/score_appeal_box') %>"; +pop_box_new(htmlvalue, 530, 400); \ No newline at end of file diff --git a/app/views/student_work/appeal_anonymous_score.js.erb b/app/views/student_work/appeal_anonymous_score.js.erb new file mode 100644 index 000000000..60470baa9 --- /dev/null +++ b/app/views/student_work/appeal_anonymous_score.js.erb @@ -0,0 +1,2 @@ +hideModal(); +$("#work_score_<%= @student_work_score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score',:locals => {:score => @student_work_score,:is_last => @is_last}) %>"); \ No newline at end of file diff --git a/app/views/student_work/deal_appeal_score.js.erb b/app/views/student_work/deal_appeal_score.js.erb new file mode 100644 index 000000000..144119400 --- /dev/null +++ b/app/views/student_work/deal_appeal_score.js.erb @@ -0,0 +1,22 @@ +hideModal(); +<% if params[:status].to_i == 3 %> + <% score_open = @is_teacher || @homework.score_open == 1 || @work.user == User.current %> + <% if @is_teacher %> + <% if @homework.homework_type == 3 %> + <% if @is_group_leader %> + $("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_work', :locals => {:student_work => @work}) %>"); + $("#group_member_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'group_member_work', :locals => {:student_work => @work}) %>"); + <% else %> + <% anon_count = @work.student_works_scores.where("reviewer_role = 3 and appeal_status != 3").group_by(&:user_id).count %> + $("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_member_work', :locals => {:st => @work, :anon_count => anon_count, :score_open => score_open}) %>"); + <% end %> + <% else %> + $("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work, :index => 1, :score_open => score_open}) %>"); + $("#work_num_<%= @work.id%>").html(num); + <% end %> + <% else %> + $("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work, :index => 1, :score_open => score_open}) %>"); + $("#work_num_<%= @work.id%>").html(num); + <% end%> +<% end %> +$("#work_score_<%= @student_work_score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score',:locals => {:score => @student_work_score,:is_last => @is_last}) %>"); \ No newline at end of file diff --git a/app/views/users/_user_message_applied.html.erb b/app/views/users/_user_message_applied.html.erb index 89084d30b..fff246b76 100644 --- a/app/views/users/_user_message_applied.html.erb +++ b/app/views/users/_user_message_applied.html.erb @@ -25,5 +25,23 @@
      <%= render :partial => "users/applied_project_content", :locals =>{:ma => ma} %>
    + + <% elsif ma && ma.applied_type == "StudentWorksScoresAppeal" %> +
      + <% applied_user = User.find(ma.applied_user_id) %> +
    • + <%= link_to image_tag(url_to_avatar(applied_user), :width => "30", :height => "30"), user_path(applied_user), :target => '_blank' %> +
    • +
    • + <%=link_to applied_user.show_name, user_path(applied_user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> + ">申诉匿评成绩: +
    • +
    • + <% homework = ma.applied.student_works_score.student_work.homework_common %> + <%= link_to homework.name, student_work_index_path(:homework => homework.id, :show_work_id => ma.applied.student_works_score.student_work_id, :tab => 2), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %> +
    • +
    • <%= time_tag(ma.created_at).html_safe %> +
    • +
    <% end %> <% end %> \ No newline at end of file diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index e59d6fce8..0561c7b7a 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -550,11 +550,8 @@ ">重新提交了作品:
  • - <%= link_to "作业标题:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.homework_common_id, :show_work_id => ma.course_message_id), + <%= link_to "作业标题:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.homework_common_id, :show_work_id => ma.course_message_id, :tab => 2), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %> - <%#= link_to truncate(ma.course_message.name,:length=>25)+'(失败原因:提交作品的人数低于2人)', student_work_index_path(:homework => ma.course_message.id), :class => "#{ma.viewed == 0 ? "c_red" : "newsGrey "}" %> - -
  • <%= time_tag(ma.created_at).html_safe %>
  • @@ -571,7 +568,7 @@ ">追加新附件了:
  • - <%= link_to "作业标题:" + ma.course_message.homework_common.name, student_work_index_path(:homework => ma.course_message.homework_common_id, :show_work_id => ma.course_message_id), + <%= link_to "作业标题:" + ma.course_message.homework_common.name, student_work_index_path(:homework => ma.course_message.homework_common_id, :show_work_id => ma.course_message_id, :tab => 2), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %> @@ -579,6 +576,36 @@
  • <%= time_tag(ma.created_at).html_safe %>
  • <% end %> + + <% if ma.course_message_type == "StudentWorksScoresAppeal" && ma.course_message %> +
      +
    • + <%=link_to image_tag(url_to_avatar(""), :width => "30", :height => "30"), "javascript:void(0);", :target => '_blank' %> +
    • +
    • + <% if ma.status == 1 %> + 匿名用户 + <% elsif ma.status == 3 || ma.status == 4 %> + <% deal_user = User.find ma.apply_result %> + <%= link_to deal_user.show_name, user_path(deal_user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> + <% end %> + "> + <% if ma.status == 1 %> + 对您的评阅发起申诉: + <% elsif ma.status == 3 %> + 接受申诉: + <% elsif ma.status == 4 %> + 拒绝申诉: + <% end %> + +
    • +
    • + <%= link_to ma.course_message.student_works_score.student_work.homework_common.name, student_work_index_path(:homework => ma.course_message.student_works_score.student_work.homework_common_id, :show_work_id => ma.course_message.student_works_score.student_work_id, :tab => 2), + :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %> +
    • +
    • <%= time_tag(ma.created_at).html_safe %>
    • +
    + <% end %> <% if ma.course_message_type == "Course" && ma.course_message %>
      diff --git a/config/routes.rb b/config/routes.rb index 4e01d006f..73605aaa9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -353,6 +353,9 @@ RedmineApp::Application.routes.draw do get 'work_canrepeat' get 'get_user_infor' post 'add_group_member' + post 'appeal_anonymous_score' + get 'alert_appeal_box' + get 'deal_appeal_score' end end From 6dfebd447c94f5faa1163281b9e9653d60326f0c Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 16 Dec 2016 14:05:14 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E7=9A=84=E8=AF=95?= =?UTF-8?q?=E5=8D=B7=E8=BF=9B=E5=85=A5=E6=9F=A5=E7=9C=8B=E9=A1=B5=E6=8A=A5?= =?UTF-8?q?500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercise_controller.rb | 2 +- app/views/exercise/_exercise_teacher.html.erb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb index 02a8400a7..79a32fc76 100644 --- a/app/controllers/exercise_controller.rb +++ b/app/controllers/exercise_controller.rb @@ -56,7 +56,7 @@ class ExerciseController < ApplicationController end end @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? - exercise_end = @exercise.end_time > Time.now + exercise_end = @exercise.end_time.nil? ? false : @exercise.end_time > Time.now if @exercise.time == -1 @can_edit_excercise = exercise_end else diff --git a/app/views/exercise/_exercise_teacher.html.erb b/app/views/exercise/_exercise_teacher.html.erb index 78bf2b7be..bf4bd7bb1 100644 --- a/app/views/exercise/_exercise_teacher.html.erb +++ b/app/views/exercise/_exercise_teacher.html.erb @@ -13,7 +13,9 @@ <% unless exercise.publish_time.nil? %> 发布时间:<%=Time.parse(h(exercise.publish_time)).strftime("%Y-%m-%d %H:%M:%S") %> <% end %> - 截止时间:<%=Time.parse(h(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") %> + <% unless exercise.end_time.nil? %> + 截止时间:<%=Time.parse(h(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") %> + <% end %> <% if exercise.time != -1 %> 测验时长:<%=exercise.time %>分钟 <% end %> From 8e20dd1a5f496776aa5bd7fdbe6b4a2f7861cb16 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 16 Dec 2016 16:30:08 +0800 Subject: [PATCH 11/13] =?UTF-8?q?issue=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E5=9B=9E=E5=A4=8D=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 3 ++- app/views/issues/_issue_replies.html.erb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 2f0b1d45e..dd2aec552 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -237,7 +237,8 @@ class IssuesController < ApplicationController end @jour_reply = Journal.new - @journals = @issue.journals.includes(:user, :details).reorder("#{Journal.table_name}.id ASC").all + @journals = @issue.journals.includes(:user, :details).reorder("#{Journal.table_name}.id desc").all + @journals = get_no_children_comments_all @journals @journals.each_with_index {|j,i| j.indice = i+1} @journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project) @journals.reverse! if User.current.wants_comments_in_reverse_order? diff --git a/app/views/issues/_issue_replies.html.erb b/app/views/issues/_issue_replies.html.erb index c23cabe1b..7b22f85f3 100644 --- a/app/views/issues/_issue_replies.html.erb +++ b/app/views/issues/_issue_replies.html.erb @@ -1,5 +1,5 @@
        - <% issue.journals.reorder("created_on desc").each do |comment| %> + <% @journals.each do |comment| %>