asker-tool 2.2.4 → 2.3.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
  SHA256:
3
- metadata.gz: 03472461b2c0fd2304386ed597031005721f01c704aa60faab99b877b2f1f391
4
- data.tar.gz: 7ed5998cb07871d582458a05df781ba538b871135dd3a423d91939835a90c461
3
+ metadata.gz: 19f1b59f4c03c3860a9fee649625822e17d4a72e36a0e97e23094669a0a27f89
4
+ data.tar.gz: 5f039c02f0af9573a780591ad3672dc0a88dd569f8321773b19606e5f7677100
5
5
  SHA512:
6
- metadata.gz: a3f9036a18868f4a7d38789770f2a63d27072c48831727af59b0c3ad6f0ef056427d0ab351f07e77c8e2323dbba820fe2cebc00d9b2d509209c1d99fe96719cc
7
- data.tar.gz: '08f4c7f94bc0aec827a199cb4e641f02a96b470b53ac08270cbfdcef192084e2d8b61a94c11a3f267bfa932acbd51c0bd0b26d303b6fb7dabef8421dc468f818'
6
+ metadata.gz: 10a4be2178720682d5d9dddcce6d94ee0fa28deaed7f637bd4ed662d302ac8a5c3174ec6f16ac5cf5cc69c5e8eace73e7ae5ce7408d591af7ef4c0dccdf7542c
7
+ data.tar.gz: 99b279f214b6ae3f9d3316e73958c30992727ff73e8f3082f4cb2c7b0ea225c139587dd6345442646e064389f76e29c3e687034aaf52063d2bd42060c095119c
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/asker-tool.svg)](https://badge.fury.io/rb/asker-tool)
2
2
  ![GitHub](https://img.shields.io/github/license/dvarrui/asker)
3
- ![Gem](https://img.shields.io/gem/dv/asker-tool/2.2.4)
3
+ ![Gem](https://img.shields.io/gem/dv/asker-tool/2.2.5)
4
4
 
5
5
  # ASKER
6
6
 
@@ -10,20 +10,24 @@ Generate a lot of questions from an _input_ text file with on your own _definiti
10
10
 
11
11
  ASKER helps trainers to create a huge amount of questions, from a definitions (_conceptual entities_) input file.
12
12
 
13
- * Free Software [LICENSE](https://github.com/dvarrui/asker/blob/devel/LICENSE.txt).
13
+ * Free Software [LICENSE](LICENSE).
14
14
  * Multiplatform.
15
- * Ruby program.
15
+ * [Ruby program](https://rubygems.org/gems/asker-tool)
16
16
 
17
17
  ## Installation
18
18
 
19
19
  1. Install Ruby on your system.
20
- 2. `gem install asker-tool`
20
+ 2. Install Asker on your system. Two ways:
21
+ * (a) `sudo gem install asker-tool` as superuser (root) or
22
+ * (b) `gem install --user-install asker-tool` as regular user.
23
+
24
+ > To update Asker we do `sudo gem update asker-tool`
21
25
 
22
26
  ## Usage
23
27
 
24
28
  Steps:
25
29
 
26
- 1. Create an input file with your definitions (_conceptual entities_).
30
+ 1. Create an input file with your inputs (_conceptual map_).
27
31
  1. Run _asker_ and get the results into `output` directory.
28
32
 
29
33
  Example: Running `asker` with our example input file as argument (`acdc.haml`):
@@ -34,16 +38,17 @@ asker docs/examples/bands/acdc.haml
34
38
 
35
39
  * Output files created into the `output` folder.
36
40
  * More [example input files](./docs/examples).
37
- * More asker input files at `github/dvarrui/asker-inputs` repository.
41
+ * More asker input files at [github/dvarrui/asker-inputs](https://github.com/dvarrui/asker-inputs) repository.
38
42
 
39
43
  ## Documentation
40
44
 
41
- * [Installation](https://github.com/dvarrui/asker/blob/devel/docs/install/README.md)
42
- * [Inputs](https://github.com/dvarrui/asker/blob/devel/docs/inputs/README.md)
43
- * [Usage](https://github.com/dvarrui/asker/blob/devel/docs/usage.md)
44
- * [Contributions](https://github.com/dvarrui/asker/blob/devel/docs/contributions.md)
45
- * [Base idea](https://github.com/dvarrui/asker/blob/devel/docs/idea.md)
46
- * [History](https://github.com/dvarrui/asker/blob/devel/docs/history.md)
45
+ * [Installation](docs/install/README.md)
46
+ * [Videos](docs/videos.md)
47
+ * [Inputs](docs/inputs/README.md)
48
+ * [Usage](docs/usage.md)
49
+ * [Contributions](docs/contributions.md)
50
+ * [Problem to solve](docs/idea.md)
51
+ * [History](docs/history.md)
47
52
 
48
53
  ## Contact
49
54
 
data/bin/asker CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
4
  require 'asker/cli'
3
5
 
4
6
  # Start Asker command line interface
@@ -31,6 +31,11 @@ class Application
31
31
  end
32
32
  stages = @config['questions']['stages'].split(',')
33
33
  @config['questions']['stages'] = stages.map(&:to_sym)
34
+
35
+ fractions = @config['questions']['fractions'].split(',')
36
+ @config['questions']['fractions'] = fractions + Array.new(5, '0')
37
+ # require 'debug'; binding.break
38
+
34
39
  Rainbow.enabled = false
35
40
  Rainbow.enabled = true if @config['global']['color'].downcase == 'yes'
36
41
  end
@@ -14,10 +14,23 @@ module CheckTable
14
14
  elsif !line.start_with? ' %table'
15
15
  @outputs[index][:state] = :err
16
16
  @outputs[index][:msg] = 'Write 4 spaces before %table'
17
+ end
18
+
19
+ unless line.include? "%table{"
20
+ @outputs[index][:state] = :err
21
+ @outputs[index][:msg] = "table must be next to { (Without spaces)"
22
+ end
23
+
24
+ unless line.include? "fields:"
25
+ @outputs[index][:state] = :err
26
+ @outputs[index][:msg] = "fields must be next to : (Without spaces)"
27
+ end
28
+
29
+ # TODO
17
30
  #else not /\s+%table{\s?fields:\s?'[A-Za-z,áéíóú]*'\s?}/.match(line)
18
31
  # @outputs[index][:state] = :err
19
32
  # @outputs[index][:msg] = 'Table#fields malformed!'
20
- end
33
+ #end
21
34
  end
22
35
 
23
36
  def check_row(line, index)
@@ -45,6 +45,11 @@ formula_weights = 1, 1, 1
45
45
 
46
46
  [questions]
47
47
 
48
+ ; Default values
49
+ ; fractions = 0 to disable
50
+ ; Only used for multichoice questions
51
+ fractions = 0, -50, -33.33, -25, -20
52
+
48
53
  ; List of values d,b,f,i,s,t
49
54
  stages = d,b,f,i,s,t
50
55
 
@@ -36,7 +36,6 @@
36
36
  </feedback>
37
37
  </answer>
38
38
  <%
39
- question.bads.shuffle! if question.shuffle?
40
39
  question.bads.each do |i|
41
40
  %>
42
41
  <answer fraction="<%= penalty %>" format="html">
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  require 'erb'
4
+ require_relative '../application'
4
5
 
5
6
  # Transform Questions into Gift format
6
7
  module QuestionMoodleFormatter
@@ -11,7 +12,10 @@ module QuestionMoodleFormatter
11
12
  def self.to_s(question)
12
13
  case question.type
13
14
  when :choice
14
- penalties = ['', '-50', '-33.33333', '-25', '-20']
15
+ fractions = Application.instance.config['questions']['fractions']
16
+ # penalties = ['', '-50', '-33.33333', '-25', '-20']
17
+ penalties = fractions
18
+
15
19
  penalty = penalties[question.bads.size]
16
20
  template = File.read(File.join(File.dirname(__FILE__), 'moodle', 'multichoice.erb'))
17
21
  when :boolean
data/lib/asker/version.rb CHANGED
@@ -1,9 +1,10 @@
1
1
 
2
2
  # Global parameters
3
3
  module Version
4
- VERSION = '2.2.4'
4
+ MAJOR_NUMBER = '2.3'
5
+ VERSION = "#{MAJOR_NUMBER}.1"
5
6
  NAME = 'asker'
6
7
  GEM = 'asker-tool'
7
8
  CONFIGFILE = 'asker.ini'
8
- HOMEPAGE = "https://github.com/teuton-software/#{NAME}/tree/v2.2\#readme"
9
+ HOMEPAGE = "https://github.com/teuton-software/#{NAME}"
9
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asker-tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.4
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Vargas Ruiz
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-09 00:00:00.000000000 Z
11
+ date: 2022-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: haml
@@ -266,11 +266,11 @@ files:
266
266
  - lib/asker/logger.rb
267
267
  - lib/asker/skeleton.rb
268
268
  - lib/asker/version.rb
269
- homepage: https://github.com/teuton-software/asker/tree/v2.2#readme
269
+ homepage: https://github.com/teuton-software/asker
270
270
  licenses:
271
271
  - GPL-3.0
272
272
  metadata: {}
273
- post_install_message:
273
+ post_install_message:
274
274
  rdoc_options: []
275
275
  require_paths:
276
276
  - lib
@@ -278,15 +278,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
278
278
  requirements:
279
279
  - - ">="
280
280
  - !ruby/object:Gem::Version
281
- version: 2.6.9
281
+ version: 2.5.5
282
282
  required_rubygems_version: !ruby/object:Gem::Requirement
283
283
  requirements:
284
284
  - - ">="
285
285
  - !ruby/object:Gem::Version
286
286
  version: '0'
287
287
  requirements: []
288
- rubygems_version: 3.1.6
289
- signing_key:
288
+ rubygems_version: 3.3.3
289
+ signing_key:
290
290
  specification_version: 4
291
291
  summary: Asker generates questions from input definitions file.
292
292
  test_files: []