Merge branch 'sw_new_course' of http://repository.trustie.net/xianbo/trustie2 into sw_new_course
This commit is contained in:
commit
28f7390595
|
@ -1,7 +1,7 @@
|
|||
class ExerciseController < ApplicationController
|
||||
layout "base_courses"
|
||||
|
||||
before_filter :find_exercise_and_course, :only => [:create_exercise_question, :edit, :update, :show]
|
||||
before_filter :find_exercise_and_course, :only => [:create_exercise_question, :edit, :update, :show, :destroy]
|
||||
before_filter :find_course, :only => [:index,:new,:create,:student_exercise_list]
|
||||
include ExerciseHelper
|
||||
|
||||
|
@ -102,7 +102,17 @@ class ExerciseController < ApplicationController
|
|||
end
|
||||
|
||||
def destroy
|
||||
|
||||
if @exercise && @exercise.destroy
|
||||
if @is_teacher
|
||||
exercises = Exercise.where("course_id =?", @course.id)
|
||||
else
|
||||
exercises = Exercise.where("course_id =? and exercise_status =?", @course.id, 2)
|
||||
end
|
||||
@exercises = paginateHelper exercises,20 #分页
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# 统计结果
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
$("#exercise").html("<%= escape_javascript(render :partial => 'exercises_list') %>");
|
|
@ -1,4 +1,4 @@
|
|||
<%= stylesheet_link_tag 'polls', :media => 'all' %>
|
||||
<div class="polls_content02" id="polls">
|
||||
<div class="polls_content02" id="exercise">
|
||||
<%= render :partial => 'exercises_list'%>
|
||||
</div><!--问卷内容end-->
|
Loading…
Reference in New Issue