class Mumukit::Assistant

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.

Constants

VERSION

Attributes

rules[RW]

Public Class Methods

new(rules) click to toggle source
# File lib/mumukit/assistant.rb, line 15
def initialize(rules)
  @rules = rules
end
parse(rules) click to toggle source
# File lib/mumukit/assistant.rb, line 27
def self.parse(rules)
  new rules.map { |it| Mumukit::Assistant::Rule.parse it }
end

Public Instance Methods

assist_with(submission) click to toggle source

Provides tips for the student for the given submission, based on the `rules`.

# File lib/mumukit/assistant.rb, line 21
def assist_with(submission)
  @rules
    .select { |it| it.matches?(submission) }
    .map { |it| it.message_for(submission.attemps_count) }
end