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

dev_course
daiao 5 years ago
commit c34bec9ff5

@ -107,7 +107,7 @@ class HomeworkCommonsController < ApplicationController
student_works = @homework.all_works student_works = @homework.all_works
@all_member_count = student_works.size @all_member_count = student_works.size
if @homework.publish_time.nil? || (@homework.publish_time > Time.now) if @homework.publish_time.blank? || (@homework.publish_time > Time.now)
@student_works = [] @student_works = []
if (params[:format] == "xlsx") || (params[:format] == "zip") if (params[:format] == "xlsx") || (params[:format] == "zip")
normal_status(-1,"作业未发布") normal_status(-1,"作业未发布")

@ -266,9 +266,11 @@ class MyshixunsController < ApplicationController
if content != last_content if content != last_content
@content_modified = 1 @content_modified = 1
author_name = current_user.full_name author_name = current_user.real_name
author_email = current_user.mail author_email = current_user.mail
message = params[:evaluate] == 0 ? "System automatically submitted" : "User submitted" message = params[:evaluate] == 0 ? "System automatically submitted" : "User submitted"
uid_logger("112233#{author_name}")
uid_logger("112233#{author_email}")
@content = GitService.update_file(repo_path: @repo_path, @content = GitService.update_file(repo_path: @repo_path,
file_path: path, file_path: path,
message: message, message: message,

@ -31,7 +31,7 @@ class ExercisePublishNotifyJob < ApplicationJob
Tiding.bulk_insert(*attrs) do |worker| Tiding.bulk_insert(*attrs) do |worker|
teacher_ids = teachers.pluck(:user_id) teacher_ids = teachers.pluck(:user_id)
unless exercise.tidings.exists?(parent_container_type: 'ExercisePublish', user_id: teacher_ids) unless exercise.tidings.exists?(parent_container_type: 'ExercisePublish', user_id: teacher_ids)
teacher_ids.find_each do |user_id| teacher_ids.each do |user_id|
worker.add same_attrs.merge(user_id: user_id) worker.add same_attrs.merge(user_id: user_id)
end end
end end

@ -2,7 +2,7 @@ class HomeworkEndUpdateScoreJob < ApplicationJob
# 不允许补交的作业截止后,或者补交截止后需要重新计算一次作业成绩 # 不允许补交的作业截止后,或者补交截止后需要重新计算一次作业成绩
queue_as :score queue_as :score
def perform(*args) def perform(homework_id)
homework = HomeworkCommon.find_by(id: homework_id) homework = HomeworkCommon.find_by(id: homework_id)
return if homework.blank? return if homework.blank?
course = homework.course course = homework.course

@ -404,7 +404,6 @@ class User < ApplicationRecord
# 用户的真实姓名(不考虑用户是否隐藏了真实姓名,课堂模块都用真实姓名) # 用户的真实姓名(不考虑用户是否隐藏了真实姓名,课堂模块都用真实姓名)
def real_name def real_name
return '游客' unless logged? return '游客' unless logged?
name = lastname + firstname name = lastname + firstname
name.blank? ? (nickname.blank? ? login : nickname) : name name.blank? ? (nickname.blank? ? login : nickname) : name
name.gsub(/\s+/, '').strip #6.11 -hs name.gsub(/\s+/, '').strip #6.11 -hs

@ -49,7 +49,7 @@ wb.styles do |s|
end #each_with_index end #each_with_index
sheet.add_row poll_users_info, :height =>15, :style => blue_cell sheet.add_row poll_users_info, :height =>15, :style => blue_cell
poll_users.each_with_index do |u,index| poll_users.includes(user: :user_extension).each_with_index do |u,index|
u_user = u.user u_user = u.user
user_answer_array = [] user_answer_array = []
poll_questions.each do |q| poll_questions.each do |q|

Loading…
Cancel
Save