页面修改

This commit is contained in:
cxt 2015-11-17 19:49:33 +08:00
parent 7472d959f3
commit bb99a11c37
2 changed files with 4 additions and 5 deletions

View File

@ -2,7 +2,7 @@ class ExerciseController < ApplicationController
layout "base_courses"
before_filter :find_exercise_and_course, :only => [:create_exercise_question]
before_filter :find_course, :only => [:index,:new,:create,:student_exercise_list,:edit]
before_filter :find_course, :only => [:index,:new,:student_exercise_list,:edit]
def index
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
@ -46,7 +46,7 @@ class ExerciseController < ApplicationController
:time => Time.now,
:end_time => Time.now,
:publish_time => Time.now,
:polls_description => ""
:exercise_description => ""
}
@exercise = Exercise.create option
if @exercise
@ -76,7 +76,6 @@ class ExerciseController < ApplicationController
end
def edit
@exercise = Exercise.find params[:id]
respond_to do |format|
format.html{render :layout => 'base_courses'}
end
@ -113,7 +112,7 @@ class ExerciseController < ApplicationController
# 添加题目
# question_type 1单选 2多选 3填空题
def create_exercise_question
question_title = params[:exercise_questions_title].nil? || params[:poll_questions_title].empty? ? l(:label_enter_single_title) : params[:poll_questions_title]
question_title = params[:question_title].nil? || params[:question_title].empty? ? l(:label_enter_single_title) : params[:question_title]
option = {
:question_title => question_title,
:question_type => params[:question_type] || 1,

View File

@ -9,7 +9,7 @@
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>
<input name="question_type" value="1" type="hidden">
<input name="questions_title" class="questionTitle" placeholder="请输入单选题题目" type="text">
<input name="question_title" id="question_title" class="questionTitle" placeholder="请输入单选题题目" type="text">
</div>
<div class="ur_editor_content">
<ul>