github-to-canvas-quiz 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78e0f26ece8913c97dd4993b0552c8467b8cdee239f4286dc5d932034b71bb4b
|
4
|
+
data.tar.gz: 2af57075f88afa3a80937f68eb213825527730912ffa7aed9b76dd6a0c77b0b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecf9295321db1df820cac349da264f86dbe2e18a57011c69520f326196a33f29789cff0991c1060edcc0d67564ca23366cdf39e5d4f6db51f1264e8f1fe316aa
|
7
|
+
data.tar.gz: b56c47bc9934f8c225b0857ccdd4c27a4d8a0c963a9643c2e8f508c27b9a32f805d306a2485fcdfcf262d0a0ca1ef74937feeb140f5869e67e0f0bf21937c018
|
@@ -7,7 +7,7 @@ module GithubToCanvasQuiz
|
|
7
7
|
class Quiz
|
8
8
|
attr_reader :client, :course_id, :quiz_id, :path
|
9
9
|
|
10
|
-
def initialize(client, course_id, quiz_id, path
|
10
|
+
def initialize(client, course_id, quiz_id, path)
|
11
11
|
@path = path
|
12
12
|
@client = client
|
13
13
|
@course_id = course_id
|
@@ -30,6 +30,7 @@ module GithubToCanvasQuiz
|
|
30
30
|
|
31
31
|
def prepare_directory!
|
32
32
|
Dir.mkdir(path) unless Pathname(path).directory?
|
33
|
+
@path = File.expand_path(path)
|
33
34
|
end
|
34
35
|
|
35
36
|
def save_quiz!
|
@@ -81,7 +82,7 @@ module GithubToCanvasQuiz
|
|
81
82
|
@quiz = begin
|
82
83
|
quiz = Parser::Canvas::Quiz.new(canvas_quiz_data).parse
|
83
84
|
# use file path as repo if not present
|
84
|
-
quiz.repo =
|
85
|
+
quiz.repo = File.basename(path) unless quiz.repo
|
85
86
|
quiz
|
86
87
|
end
|
87
88
|
end
|
@@ -52,9 +52,9 @@ module GithubToCanvasQuiz
|
|
52
52
|
|
53
53
|
def sources_to_html
|
54
54
|
comments = sources.map do |source|
|
55
|
-
"<a href=\"#{source['url']}\">#{source['name']}</a>"
|
55
|
+
"<li><a href=\"#{source['url']}\">#{source['name']}</a></li>"
|
56
56
|
end.join
|
57
|
-
"<p><strong>Source/s:</strong
|
57
|
+
"<p><strong>Source/s:</strong><ul>#{comments}</ul></p>"
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|