asker-tool 2.3.3 → 2.4.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: 56755735d5f19ad8e304cc5124530c85fc122ed83e883cf2f837b60e0107870b
4
- data.tar.gz: a72c98595cf2ab4fd39696725cd658a8709c52de88799d3fffebdbde7f937cfe
3
+ metadata.gz: ac1fb3da092335cdb8fe69f179547de5ec2f17b7b4fecd0537e1ec13976f7c51
4
+ data.tar.gz: 41613de8a7474c877e9b36c631e16a4ecd1fa83e285cad1820f7f2ca76ef639a
5
5
  SHA512:
6
- metadata.gz: a22757919609b4931842b2620c456144a9a6991c4362c5881467139353cf35a93f67f74a2b463c0246fe9b66a3a4f1cd6a7917f1ca3810cc881a42e9d48b82f6
7
- data.tar.gz: d49c36b5d2993237b5a922e54e0dc36c14019f43d0984f20d50f9c6894c2c603da4d348d774963765ebc87c34869d3ce7c2330b33c77a94f3c03f081f659b715
6
+ metadata.gz: 807ca9e728b41f823e64d0c65ea64c8c4aca25a9bae2fc41ed64be5bbb6de0e0cf67989f8f3b0852db7eb8de767266afad27ee9feaab494243bcb58985502aad
7
+ data.tar.gz: ef63e746954850b2eb64214753801e4736f6438c89f5a3eae3a0761ab828d9d4b303d022923011dbb21e718ec0df86c9b6e579e626090de6197f73e8f26f12e9
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'set'
4
2
 
5
3
  require_relative 'base_stage'
@@ -50,7 +48,7 @@ class StageB < BaseStage
50
48
  # Question type <b1match>: match 4 items from the same table
51
49
  e.shuffle!
52
50
  q = Question.new(:match)
53
- q.name = "#{name}-#{num}-b1match4-#{p_table.name}"
51
+ q.name = "#{name}-#{num}-b1match4x4-#{p_table.name}"
54
52
  q.tags << 'match'
55
53
  q.tags << 'random'
56
54
  q.text = random_image_for(name) \
@@ -59,21 +57,43 @@ class StageB < BaseStage
59
57
  q.matching << [e[1][:data][index1], e[1][:data][index2]]
60
58
  q.matching << [e[2][:data][index1], e[2][:data][index2]]
61
59
  q.matching << [e[3][:data][index1], e[3][:data][index2]]
62
- # Add an extra line
60
+ questions << q
61
+
63
62
  if list2.count.positive?
64
- q.matching << ['', list2[0][:data][index2]]
63
+ # Add an extra line
64
+ e.shuffle!
65
+ q = Question.new(:match)
65
66
  q.name = "#{name}-#{num}-b1match4x5-#{p_table.name}"
67
+ q.tags << 'match'
68
+ q.tags << 'random'
69
+ q.text = random_image_for(name) \
70
+ + lang.text_for(:b1, name, p_table.fields[index1].capitalize, p_table.fields[index2].capitalize)
71
+ q.matching << [e[0][:data][index1], e[0][:data][index2]]
72
+ q.matching << [e[1][:data][index1], e[1][:data][index2]]
73
+ q.matching << [e[2][:data][index1], e[2][:data][index2]]
74
+ q.matching << [e[3][:data][index1], e[3][:data][index2]]
75
+ q.matching << ['', list2[0][:data][index2]]
76
+ questions << q
66
77
  else
67
- q.tags << 'misspelled'
78
+ e.shuffle!
79
+ q = Question.new(:match)
80
+ q.name = "#{name}-#{num}-b1match4x5_1misspelled-#{p_table.name}"
81
+ q.tags << 'match'
82
+ q.tags << 'random'
83
+ q.text = random_image_for(name) \
84
+ + lang.text_for(:b1, name, p_table.fields[index1].capitalize, p_table.fields[index2].capitalize)
85
+ q.matching << [e[0][:data][index1], e[0][:data][index2]]
86
+ q.matching << [e[1][:data][index1], e[1][:data][index2]]
87
+ q.matching << [e[2][:data][index1], e[2][:data][index2]]
88
+ q.matching << [e[3][:data][index1], e[3][:data][index2]]
68
89
  q.matching << ['', lang.do_mistake_to(e[0][:data][index2])]
