Extended Exercises by worktime, difficulty and tags, added ProxyExercises as prework for recommendations
Tags can be added to exercises in the edit view. Tags can monitored under /tags. Added the concept of ProxyExercises which are a collection of Exercises. They can be found under /proxy_exercises Added Interventions as prework to show interventions later to the user. Added exercise/[:id]/working_time to return the working time of the user in this exercise and the average working time of all users in this exercise
This commit is contained in:
15
app/models/intervention.rb
Normal file
15
app/models/intervention.rb
Normal file
@ -0,0 +1,15 @@
|
||||
class Intervention < ActiveRecord::Base
|
||||
|
||||
NAME = %w(overallSlower longSession syntaxErrors videoNotWatched)
|
||||
|
||||
has_many :user_exercise_interventions
|
||||
has_many :users, through: :user_exercise_interventions, source_type: "ExternalUser"
|
||||
#belongs_to :user, polymorphic: true
|
||||
#belongs_to :external_users, source: :user, source_type: ExternalUser
|
||||
#belongs_to :internal_users, source: :user, source_type: InternalUser, through: :user_interventions
|
||||
# alias_method :users, :external_users
|
||||
#has_many :exercises, through: :user_interventions
|
||||
|
||||
validates :name, inclusion: {in: NAME}
|
||||
|
||||
end
|
Reference in New Issue
Block a user