Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_forum
cxt 5 years ago
commit f97c97abc7

@ -200,7 +200,7 @@ class FilesController < ApplicationController
# 资源设置
def update
return normal_status(403, "您没有权限进行该操作") unless current_user.teacher_or_admin?(@course) || @file.author == current_user
return normal_status(403, "您没有权限进行该操作") if current_user.course_identity(@course) >= 5 && @file.author != current_user
is_unified_setting = params[:is_unified_setting]
publish_time = params[:publish_time]

@ -129,7 +129,7 @@ class GraduationTasksController < ApplicationController
if @user_course_identity >= Course::STUDENT
tip_exception(403, "无权限操作")
elsif complete_works == 0
normal_status(-1,"暂无提交的学生")
normal_status(-1,"暂无用户提交!")
else
respond_to do |format|
format.xlsx{

@ -200,7 +200,7 @@ class HomeworkCommonsController < ApplicationController
if @user_course_identity >= Course::STUDENT
tip_exception(403, "无权限操作")
elsif complete_works == 0
normal_status(-1,"暂无提交的学生")
normal_status(-1,"暂无用户提交!")
else
respond_to do |format|
format.xlsx{

@ -44,9 +44,12 @@ class ZipsController < ApplicationController
ActiveRecord::Base.transaction do
begin
@exercise = Exercise.includes(:exercise_users,:exercise_questions).find_by(id:params[:exercise_id])
@exercise_status = @exercise.get_exercise_status(current_user.id)
group_id = params[:exercise_group_id]
if @exercise.blank?
normal_status(-1,"试卷不存在")
elsif @exercise_status == 1
normal_status(-1,"试卷未发布")
else
@course = @exercise.course
default_ex_users = @exercise.all_exercise_users(current_user.id).exercise_user_committed
@ -66,7 +69,7 @@ class ZipsController < ApplicationController
if params[:commit_status].present? && (params[:commit_status].to_i == 1)
@exercise_users_list = @exercise_users_list.where(commit_status:params[:commit_status])
elsif params[:commit_status].present? && (params[:commit_status].to_i == 0)
normal_status(-1,"仅支持导出已提交的学生")
normal_status(-1,"暂无用户提交")
end
#可以分班选择
@ -84,7 +87,7 @@ class ZipsController < ApplicationController
default_ex_users_size = @ex_users&.size
if default_ex_users_size.blank? || default_ex_users_size == 0
normal_status(-1,"导出失败,暂时没有已提交的学生")
normal_status(-1,"暂无用户提交")
elsif default_ex_users_size > 100
normal_status(-2,"100")
end
@ -98,6 +101,8 @@ class ZipsController < ApplicationController
def load_homework
@homework = HomeworkCommon.find(params[:homework_common_id])
@course = @homework.course
##7。2 -hs新增
@member = @course.course_member(current_user.id)
@ -121,7 +126,7 @@ class ZipsController < ApplicationController
student_work_sizes = @all_student_works&.size
if student_work_sizes.blank? || student_work_sizes == 0
normal_status(-1,"导出失败,暂时没有已提交的学生")
normal_status(-1,"暂无用户提交")
elsif student_work_sizes > 100
normal_status(-2,"100")
end

@ -45,7 +45,8 @@ class ExportShixunReportService
@games = @work.myshixun.games.includes(:challenge, :game_codes,:outputs) if @work.myshixun
# 用户最大评测次数
@user_evaluate_count = @games.inject(0){|sum, g| sum + g.outputs.pluck(:query_index).first } if @games
@user_evaluate_count = @games.pluck(:evaluate_count).sum if @games
# @user_evaluate_count = @games.inject(0){|sum, g| sum + g.outputs.pluck(:query_index)&.first } if @games
# 图形效率图的数据
@echart_data = student_efficiency(homework, @work)
@myself_eff = @echart_data[:efficiency_list].find { |item| item.last == @user.id }

Loading…
Cancel
Save