69
- q.name = "#{name}-#{num}-b1match4x5misspelled-#{p_table.name}"
90
+ questions << q
70
91
  end
71
- questions << q
72
92
 
73
93
  # Question type <b1match>: match 3 items from table-A and 1 item with error
74
94
  e.shuffle!
75
95
  q = Question.new(:match)
76
- q.name = "#{name}-#{num}-b1match3x1misspelled-#{p_table.name}"
96
+ q.name = "#{name}-#{num}-b1match4x4_1misspelled-#{p_table.name}"
77
97
  q.tags << 'match'
78
98
  q.tags << 'random'
79
99
  q.text = random_image_for(name) \
@@ -82,16 +102,40 @@ class StageB < BaseStage
82
102
  q.matching << [e[1][:data][index1], e[1][:data][index2]]
83
103
  q.matching << [e[2][:data][index1], e[2][:data][index2]]
84
104
  q.matching << [lang.do_mistake_to(e[3][:data][index1]), lang.text_for(:misspelling)]
85
- # Add an extra line
105
+ questions << q
106
+
86
107
  if list2.count.positive?
108
+ # Add an extra line error
109
+ e.shuffle!
110
+ q = Question.new(:match)
111
+ q.name = "#{name}-#{num}-b1match4x5_1misspelled_1error-#{p_table.name}"
112
+ q.tags << 'match'
113
+ q.tags << 'random'
114
+ q.text = random_image_for(name) \
115
+ + lang.text_for(:b1, name, p_table.fields[index1].capitalize, p_table.fields[index2].capitalize)
116
+ q.matching << [e[0][:data][index1], e[0][:data][index2]]
117
+ q.matching << [e[1][:data][index1], e[1][:data][index2]]
118
+ q.matching << [e[2][:data][index1], e[2][:data][index2]]
119
+ q.matching << [lang.do_mistake_to(e[3][:data][index1]), lang.text_for(:misspelling)]
87
120
  q.matching << ['', list2[0][:data][index2]]
88
- q.name = "#{name}-#{num}-b1match3x1misspelledx1error-#{p_table.name}"
121
+ questions << q
89
122
  else
123
+ # Add an extra line misspelled
124
+ e.shuffle!
125
+ q = Question.new(:match)
126
+ q.name = "#{name}-#{num}-b1match4x5_2misspelled-#{p_table.name}"
127
+ q.tags << 'match'
128
+ q.tags << 'random'
90
129
  q.tags << 'misspelled'
130
+ q.text = random_image_for(name) \
131
+ + lang.text_for(:b1, name, p_table.fields[index1].capitalize, p_table.fields[index2].capitalize)
132
+ q.matching << [e[0][:data][index1], e[0][:data][index2]]
133
+ q.matching << [e[1][:data][index1], e[1][:data][index2]]
134
+ q.matching << [e[2][:data][index1], e[2][:data][index2]]
135
+ q.matching << [lang.do_mistake_to(e[3][:data][index1]), lang.text_for(:misspelling)]
91
136
  q.matching << ['', lang.do_mistake_to(e[0][:data][index2])]
92
- q.name = "#{name}-#{num}-b1match3x1misspelledx1misspelled-#{p_table.name}"
137
+ questions << q
93
138
  end
94
- questions << q
95
139
  end
96
140
  end
97
141
 
@@ -105,7 +149,19 @@ class StageB < BaseStage
105
149
  # Question 3 items from table-A, and 1 item from table-B
106
150
  if s.count > 3
107
151
  q = Question.new(:match)
