asker-tool 2.1.5 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -17
- data/bin/asker +2 -1
- data/lib/asker/ai/ai.rb +10 -3
- data/lib/asker/ai/ai_calculate.rb +20 -6
- data/lib/asker/ai/code/base_code_ai.rb +104 -0
- data/lib/asker/{code/ai → ai/code}/code_ai_factory.rb +11 -1
- data/lib/asker/{code/ai → ai/code}/javascript_code_ai.rb +2 -5
- data/lib/asker/ai/code/problem_code_ai.rb +176 -0
- data/lib/asker/{code/ai → ai/code}/python_code_ai.rb +2 -5
- data/lib/asker/{code/ai → ai/code}/ruby_code_ai.rb +14 -7
- data/lib/asker/{code/ai → ai/code}/sql_code_ai.rb +2 -5
- data/lib/asker/ai/concept_ai.rb +13 -3
- data/lib/asker/ai/question.rb +28 -6
- data/lib/asker/ai/stages/base_stage.rb +45 -6
- data/lib/asker/ai/stages/stage_b.rb +100 -50
- data/lib/asker/ai/stages/stage_d.rb +75 -90
- data/lib/asker/ai/stages/stage_f.rb +64 -36
- data/lib/asker/ai/stages/stage_i.rb +79 -92
- data/lib/asker/ai/stages/stage_s.rb +41 -36
- data/lib/asker/ai/stages/stage_t.rb +149 -108
- data/lib/asker/application.rb +19 -11
- data/lib/asker/cli.rb +31 -44
- data/lib/asker/data/code.rb +62 -0
- data/lib/asker/data/column.rb +31 -21
- data/lib/asker/data/concept.rb +109 -65
- data/lib/asker/data/data_field.rb +14 -0
- data/lib/asker/data/project_data.rb +63 -0
- data/lib/asker/data/row.rb +75 -52
- data/lib/asker/data/table.rb +91 -42
- data/lib/asker/data/template.rb +3 -1
- data/lib/asker/data/world.rb +51 -35
- data/lib/asker/displayer/code_displayer.rb +7 -0
- data/lib/asker/displayer/concept_ai_displayer.erb +10 -0
- data/lib/asker/displayer/concept_ai_displayer.rb +74 -53
- data/lib/asker/displayer/concept_displayer.rb +16 -9
- data/lib/asker/displayer/stats_displayer.rb +12 -3
- data/lib/asker/exporter/concept_ai_gift_exporter.rb +19 -11
- data/lib/asker/exporter/concept_ai_moodle_exporter.rb +44 -0
- data/lib/asker/exporter/concept_ai_yaml_exporter.rb +13 -6
- data/lib/asker/exporter/concept_doc_exporter.rb +14 -1
- data/lib/asker/exporter/data_gift_exporter.rb +29 -0
- data/lib/asker/exporter/output_file_exporter.rb +9 -6
- data/lib/asker/files/{config.ini → asker.ini} +48 -1
- data/lib/asker/files/example-concept.haml +0 -1
- data/lib/asker/files/language/du/connectors.yaml +81 -0
- data/lib/asker/{lang/locales/fr → files/language/du}/mistakes.yaml +1 -1
- data/lib/asker/files/language/du/templates.yaml +29 -0
- data/lib/asker/{lang/locales → files/language}/en/connectors.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/en/mistakes.yaml +0 -0
- data/lib/asker/files/language/en/templates.yaml +29 -0
- data/lib/asker/{lang/locales → files/language}/es/connectors.yaml +0 -0
- data/lib/asker/files/language/es/mistakes.yaml +84 -0
- data/lib/asker/files/language/es/templates.yaml +29 -0
- data/lib/asker/files/language/fr/connectors.yaml +76 -0
- data/lib/asker/{lang/locales/es → files/language/fr}/mistakes.yaml +0 -0
- data/lib/asker/files/language/fr/templates.yaml +29 -0
- data/lib/asker/{lang/locales → files/language}/javascript/connectors.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/javascript/mistakes.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/javascript/templates.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/math/connectors.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/math/mistakes.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/math/templates.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/python/connectors.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/python/mistakes.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/python/templates.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/ruby/connectors.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/ruby/mistakes.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/ruby/templates.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/sql/connectors.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/sql/mistakes.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/sql/templates.yaml +0 -0
- data/lib/asker/formatter/concept_doc_formatter.rb +0 -4
- data/lib/asker/formatter/concept_string_formatter.rb +7 -4
- data/lib/asker/formatter/moodle/matching.erb +38 -0
- data/lib/asker/formatter/moodle/multichoice.erb +49 -0
- data/lib/asker/formatter/moodle/shortanswer.erb +30 -0
- data/lib/asker/formatter/moodle/truefalse.erb +47 -0
- data/lib/asker/formatter/question_gift_formatter.rb +30 -20
- data/lib/asker/formatter/question_moodle_formatter.rb +27 -0
- data/lib/asker/{checker.rb → input_checker.rb} +126 -49
- data/lib/asker/lang/lang.rb +17 -10
- data/lib/asker/lang/lang_factory.rb +32 -5
- data/lib/asker/lang/text_actions.rb +87 -69
- data/lib/asker/loader/code_loader.rb +4 -4
- data/lib/asker/loader/content_loader.rb +21 -19
- data/lib/asker/loader/directory_loader.rb +1 -8
- data/lib/asker/loader/embedded_file.rb +42 -0
- data/lib/asker/loader/file_loader.rb +3 -14
- data/lib/asker/loader/haml_loader.rb +15 -0
- data/lib/asker/loader/image_url_loader.rb +8 -12
- data/lib/asker/loader/input_loader.rb +13 -15
- data/lib/asker/loader/project_loader.rb +25 -15
- data/lib/asker/logger.rb +36 -9
- data/lib/asker/skeleton.rb +23 -13
- data/lib/asker.rb +76 -42
- metadata +53 -54
- data/lib/asker/code/ai/base_code_ai.rb +0 -48
- data/lib/asker/code/code.rb +0 -53
- data/lib/asker/lang/locales/du/templates.yaml +0 -50
- data/lib/asker/lang/locales/en/templates.yaml +0 -29
- data/lib/asker/lang/locales/es/templates.yaml +0 -29
- data/lib/asker/lang/locales/fr/connectors.yaml +0 -92
- data/lib/asker/lang/locales/fr/templates.yaml +0 -29
- data/lib/asker/project.rb +0 -172
data/lib/asker.rb
CHANGED
@@ -2,67 +2,101 @@
|
|
2
2
|
|
3
3
|
require 'rainbow'
|
4
4
|
|
5
|
+
require_relative 'asker/skeleton'
|
6
|
+
require_relative 'asker/input_checker'
|
7
|
+
|
5
8
|
require_relative 'asker/displayer/concept_displayer'
|
6
9
|
require_relative 'asker/displayer/stats_displayer'
|
7
10
|
require_relative 'asker/exporter/output_file_exporter'
|
11
|
+
require_relative 'asker/logger'
|
12
|
+
|
8
13
|
require_relative 'asker/loader/project_loader'
|
9
14
|
require_relative 'asker/loader/input_loader'
|
10
|
-
require_relative 'asker/checker'
|
11
|
-
require_relative 'asker/logger'
|
12
|
-
require_relative 'asker/skeleton'
|
13
15
|
|
14
|
-
##
|
15
|
-
# Asker main class
|
16
16
|
class Asker
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
def self.init
|
18
|
+
Skeleton.create_configuration
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.new_input(dirpath)
|
22
|
+
Skeleton.create_input(dirpath)
|
22
23
|
end
|
23
24
|
|
24
|
-
##
|
25
|
-
# Checking input file syntax
|
26
|
-
# @param filepath (String)
|
27
25
|
def self.check(filepath)
|
28
|
-
|
26
|
+
InputChecker.check(filepath)
|
29
27
|
end
|
30
28
|
|
31
|
-
##
|
32
|
-
# Start working
|
33
|
-
# @param filepath (String) HAML or XML filepath
|
34
29
|
def self.start(filepath)
|
35
|
-
|
36
|
-
ConceptDisplayer.show(data[:concepts]
|
37
|
-
create_output(
|
30
|
+
project_data, data = load_input(filepath)
|
31
|
+
ConceptDisplayer.show(data[:concepts])
|
32
|
+
create_output(project_data, data)
|
38
33
|
end
|
39
34
|
|
40
|
-
##
|
41
|
-
# Load input data
|
42
|
-
# @param args (Hash)
|
43
35
|
private_class_method def self.load_input(args)
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
36
|
+
init_project_data
|
37
|
+
project_data = ProjectLoader.load(args)
|
38
|
+
init_logger(project_data)
|
39
|
+
|
40
|
+
inputdirs = project_data.get(:inputdirs).split(',')
|
41
|
+
internet = Application.instance.config['global']['internet'] == 'yes'
|
42
|
+
data = InputLoader.load(inputdirs, internet)
|
43
|
+
[project_data, data]
|
44
|
+
end
|
45
|
+
|
46
|
+
private_class_method def self.init_project_data()
|
47
|
+
project_data = ProjectData.instance
|
48
|
+
outputdir = Application.instance.config['output']['folder']
|
49
|
+
project_data.set(:outputdir, outputdir)
|
50
|
+
|
51
|
+
formula_weights = Application.instance.config['ai']['formula_weights']
|
52
|
+
project_data.set(:weights, formula_weights)
|
53
|
+
end
|
54
|
+
|
55
|
+
private_class_method def self.init_logger(project_data)
|
56
|
+
# Create log file where to save log messages
|
57
|
+
Logger.create(project_data.get(:logpath),
|
58
|
+
project_data.get(:logname))
|
59
|
+
Logger.instance.set_verbose(Application.instance.config['verbose'])
|
60
|
+
Logger.verboseln '[INFO] Project open'
|
61
|
+
Logger.verboseln ' ├── inputdirs = ' + Rainbow(project_data.get(:inputdirs)).bright
|
62
|
+
Logger.verboseln ' └── process_file = ' + Rainbow(project_data.get(:process_file)).bright
|
48
63
|
end
|
49
64
|
|
50
|
-
##
|
51
|
-
# Create output files: Gift, YAML, TXT Doc
|
52
|
-
# rubocop:disable Metrics/AbcSize
|
53
|
-
# rubocop:disable Metrics/MethodLength
|
54
65
|
private_class_method def self.create_output(project, data)
|
55
|
-
Logger.
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
66
|
+
Logger.verboseln "\n[INFO] Creating output files"
|
67
|
+
m = ' ├── Gift questions file => '
|
68
|
+
m += if Application.instance.config['output']['gift'] == 'yes'
|
69
|
+
Rainbow(project.get(:outputpath)).bright
|
70
|
+
else
|
71
|
+
"#{project.get(:outputpath)} (No)"
|
72
|
+
end
|
73
|
+
Logger.verboseln m
|
74
|
+
|
75
|
+
m = ' ├── Lesson file => '
|
76
|
+
m += if Application.instance.config['output']['doc'] == 'yes'
|
77
|
+
Rainbow(project.get(:lessonpath)).bright
|
78
|
+
else
|
79
|
+
"#{project.get(:lessonpath)} (No)"
|
80
|
+
end
|
81
|
+
Logger.verboseln m
|
82
|
+
|
83
|
+
m = ' ├── YAML questions file => '
|
84
|
+
m += if Application.instance.config['output']['yaml'] == 'yes'
|
85
|
+
Rainbow(project.get(:yamlpath)).bright
|
86
|
+
else
|
87
|
+
"#{project.get(:yamlpath)} (No)"
|
88
|
+
end
|
89
|
+
Logger.verboseln m
|
90
|
+
|
91
|
+
m = ' └── Moodle XML file => '
|
92
|
+
m += if Application.instance.config['output']['moodle'] == 'yes'
|
93
|
+
Rainbow(project.get(:moodlepath)).bright
|
94
|
+
else
|
95
|
+
"#{project.get(:moodlepath)} (No)"
|
96
|
+
end
|
97
|
+
Logger.verboseln m
|
62
98
|
OutputFileExporter.export(data, project)
|
63
|
-
StatsDisplayer.show(data
|
64
|
-
|
99
|
+
StatsDisplayer.show(data)
|
100
|
+
Logger.close
|
65
101
|
end
|
66
|
-
# rubocop:enable Metrics/AbcSize
|
67
|
-
# rubocop:enable Metrics/MethodLength
|
68
102
|
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.1
|
4
|
+
version: 2.2.1
|
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:
|
11
|
+
date: 2022-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.20'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: base64_compatible
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0.0'
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0.0'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: minitest
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -138,6 +124,13 @@ files:
|
|
138
124
|
- lib/asker.rb
|
139
125
|
- lib/asker/ai/ai.rb
|
140
126
|
- lib/asker/ai/ai_calculate.rb
|
127
|
+
- lib/asker/ai/code/base_code_ai.rb
|
128
|
+
- lib/asker/ai/code/code_ai_factory.rb
|
129
|
+
- lib/asker/ai/code/javascript_code_ai.rb
|
130
|
+
- lib/asker/ai/code/problem_code_ai.rb
|
131
|
+
- lib/asker/ai/code/python_code_ai.rb
|
132
|
+
- lib/asker/ai/code/ruby_code_ai.rb
|
133
|
+
- lib/asker/ai/code/sql_code_ai.rb
|
141
134
|
- lib/asker/ai/concept_ai.rb
|
142
135
|
- lib/asker/ai/question.rb
|
143
136
|
- lib/asker/ai/stages/base_stage.rb
|
@@ -149,84 +142,90 @@ files:
|
|
149
142
|
- lib/asker/ai/stages/stage_s.rb
|
150
143
|
- lib/asker/ai/stages/stage_t.rb
|
151
144
|
- lib/asker/application.rb
|
152
|
-
- lib/asker/checker.rb
|
153
145
|
- lib/asker/cli.rb
|
154
|
-
- lib/asker/code
|
155
|
-
- lib/asker/code/ai/code_ai_factory.rb
|
156
|
-
- lib/asker/code/ai/javascript_code_ai.rb
|
157
|
-
- lib/asker/code/ai/python_code_ai.rb
|
158
|
-
- lib/asker/code/ai/ruby_code_ai.rb
|
159
|
-
- lib/asker/code/ai/sql_code_ai.rb
|
160
|
-
- lib/asker/code/code.rb
|
146
|
+
- lib/asker/data/code.rb
|
161
147
|
- lib/asker/data/column.rb
|
162
148
|
- lib/asker/data/concept.rb
|
163
149
|
- lib/asker/data/data_field.rb
|
150
|
+
- lib/asker/data/project_data.rb
|
164
151
|
- lib/asker/data/row.rb
|
165
152
|
- lib/asker/data/table.rb
|
166
153
|
- lib/asker/data/template.rb
|
167
154
|
- lib/asker/data/world.rb
|
168
155
|
- lib/asker/displayer/code_displayer.rb
|
156
|
+
- lib/asker/displayer/concept_ai_displayer.erb
|
169
157
|
- lib/asker/displayer/concept_ai_displayer.rb
|
170
158
|
- lib/asker/displayer/concept_displayer.rb
|
171
159
|
- lib/asker/displayer/stats_displayer.rb
|
172
160
|
- lib/asker/exporter/code_gift_exporter.rb
|
173
161
|
- lib/asker/exporter/concept_ai_gift_exporter.rb
|
162
|
+
- lib/asker/exporter/concept_ai_moodle_exporter.rb
|
174
163
|
- lib/asker/exporter/concept_ai_yaml_exporter.rb
|
175
164
|
- lib/asker/exporter/concept_doc_exporter.rb
|
165
|
+
- lib/asker/exporter/data_gift_exporter.rb
|
176
166
|
- lib/asker/exporter/output_file_exporter.rb
|
177
|
-
- lib/asker/files/
|
167
|
+
- lib/asker/files/asker.ini
|
178
168
|
- lib/asker/files/example-code.haml
|
179
169
|
- lib/asker/files/example-concept.haml
|
170
|
+
- lib/asker/files/language/du/connectors.yaml
|
171
|
+
- lib/asker/files/language/du/mistakes.yaml
|
172
|
+
- lib/asker/files/language/du/templates.yaml
|
173
|
+
- lib/asker/files/language/en/connectors.yaml
|
174
|
+
- lib/asker/files/language/en/mistakes.yaml
|
175
|
+
- lib/asker/files/language/en/templates.yaml
|
176
|
+
- lib/asker/files/language/es/connectors.yaml
|
177
|
+
- lib/asker/files/language/es/mistakes.yaml
|
178
|
+
- lib/asker/files/language/es/templates.yaml
|
179
|
+
- lib/asker/files/language/fr/connectors.yaml
|
180
|
+
- lib/asker/files/language/fr/mistakes.yaml
|
181
|
+
- lib/asker/files/language/fr/templates.yaml
|
182
|
+
- lib/asker/files/language/javascript/connectors.yaml
|
183
|
+
- lib/asker/files/language/javascript/mistakes.yaml
|
184
|
+
- lib/asker/files/language/javascript/templates.yaml
|
185
|
+
- lib/asker/files/language/math/connectors.yaml
|
186
|
+
- lib/asker/files/language/math/mistakes.yaml
|
187
|
+
- lib/asker/files/language/math/templates.yaml
|
188
|
+
- lib/asker/files/language/python/connectors.yaml
|
189
|
+
- lib/asker/files/language/python/mistakes.yaml
|
190
|
+
- lib/asker/files/language/python/templates.yaml
|
191
|
+
- lib/asker/files/language/ruby/connectors.yaml
|
192
|
+
- lib/asker/files/language/ruby/mistakes.yaml
|
193
|
+
- lib/asker/files/language/ruby/templates.yaml
|
194
|
+
- lib/asker/files/language/sql/connectors.yaml
|
195
|
+
- lib/asker/files/language/sql/mistakes.yaml
|
196
|
+
- lib/asker/files/language/sql/templates.yaml
|
180
197
|
- lib/asker/formatter/code_string_formatter.rb
|
181
198
|
- lib/asker/formatter/concept_doc_formatter.rb
|
182
199
|
- lib/asker/formatter/concept_string_formatter.rb
|
200
|
+
- lib/asker/formatter/moodle/matching.erb
|
201
|
+
- lib/asker/formatter/moodle/multichoice.erb
|
202
|
+
- lib/asker/formatter/moodle/shortanswer.erb
|
203
|
+
- lib/asker/formatter/moodle/truefalse.erb
|
183
204
|
- lib/asker/formatter/question_gift_formatter.rb
|
184
205
|
- lib/asker/formatter/question_hash_formatter.rb
|
206
|
+
- lib/asker/formatter/question_moodle_formatter.rb
|
185
207
|
- lib/asker/formatter/question_moodlexml_formatter.rb
|
186
208
|
- lib/asker/formatter/rb2haml_formatter.rb
|
209
|
+
- lib/asker/input_checker.rb
|
187
210
|
- lib/asker/lang/lang.rb
|
188
211
|
- lib/asker/lang/lang_factory.rb
|
189
|
-
- lib/asker/lang/locales/du/templates.yaml
|
190
|
-
- lib/asker/lang/locales/en/connectors.yaml
|
191
|
-
- lib/asker/lang/locales/en/mistakes.yaml
|
192
|
-
- lib/asker/lang/locales/en/templates.yaml
|
193
|
-
- lib/asker/lang/locales/es/connectors.yaml
|
194
|
-
- lib/asker/lang/locales/es/mistakes.yaml
|
195
|
-
- lib/asker/lang/locales/es/templates.yaml
|
196
|
-
- lib/asker/lang/locales/fr/connectors.yaml
|
197
|
-
- lib/asker/lang/locales/fr/mistakes.yaml
|
198
|
-
- lib/asker/lang/locales/fr/templates.yaml
|
199
|
-
- lib/asker/lang/locales/javascript/connectors.yaml
|
200
|
-
- lib/asker/lang/locales/javascript/mistakes.yaml
|
201
|
-
- lib/asker/lang/locales/javascript/templates.yaml
|
202
|
-
- lib/asker/lang/locales/math/connectors.yaml
|
203
|
-
- lib/asker/lang/locales/math/mistakes.yaml
|
204
|
-
- lib/asker/lang/locales/math/templates.yaml
|
205
|
-
- lib/asker/lang/locales/python/connectors.yaml
|
206
|
-
- lib/asker/lang/locales/python/mistakes.yaml
|
207
|
-
- lib/asker/lang/locales/python/templates.yaml
|
208
|
-
- lib/asker/lang/locales/ruby/connectors.yaml
|
209
|
-
- lib/asker/lang/locales/ruby/mistakes.yaml
|
210
|
-
- lib/asker/lang/locales/ruby/templates.yaml
|
211
|
-
- lib/asker/lang/locales/sql/connectors.yaml
|
212
|
-
- lib/asker/lang/locales/sql/mistakes.yaml
|
213
|
-
- lib/asker/lang/locales/sql/templates.yaml
|
214
212
|
- lib/asker/lang/text_actions.rb
|
215
213
|
- lib/asker/loader/code_loader.rb
|
216
214
|
- lib/asker/loader/content_loader.rb
|
217
215
|
- lib/asker/loader/directory_loader.rb
|
216
|
+
- lib/asker/loader/embedded_file.rb
|
218
217
|
- lib/asker/loader/file_loader.rb
|
218
|
+
- lib/asker/loader/haml_loader.rb
|
219
219
|
- lib/asker/loader/image_url_loader.rb
|
220
220
|
- lib/asker/loader/input_loader.rb
|
221
221
|
- lib/asker/loader/project_loader.rb
|
222
222
|
- lib/asker/logger.rb
|
223
|
-
- lib/asker/project.rb
|
224
223
|
- lib/asker/skeleton.rb
|
225
|
-
homepage: https://github.com/
|
224
|
+
homepage: https://github.com/teuton-software/asker/tree/v2.2
|
226
225
|
licenses:
|
227
226
|
- GPL-3.0
|
228
227
|
metadata: {}
|
229
|
-
post_install_message:
|
228
|
+
post_install_message:
|
230
229
|
rdoc_options: []
|
231
230
|
require_paths:
|
232
231
|
- lib
|
@@ -234,7 +233,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
234
233
|
requirements:
|
235
234
|
- - ">="
|
236
235
|
- !ruby/object:Gem::Version
|
237
|
-
version: 2.
|
236
|
+
version: 2.6.9
|
238
237
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
239
238
|
requirements:
|
240
239
|
- - ">="
|
@@ -1,48 +0,0 @@
|
|
1
|
-
|
2
|
-
require_relative '../../lang/lang_factory'
|
3
|
-
require_relative '../../ai/question'
|
4
|
-
|
5
|
-
class BaseCodeAI
|
6
|
-
def name
|
7
|
-
File.basename(@data_object.filename)
|
8
|
-
end
|
9
|
-
|
10
|
-
def num
|
11
|
-
@num += 1
|
12
|
-
end
|
13
|
-
|
14
|
-
def clone_array(array)
|
15
|
-
out = []
|
16
|
-
array.each { |item| out << item.dup }
|
17
|
-
out
|
18
|
-
end
|
19
|
-
|
20
|
-
def lines_to_s(lines)
|
21
|
-
out = ''
|
22
|
-
lines.each_with_index do |line,index|
|
23
|
-
out << "%2d: #{line}\n"%(index+1)
|
24
|
-
end
|
25
|
-
out
|
26
|
-
end
|
27
|
-
|
28
|
-
def lines_to_html(lines)
|
29
|
-
out = ''
|
30
|
-
lines.each_with_index do |line,index|
|
31
|
-
out << "%2d: #{line}</br>"%(index+1)
|
32
|
-
end
|
33
|
-
out
|
34
|
-
end
|
35
|
-
|
36
|
-
def find_make_methods
|
37
|
-
list = self.public_methods.sort
|
38
|
-
list.select! { |name| name.to_s.start_with? 'make_'}
|
39
|
-
list.delete(:make_questions)
|
40
|
-
list
|
41
|
-
end
|
42
|
-
|
43
|
-
def make_questions
|
44
|
-
list = find_make_methods
|
45
|
-
list.each { |m| @questions += self.send m }
|
46
|
-
@questions
|
47
|
-
end
|
48
|
-
end
|
data/lib/asker/code/code.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
require_relative 'ai/code_ai_factory'
|
2
|
-
require_relative '../project'
|
3
|
-
require_relative '../formatter/code_string_formatter'
|
4
|
-
|
5
|
-
# Contains code data input
|
6
|
-
class Code
|
7
|
-
attr_reader :dirname, :filename, :type
|
8
|
-
attr_accessor :process, :features
|
9
|
-
attr_reader :lines, :questions
|
10
|
-
|
11
|
-
def initialize(dirname, filename, type)
|
12
|
-
@dirname = dirname
|
13
|
-
@filename = filename
|
14
|
-
@type = type
|
15
|
-
@filepath = File.join(@dirname, @filename)
|
16
|
-
@process = false
|
17
|
-
@features = []
|
18
|
-
@lines = load(@filepath)
|
19
|
-
@questions = []
|
20
|
-
@code_ai = CodeAIFactory.get(self)
|
21
|
-
end
|
22
|
-
|
23
|
-
def process?
|
24
|
-
@process
|
25
|
-
end
|
26
|
-
|
27
|
-
def make_questions
|
28
|
-
return unless process?
|
29
|
-
@questions += @code_ai.make_questions
|
30
|
-
end
|
31
|
-
|
32
|
-
def lines_to_s(lines)
|
33
|
-
out = ''
|
34
|
-
lines.each_with_index do |line, index|
|
35
|
-
out << format("%2d| #{line}\n", (index + 1))
|
36
|
-
end
|
37
|
-
out
|
38
|
-
end
|
39
|
-
|
40
|
-
def debug
|
41
|
-
out = CodeStringFormatter.to_s(self)
|
42
|
-
p = Project.instance
|
43
|
-
p.verbose out
|
44
|
-
end
|
45
|
-
|
46
|
-
private
|
47
|
-
|
48
|
-
def load(filepath)
|
49
|
-
return if filepath.nil?
|
50
|
-
content = File.read(filepath)
|
51
|
-
content.split("\n")
|
52
|
-
end
|
53
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
---
|
2
|
-
:none: keine Antwort ist richtig
|
3
|
-
:error: Fehler
|
4
|
-
:misspelling: Rechtschreibfehler
|
5
|
-
:true: richtig
|
6
|
-
:false: falsch
|
7
|
-
:d1: 'Bedeutung \: <i><%=text1%></i><br/> Wählen Sie die dazu passende Option aus, die am besten zu der vorstehenden Bedeutung passt.<br/>'
|
8
|
-
:d2: 'Bedeutung des Begriffs <b><%=text1%></b>\:<br/> <i><%=text2%></i><br/>'
|
9
|
-
:d3: 'Bedeutung des Begriffs <b><%=text1%></b>\:<br/> <i><%=text2%></i><br/></br><p> Bemerkung: Ein Fragezeichnen stellt einen Buchstaben dar, und ein Sternchen steht für ein Wort oder mehrere Wörter.</p>'
|
10
|
-
:d4: 'Bedeutung des Begriffs <b><%=text1%></b>\:<br/> <i><%=text2%></i><br/><br/>(Setzen Sie die Wörter in die Lücken ein)'
|
11
|
-
|
12
|
-
:b1: 'En relación al concepto <b><%=text1%></b>, asocia cada "<%=text2%>" con su "<%=text3%>".<br/>'
|
13
|
-
:f1: 'Los siguientes elementos son "<%=text2%>" del concepto <b><%=text1%></b>\:<ul><li><%=text3%></li></ul>'
|
14
|
-
:f2: 'Los siguientes elementos son "<%=text2%>".<br/>Selecciona la opción que no pertenezca al concepto <b><%=text1%></b>.'
|
15
|
-
:f3: 'Los siguientes elementos son "<%=text2%>" del concepto <b><%=text1%></b>\:<br><p><%=text3%></p>(Coloca cada palabra en su posición correcta dentro del texto)'
|
16
|
-
:i1: '<img src="<%=text1%>" alt\="image" width="400" height="300"><br/>Elige la opción que mejor se corresponda con la imagen anterior.<br/>'
|
17
|
-
:i2: '<img src="<%=text1%>" alt\="image" width="400" height="300"><br/>La imagen anterior corresponde a <b><%=text2%></b>.'
|
18
|
-
:i3: '<img src="<%=text1%>" alt\="image" width="400" height="300"><br/>Escribe la opción <%=text2%>, que mejor corresponda con la imagen anterior.<br/>'
|
19
|
-
:i4: '<img src="<%=text1%>" alt\="image" width="400" height="300"><br/>Definición\: <i><%=text2%></i><br/><br/>(Coloca cada palabra en su posición correcta dentro del texto)'
|
20
|
-
:s1: 'En relación al concepto <b><%=text1%></b>, ordena cada "<%=text2%>" de modo que se cumpla el criterio "<%=text3%>".<br/>'
|
21
|
-
:t1table: 'Concepto <b><%=text1%></b><br/><%=text2%>\: [*]<br/><%=text3%>\: "<%=text4%>"<br/>Elige la opción correcta.<br/>'
|
22
|
-
:t2table: 'Concepto <b><%=text1%></b><br/><%=text2%>\: [*]<br/><%=text3%>\: "<%=text4%>"<br/>Elige la opción correcta.<br/>'
|
23
|
-
:t3table: 'Concepto <b><%=text1%></b><br/><%=text2%>\: "<%=text3%>"<br/><%=text4%>: [*]<br/>Elige la opción correcta.<br/>'
|
24
|
-
:t4table: 'Concepto <b><%=text1%></b><br/><%=text2%>\: "<%=text3%>"<br/><%=text4%>: [*]<br/>Elige la opción correcta.<br/>'
|
25
|
-
:t5table: 'Concepto <b><%=text1%></b><br/>La asociación siguiente es correcta\:<br/><ul><li><%=text2%>\: "<%=text3%>"</li><li><%=text4%>\: "<%=text5%>"</li></ul>'
|
26
|
-
:t6table: 'Concepto <b><%=text1%></b><br/>La asociación siguiente es correcta\:<br/><ul><li><%=text2%>\: "<%=text3%>"</li><li><%=text4%>\: "<%=text5%>"</li></ul>'
|
27
|
-
:t7table: 'Concepto <b><%=text1%></b><br/>La asociación siguiente es correcta\:<br/><ul><li><%=text2%>\: "<%=text3%>"</li><li><%=text4%>\: "<%=text5%>"</li></ul>'
|
28
|
-
:t8table: 'Concepto <b><%=text1%></b><br/>Completa la siguiente asociación\:<br/><ul><li><%=text2%>\: "<%=text3%>"</li><li><%=text4%>\: [*]</li></ul>Escribir una palabra.<br/>'
|
29
|
-
:t9table: 'Concepto <b><%=text1%></b><br/>Completa la siguiente asociación\:<br/><ul><li><%=text2%>\: "<%=text3%>"</li><li><%=text4%>\: <%=text5%></li></ul>Escribir <%=text6%> palabras.<br/>'
|
30
|
-
:code1: '<pre><%=text1%></pre><br/><p>Escribir el número de línea donde está el primer error. Escribir 0 si no hay ningún error.</p>'
|
31
|
-
|
32
|
-
B1: In Bezug auf den Begriff (+++++), verbinden Sie die passenden Begriffe.
|
33
|
-
F1: Die folgenden Elemente sind (+++++) des Begriffs (++++)
|
34
|
-
F2: Die folgenden Elemente sind (+++++) Wählen Sie die Antwortmöglichkeit aus, die nicht zum Begriff (++++) passt
|
35
|
-
F3: Die folgenden Elemente sind (+++++) des Begriffs (++++) (Setzen Sie die Wörter in die Lücken ein)
|
36
|
-
I1: Wählen Sie die Antwortmöglichkeit, die am besten zu dem gezeigten Bild passt.
|
37
|
-
I2: Das gezeigte Bild gehört zu (++++)
|
38
|
-
I3: Setzen Sie die Antwort ein (+++), die am besten zu dem gezeigten Bild passt.
|
39
|
-
I4: Bedeutung (Setzen Sie die Wörter in die Lücken ein)
|
40
|
-
S1: Beziehen Sie sich auf den Begriff (+++++) und ordnen Sie die richtigen Lösungen zu.
|
41
|
-
T1: Begriff / Wählen Sie die richtige Lösung aus.
|
42
|
-
T2: Begriff / Wählen Sie die richtige Lösung aus.
|
43
|
-
T3: Begriff / Wählen Sie die richtige Lösung aus.
|
44
|
-
T4: Begriff / Wählen Sie die richtige Lösung aus.
|
45
|
-
T5: Begriff / Die Lösung ist richtig
|
46
|
-
T6: Begriff / Die Lösung ist richtig
|
47
|
-
T7: Begriff / Die Lösung ist richtig
|
48
|
-
T8: Begriff / Vervollständigen Sie / Schreiben Sie einen Begriff
|
49
|
-
T9: Begriff / Verbinden Sie / Schreiben Sie fogende Begriffe
|
50
|
-
Code1: Nennen Sie die Nummer der Zeile, in der sich der erste Fehler befindet / Wenn es keinen Fehler gibt, setzen Sie 0 ein.
|
@@ -1,29 +0,0 @@
|
|
1
|
-
---
|
2
|
-
:none: 'No correct'
|
3
|
-
:error: 'Error'
|
4
|
-
:misspelling: 'Misspelling'
|
5
|
-
:true: 'True'
|
6
|
-
:false: 'False'
|
7
|
-
:d1: 'Definition\: <i><%=text1%></i><br/>Choose the best association for the previous definition.<br/>'
|
8
|
-
:d2: 'Definition of <b><%=text1%></b>\:<br/> <i><%=text2%></i><br/>'
|
9
|
-
:d3: 'Definition of <b><%=text1%></b>\:<br/> <i><%=text2%></i><br/><p>Note: Every ? symbol represents one letter, and * severals.</p>'
|
10
|
-
:d4: 'Definition of <b><%=text1%></b>\:<br/> <i><%=text2%></i><br/><br/>(Put every word into the right position)'
|
11
|
-
:b1: 'Related with concept <b><%=text1%></b>, associate every "<%=text2%>" with their "<%=text3%>".<br/>'
|
12
|
-
:f1: 'The next items are "<%=text2%>" from <b><%=text1%></b> concept\:<br/><ul><li><%=text3%></li></ul>'
|
13
|
-
:f2: 'The next items are "<%=text2%>".<br/>Choose the option that not belongs concept <b><%=text1%></b>.'
|
14
|
-
:f3: 'The next items are ""<%=text2%>" from <b><%=text1%></b> concept\:<br><p><%=text3%></p>(Put every word into the right position)'
|
15
|
-
:i1: '<img src="<%=text1%>" alt\="image" width="400" height="300"><br/>Choose the best association for the previous image.<br/>'
|
16
|
-
:i2: '<img src="<%=text1%>" alt\="image" width="400" height="300"><br/>The previous image corresponds to <b><%=text2%></b>.'
|
17
|
-
:i3: '<img src="<%=text1%>" alt\="image" width="400" height="300"><br/>Write the best answer <%=text2%>, for the previous image.<br/>'
|
18
|
-
:i4: '<img src="<%=text1%>" alt\="image" width="400" height="300"><br/>Definition\:<br/> <i><%=text2%></i><br/><br/>(Put every word in the right text position)'
|
19
|
-
:s1: "About <b><%=text1%></b> concept, sort every \"<%=text2%>\", so It is true that \"<%=text3%>\".<br/>"
|
20
|
-
:t1table: '<b>Concept <%=text1%></b><br/><%=text2%>\: [*]<br/><%=text3%>: "<%=text4%>"<br/>Choose the right answer.<br/>'
|
21
|
-
:t2table: '<b>Concept <%=text1%></b><br/><%=text2%>\: [*]<br/><%=text3%>: "<%=text4%>"<br/>Choose the right answer.<br/>'
|
22
|
-
:t3table: '<b>Concept <%=text1%></b><br/><%=text2%>\: "<%=text3%>"<br/><%=text4%>\: [*]<br/>Choose the right answer.<br/>'
|
23
|
-
:t4table: '<b>Concept <%=text1%></b><br/><%=text2%>\: "<%=text3%>"<br/><%=text4%>\: [*]<br/>Choose the right answer.<br/>'
|
24
|
-
:t5table: '<b>Concept <%=text1%></b><br/>The next association is right\:<br/><ul><li><%=text2%>\: "<%=text3%>"</li><li><%=text4%>\: "<%=text5%>"</li></ul>'
|
25
|
-
:t6table: '<b>Concept <%=text1%></b><br/>The next association is right\:<br/><ul><li><%=text2%>\: "<%=text3%>"</li><li><%=text4%>\: "<%=text5%>"</li></ul>'
|
26
|
-
:t7table: '<b>Concept <%=text1%></b><br/>The next association is right\:<br/><ul><li><%=text2%>\: "<%=text3%>"</li><li><%=text4%>\: "<%=text5%>"</li></ul>'
|
27
|
-
:t8table: '<b>Concept <%=text1%></b><br/>Complete the next association\:<br/><ul><li><%=text2%>\: "<%=text3%>"</li><li><%=text4%>\: [*]</li></ul>Write only one word.<br/>'
|
28
|
-
:t9table: '<b>Concept <%=text1%></b><br/>Complete the next association\:<br/><ul><li><%=text2%>\: "<%=text3%>"</li><li><%=text4%>\: <%=text5%></li></ul>Write <%=text6%> words.<br/>'
|
29
|
-
:code1: '<pre><%=text1%></pre><br/><p>Write the number of the first wrong line. Write 0 if there is no fail.</p>'
|
@@ -1,29 +0,0 @@
|
|
1
|
-
---
|
2
|
-
:none: 'Ninguna es correcta'
|
3
|
-
:error: 'Error'
|
4
|
-
:misspelling: 'Error ortográfico'
|
5
|
-
:true: 'Verdadero'
|
6
|
-
:false: 'Falso'
|
7
|
-
:d1: 'Definición \: <i><%=text1%></i><br/>Elige la opción que mejor se corresponda con la definición anterior.<br/>'
|
8
|
-
:d2: 'Definición de <b><%=text1%></b>\:<br/> <i><%=text2%></i><br/>'
|
9
|
-
:d3: 'Definición de <b><%=text1%></b>\:<br/> <i><%=text2%></i><br/></br><p>Nota: Cada símbolo ? representa una letra, y * a una o varias palabras.</p>'
|
10
|
-
:d4: 'Definición de <b><%=text1%></b>\:<br/> <i><%=text2%></i><br/><br/>(Coloca cada palabra en su posición correcta dentro del texto)'
|
11
|
-
:b1: 'En relación al concepto <b><%=text1%></b>, asocia cada "<%=text2%>" con su "<%=text3%>".<br/>'
|
12
|
-
:f1: 'Los siguientes elementos son "<%=text2%>" del concepto <b><%=text1%></b>\:<ul><li><%=text3%></li></ul>'
|
13
|
-
:f2: 'Los siguientes elementos son "<%=text2%>".<br/>Selecciona la opción que no pertenezca al concepto <b><%=text1%></b>.'
|
14
|
-
:f3: 'Los siguientes elementos son "<%=text2%>" del concepto <b><%=text1%></b>\:<br><p><%=text3%></p>(Coloca cada palabra en su posición correcta dentro del texto)'
|
15
|
-
:i1: '<img src="<%=text1%>" alt\="image" width="400" height="300"><br/>Elige la opción que mejor se corresponda con la imagen anterior.<br/>'
|
16
|
-
:i2: '<img src="<%=text1%>" alt\="image" width="400" height="300"><br/>La imagen anterior corresponde a <b><%=text2%></b>.'
|
17
|
-
:i3: '<img src="<%=text1%>" alt\="image" width="400" height="300"><br/>Escribe la opción <%=text2%>, que mejor corresponda con la imagen anterior.<br/>'
|
18
|
-
:i4: '<img src="<%=text1%>" alt\="image" width="400" height="300"><br/>Definición\: <i><%=text2%></i><br/><br/>(Coloca cada palabra en su posición correcta dentro del texto)'
|
19
|
-
:s1: 'En relación al concepto <b><%=text1%></b>, ordena cada/las/los "<%=text2%>" de modo que se cumpla el criterio "<%=text3%>".<br/>'
|
20
|
-
:t1table: 'Concepto <b><%=text1%></b><br/><%=text2%>\: [*]<br/><%=text3%>\: "<%=text4%>"<br/>Elige la opción correcta.<br/>'
|
21
|
-
:t2table: 'Concepto <b><%=text1%></b><br/><%=text2%>\: [*]<br/><%=text3%>\: "<%=text4%>"<br/>Elige la opción correcta.<br/>'
|
22
|
-
:t3table: 'Concepto <b><%=text1%></b><br/><%=text2%>\: "<%=text3%>"<br/><%=text4%>: [*]<br/>Elige la opción correcta.<br/>'
|
23
|
-
:t4table: 'Concepto <b><%=text1%></b><br/><%=text2%>\: "<%=text3%>"<br/><%=text4%>: [*]<br/>Elige la opción correcta.<br/>'
|
24
|
-
:t5table: 'Concepto <b><%=text1%></b><br/>La asociación siguiente es correcta\:<br/><ul><li><%=text2%>\: "<%=text3%>"</li><li><%=text4%>\: "<%=text5%>"</li></ul>'
|
25
|
-
:t6table: 'Concepto <b><%=text1%></b><br/>La asociación siguiente es correcta\:<br/><ul><li><%=text2%>\: "<%=text3%>"</li><li><%=text4%>\: "<%=text5%>"</li></ul>'
|
26
|
-
:t7table: 'Concepto <b><%=text1%></b><br/>La asociación siguiente es correcta\:<br/><ul><li><%=text2%>\: "<%=text3%>"</li><li><%=text4%>\: "<%=text5%>"</li></ul>'
|
27
|
-
:t8table: 'Concepto <b><%=text1%></b><br/>Completa la siguiente asociación\:<br/><ul><li><%=text2%>\: "<%=text3%>"</li><li><%=text4%>\: [*]</li></ul>Escribir una palabra.<br/>'
|
28
|
-
:t9table: 'Concepto <b><%=text1%></b><br/>Completa la siguiente asociación\:<br/><ul><li><%=text2%>\: "<%=text3%>"</li><li><%=text4%>\: <%=text5%></li></ul>Escribir <%=text6%> palabras.<br/>'
|
29
|
-
:code1: '<pre><%=text1%></pre><br/><p>Escribir el número de línea donde está el primer error. Escribir 0 si no hay ningún error.</p>'
|
@@ -1,92 +0,0 @@
|
|
1
|
-
---
|
2
|
-
- '[*]'
|
3
|
-
- a
|
4
|
-
- al
|
5
|
-
- ante
|
6
|
-
- bajo
|
7
|
-
- cada
|
8
|
-
- como
|
9
|
-
- cómo
|
10
|
-
- con
|
11
|
-
- contra
|
12
|
-
- cuando
|
13
|
-
- cuanto
|
14
|
-
- cual
|
15
|
-
- de
|
16
|
-
- del
|
17
|
-
- desde
|
18
|
-
- e
|
19
|
-
- en
|
20
|
-
- entre
|
21
|
-
- él
|
22
|
-
- el
|
23
|
-
- ella
|
24
|
-
- ellos
|
25
|
-
- es
|
26
|
-
- ese
|
27
|
-
- esa
|
28
|
-
- eso
|
29
|
-
- esos
|
30
|
-
- esas
|
31
|
-
- este
|
32
|
-
- esto
|
33
|
-
- esta
|
34
|
-
- estos
|
35
|
-
- estas
|
36
|
-
- hacia
|
37
|
-
- hasta
|
38
|
-
- la
|
39
|
-
- las
|
40
|
-
- lo
|
41
|
-
- los
|
42
|
-
- le
|
43
|
-
- les
|
44
|
-
- mas
|
45
|
-
- más
|
46
|
-
- mi
|
47
|
-
- me
|
48
|
-
- muy
|
49
|
-
- muchos
|
50
|
-
- mucho
|
51
|
-
- no
|
52
|
-
- nos
|
53
|
-
- nosotros
|
54
|
-
- o
|
55
|
-
- para
|
56
|
-
- pero
|
57
|
-
- por
|
58
|
-
- porqué
|
59
|
-
- porque
|
60
|
-
- que
|
61
|
-
- qué
|
62
|
-
- quien
|
63
|
-
- si
|
64
|
-
- sin
|
65
|
-
- sobre
|
66
|
-
- toda
|
67
|
-
- todas
|
68
|
-
- todo
|
69
|
-
- todos
|
70
|
-
- tras
|
71
|
-
- tu
|
72
|
-
- tú
|
73
|
-
- se
|
74
|
-
- su
|
75
|
-
- sus
|
76
|
-
- suyo
|
77
|
-
- suyos
|
78
|
-
- mío
|
79
|
-
- míos
|
80
|
-
- u
|
81
|
-
- un
|
82
|
-
- uno
|
83
|
-
- unos
|
84
|
-
- una
|
85
|
-
- unas
|
86
|
-
- vosotros
|
87
|
-
- vuestro
|
88
|
-
- vuestros
|
89
|
-
- nuestro
|
90
|
-
- nuestros
|
91
|
-
- y
|
92
|
-
- yo
|