题库的tiaozn

dev_aliyun_beta
cxt 5 years ago
parent c7be68d254
commit 6aa6482f8c

@ -88,7 +88,7 @@ class QuestionBanksController < ApplicationController
end
def send_to_course
banks = object_banks
banks = @object_type.classify.constantize.where(id: params[:object_id])
course = current_user.manage_courses.find_by!(id: params[:course_id])
banks.each do |bank|
case @object_type

@ -2,6 +2,7 @@ if @bank.container_type == "Exercise"
json.exercise do
json.extract! @bank, :id, :name, :description, :is_public
end
json.authorize @bank.user_id == current_user.id || current_user.admin?
json.partial! "exercises/exercise_scores"
@ -20,6 +21,7 @@ else
json.poll do
json.extract! @bank, :id, :name, :description, :is_public
end
json.authorize @bank.user_id == current_user.id || current_user.admin?
json.question_types do
json.q_counts @poll_questions_count

@ -1,6 +1,7 @@
json.partial! "public_navigation", locals: {graduation: @task, course: @course}
json.description @task.description
json.user_id @task.user_id
json.authorize @task.user_id == current_user.id || current_user.admin?
# 附件
json.attachments @attachments do |attachment|
json.partial! "attachments/attachment_simple", locals: {attachment: attachment}

@ -1,5 +1,6 @@
json.(@bank, :id, :name, :description, :is_public, :topic_type, :topic_source, :topic_property_first, :topic_property_second,
:source_unit, :topic_repeat, :province, :city)
json.authorize @bank.user_id == current_user.id || current_user.admin?
json.attachment_list @bank_attachments do |attachment|
json.partial! "attachments/attachment_simple", locals: {attachment: attachment}

@ -1,4 +1,5 @@
json.(@bank, :id, :name, :description, :homework_type, :is_public, :min_num, :max_num, :base_on_project, :reference_answer)
json.authorize @bank.user_id == current_user.id || current_user.admin?
json.attachments @bank_attachments do |attachment|
json.partial! "attachments/attachment_simple", locals: {attachment: attachment}

Loading…
Cancel
Save