108
- q.name = "#{name}-#{num}-b1match3x1errorx1misspelled-#{p_table.name}"
152
+ q.name = "#{name}-#{num}-b1match4x4_1error-#{p_table.name}"
153
+ q.tags << 'match'
154
+ q.tags << 'random'
155
+ q.text = random_image_for(name) \
156
+ + lang.text_for(:b1, name, p_table.fields[index1].capitalize, p_table.fields[index2].capitalize)
157
+ q.matching << [list1[0][:data][index1], list1[0][:data][index2]]
158
+ q.matching << [list1[1][:data][index1], list1[1][:data][index2]]
159
+ q.matching << [list1[2][:data][index1], list1[2][:data][index2]]
160
+ q.matching << [list2[0][:data][index1], lang.text_for(:error)]
161
+ questions << q
162
+
163
+ q = Question.new(:match)
164
+ q.name = "#{name}-#{num}-b1match4x5_1error_1misspelled-#{p_table.name}"
109
165
  q.tags << 'match'
110
166
  q.tags << 'random'
111
167
  q.text = random_image_for(name) \
@@ -31,7 +31,6 @@ module ConceptAIMoodleExporter
31
31
  # Export 1 concept_ai from project
32
32
  # @param concept_ai (ConceptAI)
33
33
  # @param file (File)
34
- # rubocop:disable Metrics/AbcSize
35
34
  private_class_method def self.export(concept_ai, file)
36
35
  return unless concept_ai.concept.process?
37
36
 
@@ -41,5 +40,4 @@ module ConceptAIMoodleExporter
41
40
  end
42
41
  end
43
42
  end
44
- # rubocop:enable Metrics/AbcSize
45
43
  end
@@ -28,10 +28,11 @@ default = en
28
28
 
29
29
  ; List of code languages to be loaded
30
30
  ; Accept yes|no
31
+ ca = yes
32
+ du = yes
31
33
  en = yes
32
34
  es = yes
33
35
  fr = yes
34
- du = yes
35
36
  javascript = yes
36
37
  math = no
37
38
  python = yes
@@ -48,12 +49,12 @@ formula_weights = 1, 1, 1
48
49
  ; Default values
49
50
  ; fractions = 0 to disable
50
51
  ; Only used for multichoice questions
51
- fractions = 0, -50, -33.33, -25, -20
52
+ fractions = ",-50,-33.33333,-25,-20,-16.66667,-14.28571,-12.5,-11.11111,-10"
52
53
 
53
54
  ; List of values d,b,f,i,s,t
54
55
  stages = d,b,f,i,s,t
55
56
 
56
- ; Questions category
57
+ ; Questions category. Default value: (empty)
57
58
  category =
58
59
 
59
60
  ; Exclude questions with this texts into their names.
