Class: Verso::Task
- Includes:
- HTTPGettable
- Defined in:
- lib/verso/task.rb
Overview
Task resource
A Course task/competency contained by a DutyArea or a CorrelationList.
Instance Attribute Summary collapse
-
#code ⇒ String
readonly
Course code.
-
#definition ⇒ String
readonly
HTML-formatted Task definition.
-
#edition ⇒ String
readonly
Course edition year.
-
#id ⇒ String
readonly
Task ID.
-
#questions ⇒ String
readonly
HTML-formatted process/skill questions.
-
#sensitive ⇒ Boolean
(also: #sensitive?)
readonly
Is this task sensitive?.
-
#statement ⇒ String
readonly
Task/competency statement.
Attributes inherited from Base
Instance Method Summary collapse
-
#bare? ⇒ Boolean
Does this task have only a statement?.
-
#essential ⇒ Boolean
(also: #essential?)
Is this task considered essential?.
-
#standards ⇒ Verso::StandardsList
(also: #goals)
Standards related to this task.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Verso::Base
Instance Attribute Details
#code ⇒ String (readonly)
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/verso/task.rb', line 28 class Task < Verso::Base include HTTPGettable attr_reader :code, :definition, :edition, :id, :sensitive, :statement, :questions alias sensitive? sensitive # @return [Boolean] Does this task have only a statement? def definition.empty? && standards.sols.empty? end # @return [Boolean] Is this task considered essential? def essential sensitive ? true : get_attr(:essential) end alias essential? essential # @return [Verso::StandardsList] Standards related to this task def standards # Yuck. Inject goals if we already have them, i.e. a correlation list. # Otherwise, children will fetch resources and we get *all* the # standards in the correlation lists. raw_goals = get_attr(:goals).collect do |k,v| v.merge(:name => k, :code => code, :edition => edition) end @standards ||= StandardsList.new( :code => code, :edition => edition, :standards => raw_goals ) end alias goals standards private def path "/courses/#{code},#{edition}/tasks/#{id}" end end |
#definition ⇒ String (readonly)
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/verso/task.rb', line 28 class Task < Verso::Base include HTTPGettable attr_reader :code, :definition, :edition, :id, :sensitive, :statement, :questions alias sensitive? sensitive # @return [Boolean] Does this task have only a statement? def definition.empty? && standards.sols.empty? end # @return [Boolean] Is this task considered essential? def essential sensitive ? true : get_attr(:essential) end alias essential? essential # @return [Verso::StandardsList] Standards related to this task def standards # Yuck. Inject goals if we already have them, i.e. a correlation list. # Otherwise, children will fetch resources and we get *all* the # standards in the correlation lists. raw_goals = get_attr(:goals).collect do |k,v| v.merge(:name => k, :code => code, :edition => edition) end @standards ||= StandardsList.new( :code => code, :edition => edition, :standards => raw_goals ) end alias goals standards private def path "/courses/#{code},#{edition}/tasks/#{id}" end end |
#edition ⇒ String (readonly)
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/verso/task.rb', line 28 class Task < Verso::Base include HTTPGettable attr_reader :code, :definition, :edition, :id, :sensitive, :statement, :questions alias sensitive? sensitive # @return [Boolean] Does this task have only a statement? def definition.empty? && standards.sols.empty? end # @return [Boolean] Is this task considered essential? def essential sensitive ? true : get_attr(:essential) end alias essential? essential # @return [Verso::StandardsList] Standards related to this task def standards # Yuck. Inject goals if we already have them, i.e. a correlation list. # Otherwise, children will fetch resources and we get *all* the # standards in the correlation lists. raw_goals = get_attr(:goals).collect do |k,v| v.merge(:name => k, :code => code, :edition => edition) end @standards ||= StandardsList.new( :code => code, :edition => edition, :standards => raw_goals ) end alias goals standards private def path "/courses/#{code},#{edition}/tasks/#{id}" end end |
#id ⇒ String (readonly)
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/verso/task.rb', line 28 class Task < Verso::Base include HTTPGettable attr_reader :code, :definition, :edition, :id, :sensitive, :statement, :questions alias sensitive? sensitive # @return [Boolean] Does this task have only a statement? def definition.empty? && standards.sols.empty? end # @return [Boolean] Is this task considered essential? def essential sensitive ? true : get_attr(:essential) end alias essential? essential # @return [Verso::StandardsList] Standards related to this task def standards # Yuck. Inject goals if we already have them, i.e. a correlation list. # Otherwise, children will fetch resources and we get *all* the # standards in the correlation lists. raw_goals = get_attr(:goals).collect do |k,v| v.merge(:name => k, :code => code, :edition => edition) end @standards ||= StandardsList.new( :code => code, :edition => edition, :standards => raw_goals ) end alias goals standards private def path "/courses/#{code},#{edition}/tasks/#{id}" end end |
#questions ⇒ String (readonly)
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/verso/task.rb', line 28 class Task < Verso::Base include HTTPGettable attr_reader :code, :definition, :edition, :id, :sensitive, :statement, :questions alias sensitive? sensitive # @return [Boolean] Does this task have only a statement? def definition.empty? && standards.sols.empty? end # @return [Boolean] Is this task considered essential? def essential sensitive ? true : get_attr(:essential) end alias essential? essential # @return [Verso::StandardsList] Standards related to this task def standards # Yuck. Inject goals if we already have them, i.e. a correlation list. # Otherwise, children will fetch resources and we get *all* the # standards in the correlation lists. raw_goals = get_attr(:goals).collect do |k,v| v.merge(:name => k, :code => code, :edition => edition) end @standards ||= StandardsList.new( :code => code, :edition => edition, :standards => raw_goals ) end alias goals standards private def path "/courses/#{code},#{edition}/tasks/#{id}" end end |
#sensitive ⇒ Boolean (readonly) Also known as: sensitive?
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/verso/task.rb', line 28 class Task < Verso::Base include HTTPGettable attr_reader :code, :definition, :edition, :id, :sensitive, :statement, :questions alias sensitive? sensitive # @return [Boolean] Does this task have only a statement? def definition.empty? && standards.sols.empty? end # @return [Boolean] Is this task considered essential? def essential sensitive ? true : get_attr(:essential) end alias essential? essential # @return [Verso::StandardsList] Standards related to this task def standards # Yuck. Inject goals if we already have them, i.e. a correlation list. # Otherwise, children will fetch resources and we get *all* the # standards in the correlation lists. raw_goals = get_attr(:goals).collect do |k,v| v.merge(:name => k, :code => code, :edition => edition) end @standards ||= StandardsList.new( :code => code, :edition => edition, :standards => raw_goals ) end alias goals standards private def path "/courses/#{code},#{edition}/tasks/#{id}" end end |
#statement ⇒ String (readonly)
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/verso/task.rb', line 28 class Task < Verso::Base include HTTPGettable attr_reader :code, :definition, :edition, :id, :sensitive, :statement, :questions alias sensitive? sensitive # @return [Boolean] Does this task have only a statement? def definition.empty? && standards.sols.empty? end # @return [Boolean] Is this task considered essential? def essential sensitive ? true : get_attr(:essential) end alias essential? essential # @return [Verso::StandardsList] Standards related to this task def standards # Yuck. Inject goals if we already have them, i.e. a correlation list. # Otherwise, children will fetch resources and we get *all* the # standards in the correlation lists. raw_goals = get_attr(:goals).collect do |k,v| v.merge(:name => k, :code => code, :edition => edition) end @standards ||= StandardsList.new( :code => code, :edition => edition, :standards => raw_goals ) end alias goals standards private def path "/courses/#{code},#{edition}/tasks/#{id}" end end |
Instance Method Details
#bare? ⇒ Boolean
35 36 37 |
# File 'lib/verso/task.rb', line 35 def definition.empty? && standards.sols.empty? end |
#essential ⇒ Boolean Also known as: essential?
40 41 42 |
# File 'lib/verso/task.rb', line 40 def essential sensitive ? true : get_attr(:essential) end |
#standards ⇒ Verso::StandardsList Also known as: goals
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/verso/task.rb', line 46 def standards # Yuck. Inject goals if we already have them, i.e. a correlation list. # Otherwise, children will fetch resources and we get *all* the # standards in the correlation lists. raw_goals = get_attr(:goals).collect do |k,v| v.merge(:name => k, :code => code, :edition => edition) end @standards ||= StandardsList.new( :code => code, :edition => edition, :standards => raw_goals ) end |