Class: Mumukit::Assistant
- Inherits:
-
Object
- Object
- Mumukit::Assistant
- Defined in:
- lib/mumukit/assistant.rb,
lib/mumukit/assistant/version.rb
Overview
An assistant is used to generate dynamic feedback over a student’s submission, based on rules.
This feedback is composed of a list of markdown messages called tips, and the whole processes of creating this feedback is called assistance.
Defined Under Namespace
Modules: Message, Rule Classes: Narrator
Constant Summary collapse
- VERSION =
"0.2.1"
Instance Attribute Summary collapse
-
#rules ⇒ Object
Returns the value of attribute rules.
Class Method Summary collapse
Instance Method Summary collapse
-
#assist_with(submission) ⇒ Object
Provides tips for the student for the given submission, based on the ‘rules`.
-
#initialize(rules) ⇒ Assistant
constructor
A new instance of Assistant.
Constructor Details
#initialize(rules) ⇒ Assistant
Returns a new instance of Assistant.
15 16 17 |
# File 'lib/mumukit/assistant.rb', line 15 def initialize(rules) @rules = rules end |
Instance Attribute Details
#rules ⇒ Object
Returns the value of attribute rules.
13 14 15 |
# File 'lib/mumukit/assistant.rb', line 13 def rules @rules end |
Class Method Details
Instance Method Details
#assist_with(submission) ⇒ Object
Provides tips for the student for the given submission, based on the ‘rules`.
21 22 23 24 25 |
# File 'lib/mumukit/assistant.rb', line 21 def assist_with(submission) @rules .select { |it| it.matches?(submission) } .map { |it| it.(submission.attemps_count) } end |