dev_forum
SylorHuang 5 years ago
parent d44ada3751
commit 939a536d3a

@ -402,7 +402,7 @@ class ExercisesController < ApplicationController
:position => c.position, :position => c.position,
:challenge_id => c.challenge_id, :challenge_id => c.challenge_id,
:shixun_id => q.shixun_id, :shixun_id => q.shixun_id,
:question_score => q.question_score :question_score => c.question_score
} }
shixun_challenge_bank = exercise_bank_question.exercise_bank_shixun_challenges.new challenge_option shixun_challenge_bank = exercise_bank_question.exercise_bank_shixun_challenges.new challenge_option
shixun_challenge_bank.save shixun_challenge_bank.save

@ -951,7 +951,6 @@ class PollsController < ApplicationController
def poll_lists def poll_lists
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
begin begin
@poll_new_users = @poll.poll_users.find_by(user_id:current_user.id)
poll_ids = [@poll.id] poll_ids = [@poll.id]
@poll_list_status = @poll.get_poll_status(current_user.id) @poll_list_status = @poll.get_poll_status(current_user.id)
@poll_publish_count = get_user_permission_course(poll_ids,2).count @poll_publish_count = get_user_permission_course(poll_ids,2).count
@ -1185,7 +1184,7 @@ class PollsController < ApplicationController
def check_poll_commit_result def check_poll_commit_result
poll_status = @poll.get_poll_status(current_user.id) poll_status = @poll.get_poll_status(current_user.id)
commit_poll_user = @poll.poll_users.find_by_group_ids(current_user.id).commit_by_status(1) #当前用户已提交问卷的 commit_poll_user = @poll.poll_users.find_by_group_ids(current_user.id).commit_by_status(1) #当前用户已提交问卷的
unless (@user_course_identity < Course::STUDENT) || (@poll.show_result && poll_status == 3 && commit_poll_user.present?) unless (@user_course_identity < Course::STUDENT) || ((@poll.show_result == 1) && (poll_status == 3) && commit_poll_user.present?)
normal_status(-1,"没有权限!") #当前为老师/问卷公开统计,且问卷已截止,且用户有过回答的 normal_status(-1,"没有权限!") #当前为老师/问卷公开统计,且问卷已截止,且用户有过回答的
end end
end end

@ -1,7 +1,6 @@
json.course do json.course do
json.partial! "polls/course_name",locals:{course:@course} json.partial! "polls/course_name",locals:{course:@course}
end end
json.current_poll_user @poll_new_users.present? ? @poll_new_users.id : "---"
json.poll_types do json.poll_types do
if @poll_current_user_status == 0 if @poll_current_user_status == 0
json.published_count @poll_publish_count json.published_count @poll_publish_count

Loading…
Cancel
Save