Class: GithubToCanvasQuiz::Builder::Quiz
- Inherits:
-
Object
- Object
- GithubToCanvasQuiz::Builder::Quiz
- Defined in:
- lib/github_to_canvas_quiz/builder/quiz.rb
Overview
Create markdown files from a Canvas Quiz
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#course_id ⇒ Object
readonly
Returns the value of attribute course_id.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#quiz_id ⇒ Object
readonly
Returns the value of attribute quiz_id.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(client, course_id, quiz_id, path) ⇒ Quiz
constructor
A new instance of Quiz.
Constructor Details
#initialize(client, course_id, quiz_id, path) ⇒ Quiz
Returns a new instance of Quiz.
10 11 12 13 14 15 |
# File 'lib/github_to_canvas_quiz/builder/quiz.rb', line 10 def initialize(client, course_id, quiz_id, path) @path = path @client = client @course_id = course_id @quiz_id = quiz_id end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
8 9 10 |
# File 'lib/github_to_canvas_quiz/builder/quiz.rb', line 8 def client @client end |
#course_id ⇒ Object (readonly)
Returns the value of attribute course_id.
8 9 10 |
# File 'lib/github_to_canvas_quiz/builder/quiz.rb', line 8 def course_id @course_id end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/github_to_canvas_quiz/builder/quiz.rb', line 8 def path @path end |
#quiz_id ⇒ Object (readonly)
Returns the value of attribute quiz_id.
8 9 10 |
# File 'lib/github_to_canvas_quiz/builder/quiz.rb', line 8 def quiz_id @quiz_id end |
Instance Method Details
#build ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/github_to_canvas_quiz/builder/quiz.rb', line 17 def build prepare_directory! save_quiz! save_questions! backup_canvas_to_json! commit! end |