diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb
index 9e3a4b836..7793ef097 100644
--- a/app/controllers/homework_common_controller.rb
+++ b/app/controllers/homework_common_controller.rb
@@ -6,8 +6,8 @@ class HomeworkCommonController < ApplicationController
include StudentWorkHelper
before_filter :find_course, :only => [:index,:new,:create]
- before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr]
- before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,:start_evaluation_set,:set_evaluation_attr]
+ before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr,:score_rule_set]
+ before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,:start_evaluation_set,:set_evaluation_attr,:score_rule_set]
before_filter :member_of_course, :only => [:index]
def index
@@ -215,6 +215,11 @@ class HomeworkCommonController < ApplicationController
end
end
+ #评分设置
+ def score_rule_set
+
+ end
+
private
#获取课程
def find_course
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index e5e1bf391..529c5ea72 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -457,7 +457,13 @@ class StudentWorkController < ApplicationController
end
end
respond_to do |format|
- format.html{redirect_to student_work_index_url(:homework => @homework.id)}
+ format.html{
+ if params[:student_path]
+ redirect_to student_work_index_url(:homework => @homework.id)
+ else
+ redirect_to user_homeworks_user_path(User.current.id)
+ end
+ }
end
end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index ce11bded8..7289d534b 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -2357,8 +2357,10 @@ module ApplicationHelper
if work.nil?
link_to "提交作品", new_student_work_path(:homework => homework.id),:class => 'c_blue'
else
- if homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前
+ if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前
link_to "作品匿评", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品"
+ elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
+ link_to "匿评结束", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "匿评已结束"
elsif homework.homework_type == 2 #编程作业不能修改作品
link_to "修改作品", new_student_work_path(:homework => homework.id),:class => 'c_blue'
else
diff --git a/app/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb
index aa99236df..4a7cb900d 100644
--- a/app/views/courses/_course_activity.html.erb
+++ b/app/views/courses/_course_activity.html.erb
@@ -68,13 +68,24 @@
}
}
- function expand_reply_input(id) {
- $(id).toggle();
- }
-
$(function () {
init_activity_KindEditor_data(<%= activity.id%>, null, "87%");
showNormalImage('activity_description_<%= activity.id %>');
+ if($("#intro_content_<%= activity.id %>").height() > 360) {
+ $("#intro_content_show_<%= activity.id %>").show();
+ }
+ $("#intro_content_show_<%= activity.id %>").click(function(){
+ $("#activity_description_<%= activity.id %>").toggleClass("maxh360");
+ $("#activity_description_<%= activity.id%>").toggleClass("lh18");
+ $("#intro_content_show_<%= activity.id %>").hide();
+ $("#intro_content_hide_<%= activity.id %>").show();
+ });
+ $("#intro_content_hide_<%= activity.id %>").click(function(){
+ $("#activity_description_<%= activity.id %>").toggleClass("maxh360");
+ $("#activity_description_<%= activity.id%>").toggleClass("lh18");
+ $("#intro_content_hide_<%= activity.id %>").hide();
+ $("#intro_content_show_<%= activity.id %>").show();
+ });
});
<% if activity && activity.course_act%>
diff --git a/app/views/homework_common/score_rule_set.js.erb b/app/views/homework_common/score_rule_set.js.erb
new file mode 100644
index 000000000..5ff42dff7
--- /dev/null
+++ b/app/views/homework_common/score_rule_set.js.erb
@@ -0,0 +1,6 @@
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false}) %>');
+showModal('ajax-modal', '350px');
+$('#ajax-modal').siblings().remove();
+$('#ajax-modal').before("" +
+ "");
+$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
\ No newline at end of file
diff --git a/app/views/student_work/_set_score_rule.html.erb b/app/views/student_work/_set_score_rule.html.erb
index 7deed7fb8..508b89a1c 100644
--- a/app/views/student_work/_set_score_rule.html.erb
+++ b/app/views/student_work/_set_score_rule.html.erb
@@ -1,4 +1,7 @@
<%= form_for('new_form',:url => {:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id},:method => "post") do |f|%>
+ <% if student_path %>
+ <%=hidden_field_tag 'student_path', params[:student_path], :value => student_path %>
+ <% end %>