dev_new_shixunsrepository
cxt 5 years ago
parent d12c747edc
commit c9ec75373c

@ -3,6 +3,15 @@ class ExerciseAnswersController < ApplicationController
before_action :get_exercise_question
include ExercisesHelper
# model validation error
rescue_from ActiveRecord::RecordInvalid do |ex|
render_error(ex.record.errors.full_messages.join(','))
end
# form validation error
rescue_from ActiveModel::ValidationError do |ex|
render_error(ex.model.errors.full_messages.join(','))
end
def create #每一次答案的点击,请求一次,实训题不在这里回答
begin
q_type = @exercise_question.question_type #试卷的类型

@ -24,6 +24,15 @@ class ExercisesController < ApplicationController
include ExportHelper
include ExercisesHelper
# model validation error
rescue_from ActiveRecord::RecordInvalid do |ex|
render_error(ex.record.errors.full_messages.join(','))
end
# form validation error
rescue_from ActiveModel::ValidationError do |ex|
render_error(ex.model.errors.full_messages.join(','))
end
def index
begin
# 按发布时间或创建时间排序

Loading…
Cancel
Save