dev_forum
SylorHuang 5 years ago
parent 4303995003
commit de0aa8bcdd

@ -205,15 +205,15 @@ class PollsController < ApplicationController
@is_teacher_or = 1
@user_poll_answer = 3 #教师页面
end
poll_status = @poll.get_poll_status(current_user)
@poll_status = @poll.get_poll_status(current_user)
poll_id_array = [@poll.id]
@poll_publish_count = get_user_permission_course(poll_id_array,2).count #是否存在已发布的
@poll_unpublish_count = get_user_permission_course(poll_id_array,1).count #是否存在未发布的
if (@poll_publish_count == 0) && (@poll_unpublish_count == 0) #即表示没有分班
if poll_status == 1
if @poll_status == 1
@poll_unpublish_count = 1 #试卷未发布,且课堂没有分班的时候
elsif poll_status == 2
elsif @poll_status == 2
@poll_publish_count = 1 #试卷未发布,且课堂没有分班的时候
end
end

@ -1,5 +1,6 @@
json.course_is_end @course.is_end # true表示已结束false表示未结束
json.extract! @poll, :id,:polls_name,:polls_description,:polls_status,:show_result
json.extract! @poll, :id,:polls_name,:polls_description,:show_result
json.polls_status @poll_status
json.user_permission do
json.is_teacher_or @is_teacher_or

Loading…
Cancel
Save