Link to filtered exercise list

This commit is contained in:
Maximilian Grundke
2018-07-20 13:16:32 +02:00
parent bc33d9211f
commit 9037c84639
2 changed files with 9 additions and 7 deletions

View File

@ -72,8 +72,8 @@ class ExternalUsersController < ApplicationController
statistics = []
tags = ProxyExercise.new().get_user_knowledge_and_max_knowledge(@user, @user.participations.uniq.compact)
tags[:user_topic_knowledge].each_pair do |key, value|
statistics.append({:key => key.name.to_s, :value => (100.0 / tags[:max_topic_knowledge][key] * value).round})
tags[:user_topic_knowledge].each_pair do |tag, value|
statistics.append({key: tag.name.to_s, value: (100.0 / tags[:max_topic_knowledge][tag] * value).round, id: tag.id})
end
statistics.sort_by! {|item| -item[:value]}