Display tag statistics for external users on their profile
This commit is contained in:
@ -8,6 +8,7 @@ module User
|
|||||||
has_many :exercises, as: :user
|
has_many :exercises, as: :user
|
||||||
has_many :file_types, as: :user
|
has_many :file_types, as: :user
|
||||||
has_many :submissions, as: :user
|
has_many :submissions, as: :user
|
||||||
|
has_many :participations, through: :submissions, source: :exercise, as: :user
|
||||||
has_many :user_proxy_exercise_exercises, as: :user
|
has_many :user_proxy_exercise_exercises, as: :user
|
||||||
has_many :user_exercise_interventions, as: :user
|
has_many :user_exercise_interventions, as: :user
|
||||||
has_many :interventions, through: :user_exercise_interventions
|
has_many :interventions, through: :user_exercise_interventions
|
||||||
|
@ -6,3 +6,11 @@ h1 = @user.name
|
|||||||
|
|
||||||
br
|
br
|
||||||
= link_to(t('shared.statistics'), statistics_external_user_path(@user))
|
= link_to(t('shared.statistics'), statistics_external_user_path(@user))
|
||||||
|
|
||||||
|
.tag-grid
|
||||||
|
- tag_stats = ProxyExercise.new().get_user_knowledge_and_max_knowledge(@user, @user.participations.uniq.compact)
|
||||||
|
- tag_stats[:user_topic_knowledge].each do |key, value|
|
||||||
|
//p = key.name.to_s + ' -> ' + value.to_s + " (of #{tag_stats[:max_topic_knowledge][key].to_s })"
|
||||||
|
.tag-details
|
||||||
|
= key.name.to_s
|
||||||
|
= progress_bar((100.0 / tag_stats[:max_topic_knowledge][key] * value).round(2))
|
||||||
|
Reference in New Issue
Block a user