ruql 0.0.8 → 0.0.9

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
  SHA1:
3
- metadata.gz: 997beabb8740224d399921151286761f842799d9
4
- data.tar.gz: ead3b2482c09f2f2b494fff9b5fb19f41e841931
3
+ metadata.gz: 4efcebefa4b89ca759cce170acace5355feaeefd
4
+ data.tar.gz: d7ab50a7a43b935ec9fbba0919f039b00c843b3d
5
5
  SHA512:
6
- metadata.gz: c681825fc87751977bb73d8fc403860f8591588a11f809b3dc5ddbf8b1cc9699441b1ec3f67e8ca07d54dd5fd0fb493dcbbb794e517206d99c4ec6aba6e35e63
7
- data.tar.gz: 08054ec2bb224f2e86be37d8e5e69ce51872150eaa47827f52fa238c8c465415dcccba861339fdd587e36b1357c06dca4f44f79ce830262a7865380c23a9631b
6
+ metadata.gz: 149a8f650812e0d3e6be26670448d4d56388c0847cbfc3a901504ee91af388dc349e47fb7aef116da0634a64d11ca2803674f400814f223c8ed07d5f85cdd164
7
+ data.tar.gz: efb47e061b140a3bca3f1cc8001631e2bf08b5c342c5225a663455b62922e6e05e41f74ca2e388fcc6f37ea25de3561c383851206647ea9d68958c0db7dfa40c
data/bin/ruql CHANGED
@@ -42,10 +42,15 @@ The EdXML renderer supports these options:
42
42
  Render the questions with a specific yaml file.
43
43
 
44
44
  The HTML5 and HTML Forms renderers supports these options:
45
+ -o <type>, --list-type=<type>
46
+ -a <first>, --list-start=<first>
47
+ Sets the values of the 'start' and 'type' attributes for the HTML <ol>
48
+ element. Type should be one of 1,a,A,i,I. Start should always be
49
+ a number indicating the ordinal value (starting from 1) of first item.
45
50
  -c <href>, --css=<href>
46
51
  embed <href> for stylesheet into generated HTML5
47
52
  -j <src>, --js=<src>
48
- embed <src> for JavaScrips
53
+ embed <src> for JavaScript
49
54
  -t <file.html.erb>, --template=<file.html.erb>
50
55
  Use file.html.erb as HTML template rather than generating our own file.
51
56
  file.html.erb should have <%= yield %> where questions should go.
@@ -84,6 +89,8 @@ def main
84
89
  raise "Unknown renderer '#{renderer}'" unless Quiz.get_renderer(renderer)
85
90
 
86
91
  opts = Getopt::Long.getopts(
92
+ ['-o', '--list-type', Getopt::REQUIRED],
93
+ ['-a', '--list-start', Getopt::REQUIRED],
87
94
  ['-c', '--css', Getopt::REQUIRED],
88
95
  ['-j', '--js', Getopt::REQUIRED],
89
96
  ['-t', '--template', Getopt::REQUIRED],
@@ -11,6 +11,8 @@ class Html5Renderer
11
11
  options.delete('template') ||
12
12
  File.join(Gem.loaded_specs['ruql'].full_gem_path, 'templates/html5.html.erb')
13
13
  @output = ''
14
+ @list_type = options.delete('o') || options.delete('list-type') || '1'
15
+ @list_start = options.delete('a') || options.delete('list-start') || '1'
14
16
  @quiz = quiz
15
17
  @h = Builder::XmlMarkup.new(:target => @output, :indent => 2)
16
18
  end
@@ -45,7 +47,7 @@ class Html5Renderer
45
47
 
46
48
  def render_questions
47
49
  render_random_seed
48
- @h.ol :class => 'questions' do
50
+ @h.ol :class => 'questions', :type => @list_type, :start => @list_start do
49
51
  @quiz.questions.each_with_index do |q,i|
50
52
  case q
51
53
  when MultipleChoice, SelectMultiple, TrueFalse then render_multiple_choice(q,i)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Armando Fox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-13 00:00:00.000000000 Z
11
+ date: 2016-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement