diff --git a/app/controllers/poll_answer_controller.rb b/app/controllers/poll_answer_controller.rb deleted file mode 100644 index 521f7ed3f..000000000 --- a/app/controllers/poll_answer_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class PollAnswerController < ApplicationController -end \ No newline at end of file diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb deleted file mode 100644 index fbfef025e..000000000 --- a/app/controllers/poll_controller.rb +++ /dev/null @@ -1,112 +0,0 @@ -class PollController < ApplicationController - before_filter :find_poll_and_course, :only => [:edit,:update,:destory] - before_filter :find_container, :only => [:new,:create, :index] - - def index - if @course - @polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}") - respond_to do |format| - format.html{render :layout => 'base_courses'} - end - elsif @project - #项目的问卷调查相关代码 - end - end - - def show - @poll = Poll.find params[:id] - end - - def new - if @course - option = { - :polls_name => "未命名问卷", - :polls_type => @course.class.to_s, - :polls_group_id => @course.id, - :polls_status => 1, - :user_id => User.current.id, - :published_at => Time.now, - :closed_at => Time.now, - :polls_description => "" - } - @poll = Poll.create option - if @poll - respond_to do |format| - format.html{render :layout => 'base_courses'} - end - end - elsif @project - #项目的问卷调查相关代码 - end - end - - def create - end - - def edit - respond_to do |format| - format.html{render :layout => 'base_courses'} - end - end - - def update - @poll.polls_name = params[:polls_name] - if @poll.save - respond_to do |format| - format.html { redirect_to poll_index_url(:polls_type => @course.class.to_s, :polls_group_id => @course.id) } - end - else - end - end - - def destroy - if @poll.destroy - respond_to do |format| - format.js - end - end - end - - #修改问卷标题和描述 - def save_polls - - end - - #添加问题 - def add_question - end - - #添加选项 - def add_answer - puts '1111111111111' - end - - #选答案 - def vote - end - - #统计 - def statistics - end - - private - def find_poll_and_course - @poll = Poll.find params[:id] - @course = Course.find @poll.polls_group_id - rescue Exception => e - render_404 - end - - def find_container - if params[:polls_type] && params[:polls_group_id] - case params[:polls_type] - when "Course" - @course = Course.find_by_id params[:polls_group_id] - when "Project" - @project = Project.find_by_id params[:polls_group_id] - end - else - render_404 - end - end -end \ No newline at end of file diff --git a/app/controllers/poll_question_controller.rb b/app/controllers/poll_question_controller.rb deleted file mode 100644 index 46a75c0ab..000000000 --- a/app/controllers/poll_question_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class PollQuestionController < ApplicationController -end \ No newline at end of file diff --git a/app/controllers/poll_user_controller.rb b/app/controllers/poll_user_controller.rb deleted file mode 100644 index 0373fe085..000000000 --- a/app/controllers/poll_user_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class PollUserController < ApplicationController -end \ No newline at end of file diff --git a/app/controllers/poll_vote_controller.rb b/app/controllers/poll_vote_controller.rb deleted file mode 100644 index e77bdc622..000000000 --- a/app/controllers/poll_vote_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class PollVoteController < ApplicationController -end \ No newline at end of file