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

dev_forum
cxt 6 years ago
commit 4c2bec18ea

@ -402,7 +402,7 @@ class ExercisesController < ApplicationController
:position => c.position,
:challenge_id => c.challenge_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.save

@ -1184,7 +1184,7 @@ class PollsController < ApplicationController
def check_poll_commit_result
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) #当前用户已提交问卷的
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,"没有权限!") #当前为老师/问卷公开统计,且问卷已截止,且用户有过回答的
end
end

@ -13,7 +13,8 @@ module ExercisesHelper
ques_score = q.exercise_answers.search_answer_users("user_id",user_id).score_reviewed.pluck(:score).sum
end
if ques_score == q.question_score #满分作答为正确
if ques_score >= q.question_score #满分作答为正确
ques_score = q.question_score
stand_answer = 1
elsif ques_score > 0.0 #部分作答
stand_answer = 2
@ -35,7 +36,8 @@ module ExercisesHelper
exercise_sub_status.each do |s|
sub_answer = s.exercise_answers.search_answer_users("user_id",user_id) #主观题只有一个回答
if sub_answer.present? && sub_answer.first.score >= 0.0
if s.question_score == sub_answer.first.score
if s.question_score <= sub_answer.first.score
stand_status = 1
else
stand_status = 2

@ -145,7 +145,8 @@ class Poll < ApplicationRecord
end
if poll_answer_user.present? && poll_answer_user.start_at.blank? && user_poll_status == 3
user_status = 4
# user_status = 4
user_status = 5 #问卷用户存在,且未开始答题,且问卷已截止时,返回未提交标示
end
user_status

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

Loading…
Cancel
Save