代码查重检索功能

dev_course
daiao 5 years ago
parent 74a5c849b0
commit e173cae390

@ -1321,7 +1321,7 @@ class HomeworkCommonsController < ApplicationController
.where(:user_id => user_ids).joins(user: :user_extension)
# 按学号和姓名搜索
if params[:search]
@users_reviews = @users_reviews.where("concat(lastname, firstname) like ? or student_id like ?", params[:search], params[:search])
@users_reviews = @users_reviews.where("concat(lastname, firstname) like :keyword or student_id like :keyword", keyword: "%#{params[:search]}%")
end
# 抄袭作品数
@copy_reviews_count = @users_reviews.count

@ -89,11 +89,7 @@ module ExercisesHelper
if ex.question_type <= 2 #单选题
standard_answer = ex.exercise_standard_answers.pluck(:exercise_choice_id) #标准答案的位置
ex.exercise_choices.each do |c|
if standard_answer.include?(c.choice_position) #选项的标准答案为选项的位置
right_answer = true
else
right_answer = false
end
right_answer = standard_answer.include?(c.choice_position) #选项的标准答案为选项的位置
answer_this_choice = effictive_users.search_exercise_answer("exercise_choice_id",c.id)
answer_users_count = answer_this_choice.count
if effictive_users_count == 0
@ -176,11 +172,7 @@ module ExercisesHelper
# zero_scores = all_zero_scores - un_review_scores #已评阅且答案未0分的人数
main_scores_array = [full_scores,no_full_scores,zero_scores,un_review_scores]
main_scores_array.each_with_index do |s,index|
if index == 0
right_answer = true
else
right_answer = false
end
right_answer = (index == 0)
if effictive_users_count == 0 || s < 0
s = 0
score_percent = 0.0
@ -207,11 +199,7 @@ module ExercisesHelper
shixun_score_array = [full_scores,no_full_scores,all_zero_scores]
shixun_chas = []
shixun_score_array.each_with_index do |s,index|
if index == 0
right_answer = true
else
right_answer = false
end
right_answer = (index == 0)
if effictive_users_count == 0
score_percent = 0.0
else

Loading…
Cancel
Save