|
|
|
@ -11,7 +11,12 @@ class HomeworkBanksController < ApplicationController
|
|
|
|
|
|
|
|
|
|
def update
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|
@bank.update_attributes(name: params[:name], description: params[:description], reference_answer: params[:reference_answer])
|
|
|
|
|
if @bank.homework_type == 1
|
|
|
|
|
@bank.update_attributes(name: params[:name], description: params[:description], reference_answer: params[:reference_answer])
|
|
|
|
|
elsif @bank.homework_type == 3
|
|
|
|
|
@bank.update_attributes(name: params[:name], description: params[:description], reference_answer: params[:reference_answer],
|
|
|
|
|
base_on_project: params[:base_on_project], min_num: params[:min_num], max_num: params[:max_num])
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 作业描述的附件
|
|
|
|
|
Attachment.associate_container(params[:attachment_ids], @bank.id, @bank.class) if params[:attachment_ids]
|
|
|
|
|