|
|
@ -20,8 +20,9 @@ class ZipsController < ApplicationController
|
|
|
|
exercises = ExportExercisesService.new(@exercise,@ex_users)
|
|
|
|
exercises = ExportExercisesService.new(@exercise,@ex_users)
|
|
|
|
|
|
|
|
|
|
|
|
file_name = filename_for_content_disposition(exercises.filename)
|
|
|
|
file_name = filename_for_content_disposition(exercises.filename)
|
|
|
|
logger.info("##################_______________________file_name_____________________############{file_name}")
|
|
|
|
|
|
|
|
send_file exercises.ex_zip, filename: file_name, type: 'application/zip'
|
|
|
|
send_file exercises.ex_zip, filename: file_name, type: 'application/zip'
|
|
|
|
|
|
|
|
logger.info("##################_______________________file_name___________1100101010010__________###########")
|
|
|
|
|
|
|
|
|
|
|
|
rescue Exception => e
|
|
|
|
rescue Exception => e
|
|
|
|
normal_status(-1, e.message)
|
|
|
|
normal_status(-1, e.message)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -40,7 +41,7 @@ class ZipsController < ApplicationController
|
|
|
|
def get_exercise
|
|
|
|
def get_exercise
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
begin
|
|
|
|
begin
|
|
|
|
@exercise = Exercise.includes(:exercise_users).find_by(id:params[:exercise_id])
|
|
|
|
@exercise = Exercise.includes(:exercise_users,:exercise_questions).find_by(id:params[:exercise_id])
|
|
|
|
group_id = params[:exercise_group_id]
|
|
|
|
group_id = params[:exercise_group_id]
|
|
|
|
if @exercise.blank?
|
|
|
|
if @exercise.blank?
|
|
|
|
normal_status(-1,"试卷不存在")
|
|
|
|
normal_status(-1,"试卷不存在")
|
|
|
|