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

dev_forum
daiao 6 years ago
commit 67cf71b2f8

@ -427,15 +427,6 @@ class ExerciseQuestionsController < ApplicationController
delete_answer = question_choices.find_by(choice_position: choice_d_id)
left_choices = question_choices.where("choice_position > ? ",choice_d_id)
left_choices.update_all("choice_position = choice_position - 1") if left_choices
# delete_answer = question_choices.find_choice_custom("choice_position",choice_d_id).first
#
# left_choice = question_choices.left_choice_choose("choice_position",choice_d_id)
# if left_choice.present?
# left_choice.each do |p|
# p.choice_position -= 1
# p.save
# end
# end
if delete_answer.destroy
normal_status(0, "答案删除成功!")
else
@ -456,13 +447,6 @@ class ExerciseQuestionsController < ApplicationController
exercise_questions = @exercise.exercise_questions
left_questions = exercise_questions.where("question_number > ?", question_d_id)
left_questions.update_all("question_number = question_number - 1") if left_questions
# left_question = exercise_questions.left_question_choose("question_number",question_d_id)
# if left_question.present?
# left_question.each do |q|
# q.question_number -= 1
# q.save
# end
# end
if @exercise_question.destroy
normal_status(0, "问题删除成功!")
else

@ -160,14 +160,6 @@ class PollQuestionsController < ApplicationController
left_answers = poll_answers.where("answer_position > ?",answer_d_id)
left_answers.update_all("answer_position = answer_position - 1") if left_answers
# delete_answer = poll_answers.find_answer_by_custom("answer_position",answer_d_id).first
# left_answer = poll_answers.left_answer_choose("answer_position",answer_d_id)
# if left_answer.present?
# left_answer.each do |p|
# p.answer_position -= 1
# p.save
# end
# end
if delete_answer.destroy
normal_status(0, "答案删除成功!")
else

@ -557,7 +557,7 @@ class ShixunsController < ApplicationController
# HomeworksService.new.update_myshixun_work_status myshixun
UpdateMyshixunWorkStatusJob.perform_later(myshixun.id)
@current_task = myshixun.current_task
@current_task = myshixun.current_task(myshixun.games)
uid_logger("## shixun exec: myshixun id is #{myshixun.id}")
rescue Exception => e
uid_logger_error(e.message)

@ -61,12 +61,12 @@ class StudentWork < ApplicationRecord
# 当前用户该作品的匿评申诉总条数
def my_appeal_all_count user_id
student_works_scores.select{|score| score.reviewer_role == 3 && score.appeal_status != 0 && score.user_id = user_id}.size
student_works_scores.select{|score| score.reviewer_role == 3 && score.appeal_status != 0 && score.user_id == user_id}.size
end
# 当前用户该作品的匿评申诉总条数
def my_appeal_deal_count user_id
student_works_scores.select{|score| score.reviewer_role == 3 && score.appeal_status == 1 && score.user_id = user_id}.size
student_works_scores.select{|score| score.reviewer_role == 3 && score.appeal_status == 1 && score.user_id == user_id}.size
end
# 分组名

Loading…
Cancel
Save