added matrix and score/time calculations

This commit is contained in:
Thomas Hille
2017-02-15 17:12:46 +01:00
parent 25087232dd
commit eadaf9fd1b
2 changed files with 22 additions and 4 deletions

View File

@ -43,8 +43,22 @@ class ProxyExercise < ActiveRecord::Base
exercises.shuffle.first
end
# [score][quantile]
def scoring_matrix
[
[0 ,0 ,0 ,0 ,0 ],
[0.2,0.2,0.2,0.2,0.1],
[0.5,0.5,0.4,0.4,0.3],
[0.6,0.6,0.5,0.5,0.4],
[1 ,1 ,0.9,0.8,0.7],
]
end
def score(user, ex)
1
points_ratio = ex.maximum_score(user) / ex.maximum_score.to_f
working_time_user = Time.parse(ex.average_working_time_for_only(user.id) || "00:00:00")
scoring_matrix = scoring_matrix
end
def getRelativeKnowledgeLoss(user, execises)