JuliaTutor
JuliaTutor.Lesson
JuliaTutor.Tutor
JuliaTutor.display_hint
JuliaTutor.display_prompt_and_request
JuliaTutor.evaluate
JuliaTutor.evaluate
JuliaTutor.greet
JuliaTutor.help
JuliaTutor.hint
JuliaTutor.inform
JuliaTutor.keywords
JuliaTutor.load_lesson
JuliaTutor.menu
JuliaTutor.request
JuliaTutor.user_experience
JuliaTutor.@capture_stdstreams
JuliaTutor.Lesson
— MethodLesson(prompt::String, request::String, parser::Evaluator)
Will create a Lesson instance without a hint. Note: it is strongly preferred that Lesson's contain hints
so please construct via Lesson( prompt::String, request::String, parser::Evaluator, hint::String ) except when neccesary.
JuliaTutor.Tutor
— Method( t::Tutor )( user_input::String )
This is the parser, and lesson plan orchestration mechanism of Julia tutor. This functor progresses the user through lessons and parsers their inputs.
JuliaTutor.display_hint
— Methoddisplay_hint(t::Tutor)
Displays a hint pertaining to the users current lesson, if it exists. See hint(lesson::Lesson)
JuliaTutor.display_prompt_and_request
— Methoddisplay_prompt_and_request(t::Tutor)
Displays a lesson prompt and requests an action from the user.
JuliaTutor.evaluate
— Methodevaluate(ui, truth)::Tuple{ Bool, Bool }
Evaluates the output of a user's input against ground truth, and the variable declaration.
JuliaTutor.evaluate
— Methodevaluate(ui, truth)::Tuple{ Bool, Bool }
Evaluates the output of a user's input against ground truth.
JuliaTutor.greet
— Methodgreet()
Greets the user the first time they run JuliaTutor.
JuliaTutor.help
— Methodhelp()
Displays generic tips for how to navigate JuliaTutor.
JuliaTutor.hint
— Methodhint(lesson::Lesson)
Displays a hint for the user, if the lesson provides it. Otherwise - it directs the user to Discourse.
JuliaTutor.inform
— Methodinform(lesson::Lesson)
A convenience function to display the prompt of a lesson to an end user.
JuliaTutor.keywords
— Methodkeywords(t, user_input)
Assesses if the user has asked for help, hint, or some other invention specific to JuliaTutor.
JuliaTutor.load_lesson
— Methodload_lesson(lesson_location::String)
reads a structured Lesson file and begins a Julia tutor REPL, parser, etc.
JuliaTutor.menu
— Methodmenu()
Greets an end user, but then prompts them to select a lesson plan from /Lessons/ Once a lesson is selected(by entering a numerical value) it will load that lesson and begin.
JuliaTutor.request
— Methodrequest(lesson::Lesson)
A convenience function to display what action is requested for an end user to accomplish.
JuliaTutor.user_experience
— Methoduser_experience(syntax_error, incorrect_answer)::Bool
Convenience function to handle the feedback a user see's when they enter invalid, incorrect, or correct code. Returns a bool as to whether their input was correct (true) or not (false).
JuliaTutor.@capture_stdstreams
— Macro@capture_stdstreams(expr)
Evaluate the specified expression and return a (stdout, stderr)
tuple. This macro will attempt to capture every form of output, including via the Logging
module (e.g. the @logmsg
and friend macros), but it's unable to do this with perfect accuracy. Any code that stores a reference to stdout
or stderr
before this is executed will retain those references to the original streams. For example, the original log instance may be obtained using Logging.global_logger()
because no attempt is made to set the global logger instance.
Examples
julia> out, err = ComparativeAutograder.@capture_stdstreams begin
println("I'm going to out!")
println(stderr, "I'm going to err!")
end
("I'm going to out!\n", "I'm going to err!\n")