相关路由
This commit is contained in:
parent
466f3c4cc3
commit
70c5b27a43
|
@ -0,0 +1,39 @@
|
||||||
|
class ExerciseController < ApplicationController
|
||||||
|
layout "base_courses"
|
||||||
|
|
||||||
|
before_filter :find_course, :only => [:index,:new,:create]
|
||||||
|
def index
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def find_course
|
||||||
|
@course = Course.find params[:course_id]
|
||||||
|
rescue Exception => e
|
||||||
|
render_404
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,3 @@
|
||||||
|
# encoding: utf-8
|
||||||
|
module ExerciseHelper
|
||||||
|
end
|
|
@ -39,6 +39,7 @@ class Course < ActiveRecord::Base
|
||||||
has_many :course_activities
|
has_many :course_activities
|
||||||
# 课程消息
|
# 课程消息
|
||||||
has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy
|
has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy
|
||||||
|
has_many :exercises, :dependent => :destroy
|
||||||
|
|
||||||
acts_as_taggable
|
acts_as_taggable
|
||||||
acts_as_nested_set :order => 'name', :dependent => :destroy
|
acts_as_nested_set :order => 'name', :dependent => :destroy
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
111111111111
|
|
@ -0,0 +1 @@
|
||||||
|
111111
|
|
@ -157,6 +157,11 @@
|
||||||
<%= link_to "(#{course_poll_count})", poll_index_path(:polls_type => "Course", :polls_group_id => @course.id), :class => "subnav_num c_orange" %>
|
<%= link_to "(#{course_poll_count})", poll_index_path(:polls_type => "Course", :polls_group_id => @course.id), :class => "subnav_num c_orange" %>
|
||||||
<%= link_to( "+#{l(:label_new_poll)}", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'subnav_green c_white') if is_teacher %>
|
<%= link_to( "+#{l(:label_new_poll)}", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'subnav_green c_white') if is_teacher %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="subNav">
|
||||||
|
<%= link_to "在线测验", exercise_index_path(:course_id => @course.id), :class => " f14 c_blue02"%>
|
||||||
|
<%= link_to "(#{@course.exercises.count})", exercise_index_path(:course_id => @course.id), :class => "subnav_num c_orange" %>
|
||||||
|
<%= link_to( "+新建试卷", new_exercise_path(:course_id => @course.id), :class => 'subnav_green c_white') if is_teacher %>
|
||||||
|
</div>
|
||||||
</div><!--项目侧导航 end-->
|
</div><!--项目侧导航 end-->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="project_intro">
|
<div class="project_intro">
|
||||||
|
|
|
@ -96,6 +96,15 @@ RedmineApp::Application.routes.draw do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#show、index、new、create、edit、update、destroy路由自动生成
|
||||||
|
resources :exercise do
|
||||||
|
member do #生成路径为 /exercise/:id/方法名
|
||||||
|
end
|
||||||
|
|
||||||
|
collection do #生成路径为 /exercise/方法名
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
resources :homework_common, :except => [:show]do
|
resources :homework_common, :except => [:show]do
|
||||||
member do
|
member do
|
||||||
get 'start_anonymous_comment'
|
get 'start_anonymous_comment'
|
||||||
|
|
Loading…
Reference in New Issue