github-to-canvas-quiz 0.1.3 → 0.1.4
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 +4 -4
- data/README.md +12 -24
- data/lib/github_to_canvas_quiz/synchronizer/quiz.rb +5 -3
- data/lib/github_to_canvas_quiz/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e555944c5bbb43ede1e842476996a905bacf1f923d16b61a1eb2940bf596d409
|
|
4
|
+
data.tar.gz: c21175afacb3f8ea41bda6ec0cf7b962a93b79c2dbcbf898a757941fe95f0156
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a4e9b94994681e11f48e5d368fb9d55cad4c6a26697d91247341f5b6fd6385a5cdf00afbf943571380539e5deaf647a4476e73fd563629cf72cab1e711d4e99
|
|
7
|
+
data.tar.gz: eec67a66fdcfed1ada76c6cf1ed96169352ae03a998c1d2c5fa359e10d1b18dbcdba0b6de9c8f6d56eb97730a54a6b65915ba436f69e2b87f040d2bab9bb294a
|
data/README.md
CHANGED
|
@@ -1,24 +1,9 @@
|
|
|
1
1
|
# GithubToCanvasQuiz
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
A tool for resizing and uploading images to AWS S3.
|
|
3
|
+
A tool maintaining Canvas quizzes as markdown files in GitHub.
|
|
5
4
|
|
|
6
5
|
## Installation
|
|
7
6
|
|
|
8
|
-
Add this line to your application's Gemfile:
|
|
9
|
-
|
|
10
|
-
```ruby
|
|
11
|
-
gem 'github-to-canvas-quiz'
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
And then execute:
|
|
15
|
-
|
|
16
|
-
```console
|
|
17
|
-
$ bundle install
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Or install it yourself as:
|
|
21
|
-
|
|
22
7
|
```console
|
|
23
8
|
$ gem install github-to-canvas-quiz
|
|
24
9
|
```
|
|
@@ -29,14 +14,17 @@ Interacting with the Canvas API requires that you have the following environment
|
|
|
29
14
|
variables set:
|
|
30
15
|
|
|
31
16
|
- `ENV['CANVAS_API_PATH']`
|
|
32
|
-
- The base URL for your institution's Canvas API
|
|
17
|
+
- The base URL for your institution's Canvas API
|
|
18
|
+
(`https://flatironlearn.beta.instructure.com/api/v1`)
|
|
33
19
|
- `ENV['CANVAS_API_KEY']`
|
|
34
|
-
- Your
|
|
20
|
+
- Your
|
|
21
|
+
[Canvas Access Token](https://canvas.instructure.com/doc/api/file.oauth.html#manual-token-generation)
|
|
35
22
|
|
|
36
23
|
## Usage
|
|
37
24
|
|
|
38
25
|
This gem provides two key features via the CLI: backing up Canvas quizzes to
|
|
39
|
-
markdown, and updating a Canvas quiz from an existing directory of markdown
|
|
26
|
+
markdown, and updating a Canvas quiz from an existing directory of markdown
|
|
27
|
+
files.
|
|
40
28
|
|
|
41
29
|
### Backup
|
|
42
30
|
|
|
@@ -72,10 +60,10 @@ git commits and the created tag, and push the `.gem` file to
|
|
|
72
60
|
## Contributing
|
|
73
61
|
|
|
74
62
|
Bug reports and pull requests are welcome on GitHub at
|
|
75
|
-
https://github.com/
|
|
76
|
-
be a safe, welcoming space for collaboration, and contributors are
|
|
77
|
-
adhere to the
|
|
78
|
-
[code of conduct](https://github.com/
|
|
63
|
+
https://github.com/learn-co-curriculum/github-to-canvas-quiz. This project is
|
|
64
|
+
intended to be a safe, welcoming space for collaboration, and contributors are
|
|
65
|
+
expected to adhere to the
|
|
66
|
+
[code of conduct](https://github.com/learn-co-curriculum/github-to-canvas-quiz/blob/main/CODE_OF_CONDUCT.md).
|
|
79
67
|
|
|
80
68
|
## License
|
|
81
69
|
|
|
@@ -86,4 +74,4 @@ The gem is available as open source under the terms of the
|
|
|
86
74
|
|
|
87
75
|
Everyone interacting in the FlatironS3Uploader project's codebases, issue
|
|
88
76
|
trackers, chat rooms and mailing lists is expected to follow the
|
|
89
|
-
[code of conduct](https://github.com/
|
|
77
|
+
[code of conduct](https://github.com/learn-co-curriculum/github-to-canvas-quiz/blob/main/CODE_OF_CONDUCT.md).
|
|
@@ -22,16 +22,16 @@ module GithubToCanvasQuiz
|
|
|
22
22
|
def initialize(client, path)
|
|
23
23
|
path = File.expand_path(path)
|
|
24
24
|
raise DirectoryNotFoundError unless Pathname(path).directory?
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
@client = client
|
|
27
27
|
@path = path
|
|
28
28
|
@repo = RepositoryInterface.new(path)
|
|
29
29
|
@quiz = parse_quiz
|
|
30
|
-
@questions_with_path = parse_questions_with_path
|
|
30
|
+
@questions_with_path = parse_questions_with_path if @quiz.id
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def sync
|
|
34
|
-
backup_canvas_to_json!
|
|
34
|
+
backup_canvas_to_json! if @quiz.id
|
|
35
35
|
sync_quiz!
|
|
36
36
|
sync_questions!
|
|
37
37
|
backup_canvas_to_json!
|
|
@@ -104,6 +104,8 @@ module GithubToCanvasQuiz
|
|
|
104
104
|
|
|
105
105
|
# Create or update questions on Canvas
|
|
106
106
|
def sync_questions!
|
|
107
|
+
@questions_with_path ||= parse_questions_with_path
|
|
108
|
+
|
|
107
109
|
questions_with_path.each do |question_with_path|
|
|
108
110
|
question, path = question_with_path
|
|
109
111
|
if question.id
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: github-to-canvas-quiz
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ihollander
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-11-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: front_matter_parser
|