From f5b96f06cf112dd69b5cff4c264fb6c55080cfa9 Mon Sep 17 00:00:00 2001 From: Thomas Hille Date: Thu, 16 Feb 2017 11:41:35 +0100 Subject: [PATCH] fixed typo --- app/models/proxy_exercise.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/proxy_exercise.rb b/app/models/proxy_exercise.rb index cd609d01..017f1270 100644 --- a/app/models/proxy_exercise.rb +++ b/app/models/proxy_exercise.rb @@ -81,12 +81,12 @@ class ProxyExercise < ActiveRecord::Base scoring_matrix[points_ratio_index][quantile_index] end - def getRelativeKnowledgeLoss(user, execises) + def getRelativeKnowledgeLoss(user, exercises) # initialize knowledge for each tag with 0 - all_used_tags = execises.inject(Set.new){|tagset, ex| tagset.merge(ex.tags)} + all_used_tags = exercises.inject(Set.new){|tagset, ex| tagset.merge(ex.tags)} topic_knowledge_loss_user = all_used_tags.map{|t| [t, 0]}.to_h topic_knowledge_max = all_used_tags.map{|t| [t, 0]}.to_h - execises.each do |ex| + exercises.each do |ex| user_score_factor = score(user, ex) ex.tags.each do |t| tag_ratio = ex.exercise_tags.where(tag: t).first.factor / ex.exercise_tags.inject(0){|sum, et| sum += et.factor }