@@ -0,0 +1,103 @@
1
+ ---
2
+ - '[*]'
3
+ - a
4
+ - al
5
+ - a
6
+ - "l'"
7
+ - davant
8
+ - de
9
+ - sota
10
+ - cada
11
+ - com
12
+ - com
13
+ - amb
14
+ - contra
15
+ - quan
16
+ - quant
17
+ - quin
18
+ - quina
19
+ - de
20
+ - des
21
+ - i
22
+ - a
23
+ - entre
24
+ - ell
25
+ - el
26
+ - ella
27
+ - ells
28
+ - es
29
+ - és
30
+ - aquest
31
+ - aquesta
32
+ - això
33
+ - aquests
34
+ - aquestes
35
+ - aquest
36
+ - això
37
+ - aquesta
38
+ - aquests
39
+ - aquestes
40
+ - cap
41
+ - fins
42
+ - la
43
+ - les
44
+ - ho
45
+ - els
46
+ - li
47
+ - els
48
+ - mes
49
+ - més
50
+ - mi
51
+ - em
52
+ - molt
53
+ - molts
54
+ - molt
55
+ - no
56
+ - ens
57
+ - nosaltres
58
+ - o
59
+ - per
60
+ - però
61
+ - per
62
+ - perquè
63
+ - perqué
64
+ - que
65
+ - qué
66
+ - qui
67
+ - si
68
+ - sense
69
+ - sobre
70
+ - tota
71
+ - totes
72
+ - tot
73
+ - tots
74
+ - darrera
75
+ - darrere
76
+ - tu
77
+ - tú
78
+ - es
79
+ - seyu
80
+ - les
81
+ - seves
82
+ - seus
83
+ - seu
84
+ - seva
85
+ - seus
86
+ - seves
87
+ - meu
88
+ - meva
89
+ - meus
90
+ - meves
91
+ - o
92
+ - un
93
+ - un
94
+ - uns
95
+ - una
96
+ - unes
97
+ - vosaltres
98
+ - vostre
99
+ - vostres
100
+ - nostre
101
+ - nostres
102
+ - i
103
+ - jo
@@ -0,0 +1,98 @@
1
+ ---
2
+ :a: 'à,á,e,o,ha'
3
+ :"a ": 'as '
4
+ :"as ": 'a ,os '
5
+ :á: 'a,à,é,há'
6
+ :à: 'a,á,e,ha'
7
+ :al: 'ar,la,el'
8
+ :ar: 'al'
9
+ :b: 'v'
10
+ :c: 's,k,ç'
11
+ :ca: 'ka,ça,ssa'
12
+ :ce: 'se,que,sse'
13
+ :ci: 'si,qui,ssi'
14
+ :co: 'ko,ço'
15
+ :cu: 'ku,qu,çu'
16
+ :ç: 'z,ss,s'
17
+ :e: 'é,è'
18
+ :" e": 'he'
19
+ :é: 'e,è'
20
+ :è: 'e,é'
21
+ :" é": 'hé'
22
+ :"el ": 'er ,ell '
23
+ :"er ": 'el '
24
+ :g: 'j'
25
+ :h: ' '
26
+ :ha: 'a'
27
+ :he: 'e'
28
+ :hi: 'i'
29
+ :ho: 'o'
30
+ :hu: 'u'
31
+ :i: 'í,ì'
32
+ :í: 'i,ì'
33
+ :ì: 'i,í'
34
+ :j: 'g'
35
+ :k: 'q,c'
36
+ :l: 'r'
37
+ :lla: 'ya'
38
+ :lle: 'ye'
39
+ :lli: 'yi'
40
+ :llo: 'yo'
41
+ :llu: 'yu'
42
+ :n: 'm,ny'
43
+ :ny: 'n'
44
+ :m: 'n'
45
+ :mb: 'nb'
46
+ :nb: 'mb'
47
+ :mp: 'np'
48
+ :np: 'mp'
49
+ :o: 'ó,e,ò'
50
+ :"o ": 'os '
51
+ :ó: 'o,ò'
52
+ :ò: 'o,ó'
53
+ :ol: 'or'
54
+ :or: 'ol'
55
+ :os : 'o ,ó ,as '
56
+ :oha: 'oa'
57
+ :p: 'q,o'
58
+ :que: 'ke,què, '
59
+ :qui: 'ki'
60
+ :s: 'z,a,ss,ç'
61
+ :sa: 'za,ssa'
62
+ :se: 'ce,ze,sse'
63
+ :si: 'ci,zi,ssi'
64
+ :so: 'zo,sso'
65
+ :su: 'zu,ssu'
66
+ :st: 'ts'
67
+ :ss: 'z,s,ç'
68
+ :t: 'f,p'
69
+ :u: 'ú,ù'
70
+ :ú: 'u,ù'
71
+ :ù: 'u,ú'
72
+ :ul: 'ur'
73
+ :ur: 'ul'
74
+ :v: 'b,w'
75
+ :w: 'v, gu'
76
+ :wa: 'gua'
77
+ :we: 'gue'
78
+ :wi: 'gui'
79
+ :wo: 'guo'
80
+ :x: 'ks,k,s'
81
+ :y: 'i,v'
82
+ :" y ": ' i '
83
+ :ya: 'lla'
84
+ :ye: 'lle'
85
+ :yi: 'lli'
86
+ :yo: 'llo'
87
+ :yu: 'llu'
88
+ :lla: 'l·la'
89
+ :lle: 'l·le'
90
+ :lli: 'l·li'
91
+ :llo: 'l·lo'
92
+ :llu: 'l·lu'
93
+ :z: 's,ss,ç'
94
+ :za: 'sa,ssa'
95
+ :ze: 'se,sse'
96
+ :zi: 'si,ssi'
97
+ :zo: 'so,sso'
98
+ :zu: 'su,ssu'
@@ -0,0 +1,29 @@
1
+ ---
2
+ :none: 'Ninguna és correcta'
3
+ :error: 'Error'
4
+ :misspelling: 'Error ortográfic'
5
+ :true: 'Cert'
6
+ :false: 'Fals'
7
+ :d1: 'Definició: <i><%=text1%></i><br/>Elige la opción que mejor se corresponda con la definición anterior.<br/>'
8
+ :d2: 'Definició de <b><%=text1%></b>:<br/> <i><%=text2%></i><br/>'
9
+ :d3: 'Definició de <b><%=text1%></b>:<br/> <i><%=text2%></i><br/></br><p>Nota: Cada símbol ? representa una lletra, i * a una o diverses paraules.</p>'
10
+ :d4: 'Definició de <b><%=text1%></b>:<br/> <i><%=text2%></i><br/><br/>(Coloca cada paula a la seva posició correcta dins el text)'
11
+ :b1: 'En relació al concepte <b><%=text1%></b>, asocia cada "<%=text2%>" amb el seu "<%=text3%>".<br/>'
12
+ :f1: 'Els seguents elements son "<%=text2%>" del concepte <b><%=text1%></b>:<ul><li><%=text3%></li></ul>'
13
+ :f2: "Els seguents elements son \"<%=text2%>\".<br/>Selecciona l'opció que no pertanyi al concepte <b><%=text1%></b>."
14
+ :f3: 'Els seguents elements son "<%=text2%>" del concepte <b><%=text1%></b>:<br><p><%=text3%></p>(Coloca cada paraula a la seva posició correcta dins el text)'
15
+ :i1: "<%=text1%><br/>Escull l'opció que millor es correspongui amb la imatge anterior.<br/>"
16
+ :i2: '<%=text1%><br/>La imatge/text anterior correspo a <b><%=text2%></b>.'
17
+ :i3: "<%=text1%><br/>Escriu l'opció <%=text2%>, que millor correspongui amb la imatge anterior.<br/>"
18
+ :i4: '<%=text1%><br/>Definició: <i><%=text2%></i><br/><br/>(Coloca cada palabra en su posición correcta dentro del texto)'
19
+ :s1: 'En relació al concepte <b><%=text1%></b>, ordena cada/les/els "<%=text2%>" per tal que es compleixi el criteri "<%=text3%>".<br/>'
20
+ :t1table: "Concepte <b><%=text1%></b><br/><%=text2%>: [*]<br/><%=text3%>: \"<%=text4%>\"<br/>Escull l'opció correcta.<br/>"
21
+ :t2table: "Concepte <b><%=text1%></b><br/><%=text2%>: [*]<br/><%=text3%>: \"<%=text4%>\"<br/>Escull l'opció correcta.<br/>"
22
+ :t3table: "Concepte <b><%=text1%></b><br/><%=text2%>: \"<%=text3%>\"<br/><%=text4%>: [*]<br/>Escull l'opció correcta.<br/>"
23
+ :t4table: "Concepte <b><%=text1%></b><br/><%=text2%>: \"<%=text3%>\"<br/><%=text4%>: [*]<br/>Escull l'opció correcta.<br/>"
24
+ :t5table: "Concepte <b><%=text1%></b><br/>L'associació següent és correcta:<br/><ul><li><%=text2%>: \"<%=text3%>\"</li><li><%=text4%>: \"<%=text5%>\"</li></ul>"
25
+ :t6table: "Concepte <b><%=text1%></b><br/>L'associació següent és correcta:<br/><ul><li><%=text2%>: \"<%=text3%>\"</li><li><%=text4%>: \"<%=text5%>\"</li></ul>"
26
+ :t7table: "Concepte <b><%=text1%></b><br/>L'associació següent és correcta:<br/><ul><li><%=text2%>: \"<%=text3%>\"</li><li><%=text4%>: \"<%=text5%>\"</li></ul>"
27
+ :t8table: 'Concepte <b><%=text1%></b><br/>Completa la següent associació:<br/><ul><li><%=text2%>: "<%=text3%>"</li><li><%=text4%>: [*]</li></ul>Escriu una paraula.<br/>'
28
+ :t9table: 'Concepte <b><%=text1%></b><br/>Completa la següent associació:<br/><ul><li><%=text2%>: "<%=text3%>"</li><li><%=text4%>: <%=text5%></li></ul>Escriu <%=text6%> paraules.<br/>'
29
+ :code1: '<pre><%=text1%></pre><br/><p>Escriu el número de línia hi ha el primer error. Escriu 0 si no hi ha cap error.</p>'
@@ -4,7 +4,7 @@ require 'erb'
4
4
  require_relative '../application'
