asker-tool 2.3.0 → 2.3.3
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 +2 -5
- data/lib/asker/ai/stages/main.rb +0 -1
- data/lib/asker/ai/stages/stage_b.rb +8 -12
- data/lib/asker/application.rb +3 -2
- data/lib/asker/files/asker.ini +1 -0
- data/lib/asker/files/example-concept.haml +4 -4
- data/lib/asker/formatter/moodle/multichoice.erb +0 -1
- data/lib/asker/formatter/question_moodle_formatter.rb +1 -0
- data/lib/asker/version.rb +1 -1
- metadata +2 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56755735d5f19ad8e304cc5124530c85fc122ed83e883cf2f837b60e0107870b
|
4
|
+
data.tar.gz: a72c98595cf2ab4fd39696725cd658a8709c52de88799d3fffebdbde7f937cfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a22757919609b4931842b2620c456144a9a6991c4362c5881467139353cf35a93f67f74a2b463c0246fe9b66a3a4f1cd6a7917f1ca3810cc881a42e9d48b82f6
|
7
|
+
data.tar.gz: d49c36b5d2993237b5a922e54e0dc36c14019f43d0984f20d50f9c6894c2c603da4d348d774963765ebc87c34869d3ce7c2330b33c77a94f3c03f081f659b715
|
data/README.md
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
[](https://badge.fury.io/rb/asker-tool)
|
2
2
|

|
3
|
-

|
4
3
|
|
5
4
|
# ASKER
|
6
5
|
|
@@ -17,11 +16,9 @@ ASKER helps trainers to create a huge amount of questions, from a definitions (_
|
|
17
16
|
## Installation
|
18
17
|
|
19
18
|
1. Install Ruby on your system.
|
20
|
-
2. Install Asker on your system
|
21
|
-
* (a) `sudo gem install asker-tool` as superuser (root) or
|
22
|
-
* (b) `gem install --user-install asker-tool` as regular user.
|
19
|
+
2. Install Asker on your system: `sudo gem install asker-tool`
|
23
20
|
|
24
|
-
> To update Asker
|
21
|
+
> REMEMBER: To update Asker execute `sudo gem update asker-tool`
|
25
22
|
|
26
23
|
## Usage
|
27
24
|
|
data/lib/asker/ai/stages/main.rb
CHANGED
@@ -31,8 +31,6 @@ class StageB < BaseStage
|
|
31
31
|
|
32
32
|
questions
|
33
33
|
end
|
34
|
-
# rubocop:enable Metrics/AbcSize
|
35
|
-
# rubocop:enable Metrics/MethodLength
|
36
34
|
|
37
35
|
##
|
38
36
|
# Process table data to generate match questions
|
@@ -52,7 +50,7 @@ class StageB < BaseStage
|
|
52
50
|
# Question type <b1match>: match 4 items from the same table
|
53
51
|
e.shuffle!
|
54
52
|
q = Question.new(:match)
|
55
|
-
q.name = "#{name}-#{num}-
|
53
|
+
q.name = "#{name}-#{num}-b1match4-#{p_table.name}"
|
56
54
|
q.tags << 'match'
|
57
55
|
q.tags << 'random'
|
58
56
|
q.text = random_image_for(name) \
|
@@ -64,9 +62,11 @@ class StageB < BaseStage
|
|
64
62
|
# Add an extra line
|
65
63
|
if list2.count.positive?
|
66
64
|
q.matching << ['', list2[0][:data][index2]]
|
65
|
+
q.name = "#{name}-#{num}-b1match4x5-#{p_table.name}"
|
67
66
|
else
|
68
|
-
q.tags << '
|
67
|
+
q.tags << 'misspelled'
|
69
68
|
q.matching << ['', lang.do_mistake_to(e[0][:data][index2])]
|
69
|
+
q.name = "#{name}-#{num}-b1match4x5misspelled-#{p_table.name}"
|
70
70
|
end
|
71
71
|
questions << q
|
72
72
|
|
@@ -85,9 +85,11 @@ class StageB < BaseStage
|
|
85
85
|
# Add an extra line
|
86
86
|
if list2.count.positive?
|
87
87
|
q.matching << ['', list2[0][:data][index2]]
|
88
|
+
q.name = "#{name}-#{num}-b1match3x1misspelledx1error-#{p_table.name}"
|
88
89
|
else
|
89
|
-
q.tags << '
|
90
|
+
q.tags << 'misspelled'
|
90
91
|
q.matching << ['', lang.do_mistake_to(e[0][:data][index2])]
|
92
|
+
q.name = "#{name}-#{num}-b1match3x1misspelledx1misspelled-#{p_table.name}"
|
91
93
|
end
|
92
94
|
questions << q
|
93
95
|
end
|
@@ -103,7 +105,7 @@ class StageB < BaseStage
|
|
103
105
|
# Question 3 items from table-A, and 1 item from table-B
|
104
106
|
if s.count > 3
|
105
107
|
q = Question.new(:match)
|
106
|
-
q.name = "#{name}-#{num}-
|
108
|
+
q.name = "#{name}-#{num}-b1match3x1errorx1misspelled-#{p_table.name}"
|
107
109
|
q.tags << 'match'
|
108
110
|
q.tags << 'random'
|
109
111
|
q.text = random_image_for(name) \
|
@@ -119,10 +121,4 @@ class StageB < BaseStage
|
|
119
121
|
|
120
122
|
questions
|
121
123
|
end
|
122
|
-
# rubocop:enable Metrics/AbcSize
|
123
|
-
# rubocop:enable Metrics/MethodLength
|
124
|
-
# rubocop:enable Metrics/CyclomaticComplexity
|
125
|
-
# rubocop:enable Style/ConditionalAssignment
|
126
|
-
# rubocop:enable Metrics/BlockLength
|
127
|
-
# rubocop:enable Metrics/PerceivedComplexity
|
128
124
|
end
|
data/lib/asker/application.rb
CHANGED
@@ -33,8 +33,9 @@ class Application
|
|
33
33
|
@config['questions']['stages'] = stages.map(&:to_sym)
|
34
34
|
|
35
35
|
fractions = @config['questions']['fractions'].split(',')
|
36
|
-
@config['questions']['fractions'] = fractions
|
37
|
-
|
36
|
+
@config['questions']['fractions'] = fractions + Array.new(5, '0')
|
37
|
+
# require 'debug'; binding.break
|
38
|
+
|
38
39
|
Rainbow.enabled = false
|
39
40
|
Rainbow.enabled = true if @config['global']['color'].downcase == 'yes'
|
40
41
|
end
|
data/lib/asker/files/asker.ini
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
%map{ :
|
1
|
+
%map{ lang: 'en', context: 'music, band', version: '1'}
|
2
2
|
|
3
3
|
%concept
|
4
4
|
%names AC/DC, ACDC
|
5
5
|
%tags rock, band, australia
|
6
6
|
%def Australian rock band formed by Scottish-born brothers Malcolm and Angus Young
|
7
|
-
%table{ :
|
7
|
+
%table{ fields: 'members'}
|
8
8
|
%row Bon Scott
|
9
9
|
%row Angus Young
|
10
10
|
%row Malcolm Young
|
11
11
|
%row Phil Rudd
|
12
12
|
%row Cliff Williams
|
13
|
-
%table{ :
|
13
|
+
%table{ fields: 'attribute, value'}
|
14
14
|
%row
|
15
15
|
%col Genres
|
16
16
|
%col Hard rock blues rock rock and roll
|
@@ -20,7 +20,7 @@
|
|
20
20
|
%row
|
21
21
|
%col Formed in
|
22
22
|
%col Sydney
|
23
|
-
%table{ :
|
23
|
+
%table{ fields: 'Albums', sequence: 'Albums sorted by date'}
|
24
24
|
%row Albums High Voltage
|
25
25
|
%row Powerage
|
26
26
|
%row Highway to Hell
|
@@ -15,6 +15,7 @@ module QuestionMoodleFormatter
|
|
15
15
|
fractions = Application.instance.config['questions']['fractions']
|
16
16
|
# penalties = ['', '-50', '-33.33333', '-25', '-20']
|
17
17
|
penalties = fractions
|
18
|
+
|
18
19
|
penalty = penalties[question.bads.size]
|
19
20
|
template = File.read(File.join(File.dirname(__FILE__), 'moodle', 'multichoice.erb'))
|
20
21
|
when :boolean
|
data/lib/asker/version.rb
CHANGED
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.3.
|
4
|
+
version: 2.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Vargas Ruiz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml
|
@@ -108,48 +108,6 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0.20'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: minitest
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '5.11'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '5.11'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: pry-byebug
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '3.9'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '3.9'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: rubocop
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - "~>"
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0.74'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - "~>"
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0.74'
|
153
111
|
description: ASKER helps trainers to create a huge amount of questions, from a definitions
|
154
112
|
input file.
|
155
113
|
email: teuton.software@protonmail.com
|