pnote_client 1.0.1 → 1.1.0
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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9b025808db4353d3e90385878656f10e3422c9437dd34d94a4e89bb62f3e01b7
|
4
|
+
data.tar.gz: 90c140ab343ac7d8367c212827411479d2570ac17d7a6606c585381b29867aa8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 841b14e3656a5a0974c0f69adf014b97fa7bddb2cb09de954d6aef0d3b25d1749b3d30e03ca11681d1749caebd5ac36199eab9ff4efca9341713d9b4bd781a39
|
7
|
+
data.tar.gz: e9b068740e7cc0740b3d5e854b2e34a03e716ee3aa426ba3fe41ff3f5b8f4d2276470b27d930802449080ae26cb2812ece3815ef1ebe07784fd471c150922748
|
@@ -28,41 +28,20 @@ module PnoteClient
|
|
28
28
|
@pnote_document.chapters.each do |chapter|
|
29
29
|
chapter_hash = {
|
30
30
|
title: chapter.title,
|
31
|
-
sub_chapters: []
|
32
|
-
practices: []
|
31
|
+
sub_chapters: []
|
33
32
|
}
|
34
33
|
result[:chapters] << chapter_hash
|
35
34
|
|
36
|
-
#
|
37
|
-
chapter.sub_chapters.each do |sub_chapter|
|
35
|
+
unless chapter.practices.empty? # 심화단원일 경우 "실전문제" 소단원 하나 만들어서 전부 넣기
|
38
36
|
sub_chapter_hash = {
|
39
|
-
title:
|
40
|
-
concepts: [],
|
37
|
+
title: '실전문제',
|
41
38
|
exercises: [],
|
42
39
|
practices: []
|
43
40
|
}
|
44
41
|
chapter_hash[:sub_chapters] << sub_chapter_hash
|
45
42
|
|
46
|
-
|
47
|
-
|
48
|
-
title: concept.title,
|
49
|
-
content: concept.content
|
50
|
-
}
|
51
|
-
|
52
|
-
sub_chapter_hash[:concepts] << concept_hash
|
53
|
-
end
|
54
|
-
|
55
|
-
sub_chapter.exercises.each do |exercise|
|
56
|
-
exercise_hash = {
|
57
|
-
question: exercise.question,
|
58
|
-
answer: exercise.answer,
|
59
|
-
explaination: exercise.explaination,
|
60
|
-
choices: exercise.choices
|
61
|
-
}
|
62
|
-
sub_chapter_hash[:exercises] << exercise_hash
|
63
|
-
end
|
64
|
-
|
65
|
-
sub_chapter.practices.each do |practice|
|
43
|
+
# 심화단원의 실전 문제
|
44
|
+
chapter.practices.each do |practice|
|
66
45
|
practice_hash = {
|
67
46
|
question: practice.question,
|
68
47
|
answer: practice.answer,
|
@@ -73,19 +52,47 @@ module PnoteClient
|
|
73
52
|
}
|
74
53
|
sub_chapter_hash[:practices] << practice_hash
|
75
54
|
end
|
76
|
-
|
55
|
+
else # 일반 단원일경우 소단원 채우기
|
56
|
+
chapter.sub_chapters.each do |sub_chapter|
|
57
|
+
sub_chapter_hash = {
|
58
|
+
title: sub_chapter.title,
|
59
|
+
concepts: [],
|
60
|
+
exercises: [],
|
61
|
+
practices: []
|
62
|
+
}
|
63
|
+
chapter_hash[:sub_chapters] << sub_chapter_hash
|
77
64
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
65
|
+
sub_chapter.concepts.each do |concept|
|
66
|
+
concept_hash = {
|
67
|
+
title: concept.title,
|
68
|
+
content: concept.content
|
69
|
+
}
|
70
|
+
|
71
|
+
sub_chapter_hash[:concepts] << concept_hash
|
72
|
+
end
|
73
|
+
|
74
|
+
sub_chapter.exercises.each do |exercise|
|
75
|
+
exercise_hash = {
|
76
|
+
question: exercise.question,
|
77
|
+
answer: exercise.answer,
|
78
|
+
explaination: exercise.explaination,
|
79
|
+
choices: exercise.choices
|
80
|
+
}
|
81
|
+
sub_chapter_hash[:exercises] << exercise_hash
|
82
|
+
end
|
83
|
+
|
84
|
+
sub_chapter.practices.each do |practice|
|
85
|
+
practice_hash = {
|
86
|
+
question: practice.question,
|
87
|
+
answer: practice.answer,
|
88
|
+
explaination: practice.explaination,
|
89
|
+
teacher_comments: practice.teacher_comments.sort_by {|tc| tc.index }.map(&:content),
|
90
|
+
choices: practice.choices,
|
91
|
+
tip: practice.tip
|
92
|
+
}
|
93
|
+
sub_chapter_hash[:practices] << practice_hash
|
94
|
+
end
|
95
|
+
end
|
89
96
|
end
|
90
97
|
end
|
91
98
|
|
@@ -42,7 +42,7 @@ module PnoteClient
|
|
42
42
|
paragraphs << Paragraph.from_tag(pg_tag)
|
43
43
|
end
|
44
44
|
|
45
|
-
bin_item_tags = doc.xpath("//BINITEM")
|
45
|
+
bin_item_tags = doc.xpath("//BINITEM[@Type=Embedding]")
|
46
46
|
bin_item_tags.each do |bin_item_tag|
|
47
47
|
bin_items << BinaryItem.new(bin_item_tag, doc)
|
48
48
|
end
|
data/lib/pnote_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pnote_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bluesh55
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
150
|
rubyforge_project:
|
151
|
-
rubygems_version: 2.
|
151
|
+
rubygems_version: 2.7.8
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: Convert PNote(.hml) file to json file
|