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/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb
index b79964a8d..4a7cb900d 100644
--- a/app/views/courses/_course_activity.html.erb
+++ b/app/views/courses/_course_activity.html.erb
@@ -76,11 +76,13 @@
}
$("#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();
});
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 %>