asciidoctor-question 0.5 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cda81e4497bf2c6754ab37960797f5d85108fde9
4
- data.tar.gz: dbb4fef58b8290dc7d6b19d22faf3a74071abea2
3
+ metadata.gz: e953e7acc96768c7a0bf6269ac5d4fef7fc89911
4
+ data.tar.gz: e4155bf3aff37139c12f3e90dbba5b8ecae354b7
5
5
  SHA512:
6
- metadata.gz: 9608a148dbfd4c7287a8b6629f93c240bb29f9354cec225f39136f4ea5957aeba82d45ff2212471a4cdb0f69fcc53ca37795509343c1830bec7e54250ac683bf
7
- data.tar.gz: c9d0067c0d7098a07ae709f12e8f8819d6514b58b5d42889515ba0218417565bda0f325f3648da563933f8cd3773f612d1a7f2627a31efd47d5acd5f0d05b19c
6
+ metadata.gz: 1094ab9aab12b8ca1e36315a87c0a0eb8942d3a559ccb5547d2914d0dcbf8a0e959dcb4ff48c89c721ef22a532a36c1241eaebc82646e9923d47acadc4b93a7a
7
+ data.tar.gz: b8e0fa01311471f3ffa07f9dbe12bdaf10bd1e6194e91edb24b200871fcc7a7e768f086c41deb9aa029c44ed2d30f73044dc7c8b08a00489b294c955a120f1dd
data/README.adoc CHANGED
@@ -18,7 +18,7 @@ ifndef::env-site[:status:]
18
18
  :uri-asciidoctor-api: http://asciidoctor.org/docs/user-manual/#api
19
19
  :uri-asciidoctor-extensions: http://asciidoctor.org/docs/user-manual/#extension-points
20
20
 
21
- image:https://img.shields.io/gem/v/asciidoctor-question.svg?label=gem%20version[Gem Version, link=https://rubygems.org/gems/asciidoctor-question]
21
+ image:https://img.shields.io/gem/v/asciidoctor-question.svg[Gem Version, link=https://rubygems.org/gems/asciidoctor-question]
22
22
  image:https://img.shields.io/badge/license-MIT-blue.svg[MIT License, link=#copyright]
23
23
 
24
24
  Asciidoctor Question is a set of Asciidoctor extensions that allows you to add questions as multiple choice and gap text. The questions are defined using plain text in your AsciiDoc document.
@@ -22,7 +22,7 @@ module Asciidoctor
22
22
  type = tag[:type] = 'mc' if type == 'mc' or type == 'multiplechoice' or type == 'multiple_choice'
23
23
  tag[:id] = @id = @id + 1
24
24
 
25
- tag[:solution] = !parent.attributes['solution'].nil?
25
+ tag[:solution] = has_solution parent
26
26
 
27
27
  if type.nil?
28
28
  err = 'Typ fehlt.'
@@ -40,6 +40,18 @@ module Asciidoctor
40
40
 
41
41
  block
42
42
  end
43
+
44
+ def has_solution(parent)
45
+ if not ( parent.document.attributes['solution'].nil? and parent.attributes['solution'].nil? )
46
+ true
47
+ else
48
+ if parent.parent.nil?
49
+ false
50
+ else
51
+ has_solution(parent.parent)
52
+ end
53
+ end
54
+ end
43
55
  end
44
56
 
45
57
 
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Question
3
- VERSION = "0.5"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
data/test/test.adoc CHANGED
@@ -1,61 +1,2 @@
1
-
2
- [question, gap]
3
- ====
4
- Lorem __ipsum__ dolor sit amet, consetetur __sadipscing__ elitr,
5
- sed diam nonumy eirmod __tempor invidunt ut__ labore et dolore
6
- magna aliquyam erat, sed diam voluptua. At vero eos et
7
- accusam et justo duo dolores et ea rebum.
8
-
9
- [source,ruby]
10
- ----
11
- Stet clita kasd gubergren, no sea takimata __sanctus__ est Lorem ipsum dolor sit amet.
12
- Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
13
- sed diam nonumy eirmod tempor __invidunt__ ut labore et
14
- dolore magna aliquyam erat, sed diam voluptua.
15
- ----
16
-
17
- At vero eos et __accusam__ et justo duo dolores et ea rebum.
18
- Stet clita kasd gubergren, no sea takimata __sanctus__ est Lorem ipsum dolor sit amet.
19
- ====
20
-
21
- [question, mc]
22
- ====
23
- Das hier ist eine Frage:
24
- ----
25
- test
26
- ----
27
-
28
- - [ ] Hallo 1234
29
- pkfsepgkdsjghü ojsoip jhsotjhotsjoh std oh sodn hodnh adinhididnhdtd dp dknwodh snmhd öndpishdod mdhopj
30
- - [*] test
31
- ====
32
-
33
- [question, mc, shuffle]
34
- ....
35
- ====
36
- test
37
- ====
38
-
39
- - [ ] Hallo 1234
40
- pkfsepgkdsjghü ojsoip jhsotjhotsjoh std oh sodn hodnh adinhididnhdtd dp dknwodh snmhd öndpishdod mdhopj
41
- - [*] test
42
- ....
43
-
44
- [question, mc, shuffle]
45
- --
46
- Das hier ist eine Frage:
47
- ====
48
- test
49
- ====
50
-
51
- - [*] 0
52
- - [ ] 1
53
- - [*] 2
54
- - [ ] 3
55
- - [*] 4
56
- - [ ] 5
57
- - [*] 6
58
- - [ ] 7
59
- - [*] 8
60
- - [ ] 9
61
- --
1
+ :solution:
2
+ include::2016WS.OOP.35Fragen.adoc[]
data/test/test.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'asciidoctor-pdf'
2
2
  require_relative '../lib/asciidoctor-question'
3
3
 
4
- Asciidoctor.convert_file 'test/test.adoc', {:safe => :safe, :solution => ''}
4
+ #Asciidoctor.convert_file 'test/test.adoc', {:safe => :safe}
5
5
  Asciidoctor.convert_file 'test/test.adoc', {:safe => :safe, :backend => 'pdf'}
6
+ #Asciidoctor.convert_file 'test/2016WS.OOP.Klausur1.adoc', {:safe => :safe, :solution => '', :backend => 'pdf'}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-question
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcel Hoppe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-16 00:00:00.000000000 Z
11
+ date: 2017-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,7 +80,9 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.6'
83
- description: Asciidoctor questioning extension.rb
83
+ description: Asciidoctor Question is a set of Asciidoctor extensions that allows you
84
+ to add questions as multiple choice and gap text. The questions are defined using
85
+ plain text in your AsciiDoc document.
84
86
  email:
85
87
  - marcel.hoppe@mni.thm.de
86
88
  executables: []