5
5
 
6
6
  # Transform Questions into Gift format
7
- module QuestionMoodleFormatter
7
+ class QuestionMoodleFormatter
8
8
  ##
9
9
  # Convert question object into gift formatted string
10
10
  # @param question (Question)
@@ -13,9 +13,11 @@ module QuestionMoodleFormatter
13
13
  case question.type
14
14
  when :choice
15
15
  fractions = Application.instance.config['questions']['fractions']
16
- # penalties = ['', '-50', '-33.33333', '-25', '-20']
17
16
  penalties = fractions
18
-
17
+ # penalties = ['', '-50', '-33.33333', '-25', '-20']
18
+ # puts "[DEBUG] fractions : #{fractions}"
19
+ # puts "[DEBUG] penalties : #{penalties}"
20
+
19
21
  penalty = penalties[question.bads.size]
20
22
  template = File.read(File.join(File.dirname(__FILE__), 'moodle', 'multichoice.erb'))
21
23
  when :boolean
@@ -1,11 +1,9 @@
1
- # frozen_string_literal: true
2
1
 
3
2
  require 'erb'
4
3
  require 'yaml'
5
4
  require_relative 'text_actions'
6
5
  require_relative '../logger'
7
6
 
8
- # Lang#lang
9
7
  class Lang
