|
|
@ -17,7 +17,7 @@ class ZipsController < ApplicationController
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def export_exercises
|
|
|
|
def export_exercises
|
|
|
|
exercises = ExportExercisesService.new(@exercise,@ex_users,@request_url)
|
|
|
|
exercises = ExportExercisesService.new(@exercise,@ex_users)
|
|
|
|
|
|
|
|
|
|
|
|
file_name = filename_for_content_disposition(exercises.filename)
|
|
|
|
file_name = filename_for_content_disposition(exercises.filename)
|
|
|
|
send_file exercises.ex_zip, filename: file_name, type: 'application/zip'
|
|
|
|
send_file exercises.ex_zip, filename: file_name, type: 'application/zip'
|
|
|
@ -41,7 +41,6 @@ class ZipsController < ApplicationController
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
begin
|
|
|
|
begin
|
|
|
|
@exercise = Exercise.includes(:exercise_users,:exercise_questions).find_by(id:params[:exercise_id])
|
|
|
|
@exercise = Exercise.includes(:exercise_users,:exercise_questions).find_by(id:params[:exercise_id])
|
|
|
|
@request_url = request.base_url
|
|
|
|
|
|
|
|
group_id = params[:exercise_group_id]
|
|
|
|
group_id = params[:exercise_group_id]
|
|
|
|
if @exercise.blank?
|
|
|
|
if @exercise.blank?
|
|
|
|
normal_status(-1,"试卷不存在")
|
|
|
|
normal_status(-1,"试卷不存在")
|
|
|
|