10
8
  include TextActions
11
9
 
@@ -32,7 +30,6 @@ class Lang
32
30
  @mistakes = load_yaml_file(filepath)
33
31
  end
34
32
 
35
- # rubocop:disable Security/YAMLLoad
36
33
  def load_yaml_file(filepath)
37
34
  begin
38
35
  content = YAML.load(File.new(filepath))
@@ -44,5 +41,4 @@ class Lang
44
41
  end
45
42
  content
46
43
  end
47
- # rubocop:enable Security/YAMLLoad
48
44
  end
data/lib/asker/version.rb CHANGED
@@ -1,8 +1,7 @@
1
1
 
2
- # Global parameters
3
2
  module Version
4
- MAJOR_NUMBER = '2.3'
5
- VERSION = "#{MAJOR_NUMBER}.3"
3
+ MAJOR_NUMBER = '2.4'
4
+ VERSION = "#{MAJOR_NUMBER}.1"
6
5
  NAME = 'asker'
7
6
  GEM = 'asker-tool'
8
7
  CONFIGFILE = 'asker.ini'
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.3
4
+ version: 2.4.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: 2022-03-24 00:00:00.000000000 Z
11
+ date: 2022-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: haml
@@ -170,6 +170,9 @@ files:
170
170
  - lib/asker/files/asker.ini
171
171
  - lib/asker/files/example-code.haml
172
172
  - lib/asker/files/example-concept.haml
173
+ - lib/asker/files/language/ca/connectors.yaml
174
+ - lib/asker/files/language/ca/mistakes.yaml
175
+ - lib/asker/files/language/ca/templates.yaml
173
176
  - lib/asker/files/language/du/connectors.yaml
174
177
  - lib/asker/files/language/du/mistakes.yaml
175
178
  - lib/asker/files/language/du/templates.yaml