asker-tool 2.1.2
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 +7 -0
- data/LICENSE +674 -0
- data/README.md +53 -0
- data/bin/asker +4 -0
- data/docs/changelog/v2.1.md +99 -0
- data/docs/commands.md +15 -0
- data/docs/contributions.md +18 -0
- data/docs/history.md +40 -0
- data/docs/idea.md +44 -0
- data/docs/inputs/README.md +39 -0
- data/docs/inputs/code.md +69 -0
- data/docs/inputs/concepts.md +142 -0
- data/docs/inputs/jedi.md +68 -0
- data/docs/inputs/tables.md +112 -0
- data/docs/inputs/templates.md +87 -0
- data/docs/install/README.md +38 -0
- data/docs/install/manual.md +26 -0
- data/docs/install/scripts.md +26 -0
- data/docs/revise/asker-file.md +41 -0
- data/docs/revise/buenas-practicas/01-convocatoria.md +30 -0
- data/docs/revise/buenas-practicas/02-formulario.md +35 -0
- data/docs/revise/buenas-practicas/03-descripcion.md +63 -0
- data/docs/revise/buenas-practicas/04-resultados.md +17 -0
- data/docs/revise/buenas-practicas/05-reproducir.md +10 -0
- data/docs/revise/ejemplos/01/README.md +27 -0
- data/docs/revise/ejemplos/02/README.md +31 -0
- data/docs/revise/ejemplos/03/README.md +31 -0
- data/docs/revise/ejemplos/04/README.md +37 -0
- data/docs/revise/ejemplos/05/README.md +25 -0
- data/docs/revise/ejemplos/06/README.md +43 -0
- data/docs/revise/ejemplos/README.md +11 -0
- data/docs/revise/projects.md +74 -0
- data/lib/asker.rb +103 -0
- data/lib/asker/ai/ai.rb +70 -0
- data/lib/asker/ai/ai_calculate.rb +55 -0
- data/lib/asker/ai/concept_ai.rb +49 -0
- data/lib/asker/ai/question.rb +58 -0
- data/lib/asker/ai/stages/base_stage.rb +16 -0
- data/lib/asker/ai/stages/main.rb +8 -0
- data/lib/asker/ai/stages/stage_b.rb +87 -0
- data/lib/asker/ai/stages/stage_d.rb +160 -0
- data/lib/asker/ai/stages/stage_f.rb +156 -0
- data/lib/asker/ai/stages/stage_i.rb +140 -0
- data/lib/asker/ai/stages/stage_s.rb +52 -0
- data/lib/asker/ai/stages/stage_t.rb +170 -0
- data/lib/asker/application.rb +30 -0
- data/lib/asker/checker.rb +356 -0
- data/lib/asker/cli.rb +85 -0
- data/lib/asker/code/ai/base_code_ai.rb +48 -0
- data/lib/asker/code/ai/code_ai_factory.rb +26 -0
- data/lib/asker/code/ai/javascript_code_ai.rb +167 -0
- data/lib/asker/code/ai/python_code_ai.rb +167 -0
- data/lib/asker/code/ai/ruby_code_ai.rb +169 -0
- data/lib/asker/code/ai/sql_code_ai.rb +69 -0
- data/lib/asker/code/code.rb +53 -0
- data/lib/asker/data/column.rb +62 -0
- data/lib/asker/data/concept.rb +183 -0
- data/lib/asker/data/data_field.rb +87 -0
- data/lib/asker/data/row.rb +93 -0
- data/lib/asker/data/table.rb +96 -0
- data/lib/asker/data/template.rb +65 -0
- data/lib/asker/data/world.rb +53 -0
- data/lib/asker/exporter/code_gift_exporter.rb +35 -0
- data/lib/asker/exporter/code_screen_exporter.rb +45 -0
- data/lib/asker/exporter/concept_ai_gift_exporter.rb +33 -0
- data/lib/asker/exporter/concept_ai_screen_exporter.rb +115 -0
- data/lib/asker/exporter/concept_ai_yaml_exporter.rb +33 -0
- data/lib/asker/exporter/concept_doc_exporter.rb +21 -0
- data/lib/asker/exporter/concept_screen_exporter.rb +25 -0
- data/lib/asker/exporter/main.rb +9 -0
- data/lib/asker/files/config.ini +40 -0
- data/lib/asker/formatter/code_string_formatter.rb +16 -0
- data/lib/asker/formatter/concept_doc_formatter.rb +37 -0
- data/lib/asker/formatter/concept_string_formatter.rb +66 -0
- data/lib/asker/formatter/question_gift_formatter.rb +65 -0
- data/lib/asker/formatter/question_hash_formatter.rb +40 -0
- data/lib/asker/formatter/question_moodlexml_formatter.rb +71 -0
- data/lib/asker/formatter/rb2haml_formatter.rb +26 -0
- data/lib/asker/lang/lang.rb +42 -0
- data/lib/asker/lang/lang_factory.rb +19 -0
- data/lib/asker/lang/text_actions.rb +150 -0
- data/lib/asker/loader/code_loader.rb +53 -0
- data/lib/asker/loader/content_loader.rb +101 -0
- data/lib/asker/loader/directory_loader.rb +58 -0
- data/lib/asker/loader/file_loader.rb +33 -0
- data/lib/asker/loader/image_url_loader.rb +61 -0
- data/lib/asker/loader/input_loader.rb +24 -0
- data/lib/asker/loader/project_loader.rb +71 -0
- data/lib/asker/logger.rb +21 -0
- data/lib/asker/project.rb +170 -0
- metadata +261 -0
data/README.md
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# ASKER (version 2.1)
|
2
|
+
|
3
|
+
Generate a lot of questions from an _input file_ base on your own _definitions_.
|
4
|
+
|
5
|
+
---
|
6
|
+
# Description
|
7
|
+
|
8
|
+
ASKER helps trainers to create a huge amount of questions, from a definitions (_conceptual entities_) input file.
|
9
|
+
|
10
|
+
Steps:
|
11
|
+
|
12
|
+
1. Create an input file with your definitions (_conceptual entities_).
|
13
|
+
1. Run _asker_ and get the results into `output` directory.
|
14
|
+
|
15
|
+
Features:
|
16
|
+
|
17
|
+
* Free Software [LICENSE](https://github.com/dvarrui/asker/blob/devel/LICENSE).
|
18
|
+
* Multiplatform.
|
19
|
+
* Input file formats: HAML, XML.
|
20
|
+
* Output file format: GIFT (Moodle cuestionairs).
|
21
|
+
* Ruby program.
|
22
|
+
|
23
|
+
---
|
24
|
+
# Usage
|
25
|
+
|
26
|
+
To execute ASKER, we use `asker` command, with a path to an input file as argument. For example, to run our `jedi.haml` input file example, we do:
|
27
|
+
|
28
|
+
```
|
29
|
+
asker docs/examples/starwars/jedi.haml
|
30
|
+
```
|
31
|
+
|
32
|
+
* The program generates your output files into the `output` directory by default.
|
33
|
+
* In this example, we use a demo input definition file `docs/examples/starwars/jedi.haml`, that contains conceptual entities about _"Jedi's"_ context.
|
34
|
+
* [Example input files](https://github.com/dvarrui/asker/blob/devel/docs/examples).
|
35
|
+
* More examples at `github/dvarrui/asker-inputs` repository.
|
36
|
+
|
37
|
+
---
|
38
|
+
# Documentation
|
39
|
+
|
40
|
+
* [Installation](https://github.com/dvarrui/asker/blob/devel/docs/install/README.md)
|
41
|
+
1. Install Ruby on your system.
|
42
|
+
2. `gem install asker-tool`
|
43
|
+
* [Inputs](https://github.com/dvarrui/asker/blob/devel/docs/inputs/README.md)
|
44
|
+
* [Commands](https://github.com/dvarrui/asker/blob/devel/docs/commands.md)
|
45
|
+
* [Contributions](https://github.com/dvarrui/asker/blob/devel/docs/contributions.md)
|
46
|
+
* [Base idea](https://github.com/dvarrui/asker/blob/devel/docs/idea.md)
|
47
|
+
* [History](https://github.com/dvarrui/asker/blob/devel/docs/history.md)
|
48
|
+
|
49
|
+
---
|
50
|
+
# Contact
|
51
|
+
|
52
|
+
* **Email**: `teuton.software@protonmail.com`
|
53
|
+
* **Twitter**: `@SoftwareTeuton`
|
data/bin/asker
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
|
2
|
+
# version 2.1
|
3
|
+
|
4
|
+
Things/ideas to do for 2.1 Asker version.
|
5
|
+
|
6
|
+
## GUI
|
7
|
+
|
8
|
+
Create a graphic fron end to execute asker and edit input files.
|
9
|
+
|
10
|
+
## Videos
|
11
|
+
|
12
|
+
* Documentation: Revise documentation
|
13
|
+
* Perhaps, videos on youtube explaining all this: (1) Get documentation, (2) Installation, (3) Consult demo input, (4) Create our input file usign def, (5) Add tables to our input file.
|
14
|
+
|
15
|
+
## Languages
|
16
|
+
|
17
|
+
* Language support: French, Dutch, Catalán and Esperanto.
|
18
|
+
|
19
|
+
---
|
20
|
+
|
21
|
+
## Better table keyword
|
22
|
+
|
23
|
+
* Process tables definitions with more than 2 fields.
|
24
|
+
|
25
|
+
## info keyword
|
26
|
+
|
27
|
+
* Add new keyword called info. Example:
|
28
|
+
```
|
29
|
+
%map{ :lang => 'en', :context => 'rock, bands', :version => '1'}
|
30
|
+
%info Generic text about music, rock, bands, concerts, etc.
|
31
|
+
%info more...
|
32
|
+
```
|
33
|
+
* When AI create new question may use (randomly) info text to be included into it. Example:
|
34
|
+
```
|
35
|
+
Rock music style was created for ....
|
36
|
+
|
37
|
+
Definition of [*]: Australian rock band formed by Scottish-born brothers Malcolm and Angus Young.
|
38
|
+
|
39
|
+
Select right option:
|
40
|
+
a. Led Zepellin
|
41
|
+
b. Beatles
|
42
|
+
c. ACDC
|
43
|
+
d. None
|
44
|
+
```
|
45
|
+
|
46
|
+
## Code inputs
|
47
|
+
|
48
|
+
Let's take a look at the [issues](https://github.com/dvarrui/asker/issues)
|
49
|
+
|
50
|
+
Actually we are experimenting with new keywords: code, type, path, features.
|
51
|
+
|
52
|
+
Example:
|
53
|
+
|
54
|
+
```
|
55
|
+
%code
|
56
|
+
%type ruby
|
57
|
+
%path files/string1.rb
|
58
|
+
%features
|
59
|
+
%row Muestra en pantalla "Hola Mundo!"
|
60
|
+
```
|
61
|
+
|
62
|
+
Where `type` could be: ruby, python or sql.
|
63
|
+
|
64
|
+
> Also bash, math, crontab, fstab, etc.
|
65
|
+
|
66
|
+
## More output formats
|
67
|
+
|
68
|
+
* Images
|
69
|
+
* Questions with images, sounds or other files embebed.
|
70
|
+
* Embeded images into question texts
|
71
|
+
* Work on other export formats (Perhaps Moodle format)
|
72
|
+
|
73
|
+
## Etc
|
74
|
+
|
75
|
+
* Texts
|
76
|
+
* Concept name drop and fill...
|
77
|
+
* Question types
|
78
|
+
* crossword
|
79
|
+
* type hangmann
|
80
|
+
* Dictionary
|
81
|
+
* Diccionario de sinónimos, antónimos
|
82
|
+
* Learn about the words or better download dictonary from RAE?
|
83
|
+
|
84
|
+
## Quizzer
|
85
|
+
|
86
|
+
* Export questions to YAML format then use them with app quizzer to create PDF exams.
|
87
|
+
* For example:
|
88
|
+
```
|
89
|
+
# Create output/funiture-questions.yaml
|
90
|
+
asker en/home/furniture.haml
|
91
|
+
|
92
|
+
# Create 3 PDF exams with 10 questions every one
|
93
|
+
quizzer 3x10 output/furniture-questions.yaml
|
94
|
+
```
|
95
|
+
|
96
|
+
## Develop more Tests
|
97
|
+
|
98
|
+
* minitest for every class into lib directory
|
99
|
+
* Apply rubocop rules to all them.
|
data/docs/commands.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
[<<back](../README.md)
|
3
|
+
|
4
|
+
# Commands
|
5
|
+
|
6
|
+
By now, ASKER run as CLI command.
|
7
|
+
|
8
|
+
| Command | Description |
|
9
|
+
| ----------------------- | ------------------------------- |
|
10
|
+
| asker | Show available functions |
|
11
|
+
| asker version | Show current version |
|
12
|
+
| asker PATH/TO/INPUTFILE | Create questions for input file |
|
13
|
+
| asker file PATH/TO/INPUTFILE | File keyword is optional |
|
14
|
+
| asker check PATH/TO/INPUTFILE | Check HAML file syntax |
|
15
|
+
| asker init | Create default config.ini file |
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
[<< back](../README.md)
|
3
|
+
|
4
|
+
# Contributions
|
5
|
+
|
6
|
+
If you want to contribute:
|
7
|
+
* Talk about this tool with your colleagues.
|
8
|
+
* Use this tool.
|
9
|
+
* Report bugs.
|
10
|
+
* Report us, your ideas for new features.
|
11
|
+
* Share with us your own input files.
|
12
|
+
* And if you love `ruby`, you can develop with us or work on the issues.
|
13
|
+
|
14
|
+
---
|
15
|
+
# Contact
|
16
|
+
|
17
|
+
* **Email**: `teuton.software@protonmail.com`
|
18
|
+
* **Twitter**: `@SoftwareTeuton`
|
data/docs/history.md
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
[<< back](../README.md)
|
3
|
+
|
4
|
+
# History
|
5
|
+
|
6
|
+
> Some time ago, this project was called "Darts of teacher". We renamed it because "darts" was used. Now, it's called ASKER.
|
7
|
+
|
8
|
+
## The problem
|
9
|
+
|
10
|
+
Working as a teacher, one of the most boring taks is check the same exercises
|
11
|
+
again and again, for every student, and every year.
|
12
|
+
|
13
|
+
The tests questions allow us to make activities that are automaticaly checked/resolved by software tools, as for example, Moodle cuestionairs.
|
14
|
+
In this case, the teacher will have enough time to waste others tasks, as:
|
15
|
+
* Analise results with detail.
|
16
|
+
* Read information about others materials.
|
17
|
+
* Test new aplications.
|
18
|
+
* Develop new tools.
|
19
|
+
* Etc.
|
20
|
+
|
21
|
+
In resume, applying more new knowledge to improve his work,
|
22
|
+
trying new ways of doing his job better, finding or redefining activities or lessons contents. Just finding a better way of teaching. And an easier way of learning for the students.
|
23
|
+
|
24
|
+
## Need a new tool
|
25
|
+
|
26
|
+
I decide (about 2013) start writing this tool to help me
|
27
|
+
with the process of making test questions from input definition files.
|
28
|
+
|
29
|
+
With this tool, I only waste time making this input file.
|
30
|
+
As a teacher I have this knowledge into my mind, so it will be easy.
|
31
|
+
It's the resume, definitions or conceptual entities of the unit
|
32
|
+
I'm teaching.
|
33
|
+
|
34
|
+
I've been using this tools several years/courses, teaching computer
|
35
|
+
science. I have a lot of work to improve it and new features to add.
|
36
|
+
It's usefull (for me at least), and hope It'll be for you too.
|
37
|
+
|
38
|
+
;-)
|
39
|
+
|
40
|
+
David Vargas
|
data/docs/idea.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
|
2
|
+
[<< back](../README.md)
|
3
|
+
|
4
|
+
# Basics
|
5
|
+
|
6
|
+
> **Disclaimber**
|
7
|
+
>
|
8
|
+
> I work as a teacher, and I try to do the best I know. But I'm really a programmer. I studied Computer Science at *ULPGC*.
|
9
|
+
>
|
10
|
+
> The 90% of what I've learned, I must thank to *Open Source* community.
|
11
|
+
The other 10%, It's luck and time wasted working.
|
12
|
+
|
13
|
+
## Open vs closed problems
|
14
|
+
|
15
|
+
The big problem with test questions are that only are usefull to evaluate
|
16
|
+
measurable features. So it is useless when we try measure abstract
|
17
|
+
features or measure open problems. But I think, we can do it with another approach.
|
18
|
+
|
19
|
+
I mean, if we get an open and abstract problem, their resolution will consist on several steps or measurable milestones. So we can transform an open problem, into a lot of closed mini-problems. And we have to focus on the measurable aspects.
|
20
|
+
|
21
|
+
Besides, if I *"bomb"* the student with a huge amount of diferent test questions about one concept, probably I could be near of knowing and measuring, the student asimilation of that kownledge.
|
22
|
+
|
23
|
+
## Making Questions
|
24
|
+
|
25
|
+
The task of creating test questions to solve the previous problem, becames another different problem to be solved. When I had to make manually this test questions, it took me a lot of time. And I need a lot.
|
26
|
+
|
27
|
+
And usually when I was making the question number 42, I realise that I forgot the content of the 41 previous. I'm loosing time and it's slow.
|
28
|
+
|
29
|
+
## Work once
|
30
|
+
|
31
|
+
Finally, I decide to write this tool that help me with the process of
|
32
|
+
making test questions from input definition files.
|
33
|
+
|
34
|
+
So I only waste time making an input file. But as a teacher I have this
|
35
|
+
into my mind and it must be a simple job. Because the inpu file it's just a resumed concepts list about the unit I'm teaching.
|
36
|
+
|
37
|
+
I've been using this tools several years/courses, teaching computer
|
38
|
+
science. I have a lot of functions to be improved and features to be added.
|
39
|
+
But for now, It's usefull (for me at least), and hope it will be for you too.
|
40
|
+
;-)
|
41
|
+
|
42
|
+
_Thanks!_
|
43
|
+
|
44
|
+
David Vargas
|
@@ -0,0 +1,39 @@
|
|
1
|
+
|
2
|
+
[<< back](../../README.md)
|
3
|
+
|
4
|
+
# Inputs
|
5
|
+
|
6
|
+
---
|
7
|
+
|
8
|
+
## Text plain editor
|
9
|
+
|
10
|
+
How to build our asker input files?
|
11
|
+
|
12
|
+
Open a plain text editor and start writting definitions.
|
13
|
+
* [Learn about concepts](concepts.md)
|
14
|
+
* [Learn about tables](tables.md)
|
15
|
+
* [Learn about templates](templates.md)
|
16
|
+
* [Learn about code](code.md)
|
17
|
+
|
18
|
+
---
|
19
|
+
|
20
|
+
## Web editor (On development)
|
21
|
+
|
22
|
+
Asker has a web editor to help building our asker input files.
|
23
|
+
By now only read, do not write. Sorry! Still is on development.
|
24
|
+
|
25
|
+
Looks like this:
|
26
|
+
|
27
|
+

|
28
|
+
|
29
|
+
To launch web editor:
|
30
|
+
1. `asker editor`
|
31
|
+
1. Open web browser and goto URL `localhost:4567`.
|
32
|
+
|
33
|
+
---
|
34
|
+
|
35
|
+
## More examples
|
36
|
+
|
37
|
+
Download our git repository with a lot of examples:
|
38
|
+
* `asker donwnload` or
|
39
|
+
* `git clone https://github.com/dvarrui/asker-inputs.git`
|
data/docs/inputs/code.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
|
2
|
+
[<< back](README.md)
|
3
|
+
|
4
|
+
# Learn code
|
5
|
+
|
6
|
+
Now, we are going to learn experimental keywords:
|
7
|
+
* code
|
8
|
+
|
9
|
+
---
|
10
|
+
|
11
|
+
# Concept limits
|
12
|
+
|
13
|
+
We have learn about using: map, concept, names, tags, def, table and template keywords. All them are usefull to define concepts.
|
14
|
+
|
15
|
+
Commonly we use natural lenguages (en, es, fr, de, etc) to talk about them and Asker DSL is a simpler and structured language version. All languages are similar (verbs, subjects, adjective, etc.), but have their own rules.
|
16
|
+
A poem, for example is writting using those rules.
|
17
|
+
|
18
|
+
Exists others kind of human creations, that use other definition languages.
|
19
|
+
For example, programming languages, file configurations, drawing language, math language, etc,
|
20
|
+
|
21
|
+
So we had to create new DSL keyword called `code`.
|
22
|
+
|
23
|
+
Let's see.
|
24
|
+
|
25
|
+
---
|
26
|
+
# Code
|
27
|
+
|
28
|
+
## Example
|
29
|
+
|
30
|
+
Example, using `code`keyword to define a python program from `files/string.py`file:
|
31
|
+
|
32
|
+
```
|
33
|
+
%map{ :version => '1', :lang => 'en', :context=>'python, programming, language' }
|
34
|
+
|
35
|
+
%code
|
36
|
+
%type python
|
37
|
+
%path files/string.py
|
38
|
+
```
|
39
|
+
|
40
|
+
| Param | Description |
|
41
|
+
| ----- | ------------------------- |
|
42
|
+
| code | Define a new code concept |
|
43
|
+
| type | Content type |
|
44
|
+
| path | Path to content file |
|
45
|
+
|
46
|
+
> Experimental type values: python, ruby, javascript, sql
|
47
|
+
|
48
|
+
## Full map
|
49
|
+
|
50
|
+
Example, using `code`keyword to define several python programs from `files/` folder:
|
51
|
+
|
52
|
+
```
|
53
|
+
%map{ :version => '1', :lang => 'en', :context=>'python, programming, language' }
|
54
|
+
|
55
|
+
%code
|
56
|
+
%type python
|
57
|
+
%path files/string.py
|
58
|
+
|
59
|
+
%code
|
60
|
+
%type python
|
61
|
+
%path files/array.py
|
62
|
+
|
63
|
+
%code
|
64
|
+
%type python
|
65
|
+
%path files/iterator.py
|
66
|
+
```
|
67
|
+
|
68
|
+
Example:
|
69
|
+
* [python](../examples/code)
|
@@ -0,0 +1,142 @@
|
|
1
|
+
|
2
|
+
[<< back](README.md)
|
3
|
+
|
4
|
+
# Learn basics
|
5
|
+
|
6
|
+
To know how to build our asker input files, we need to learn
|
7
|
+
main keywords:
|
8
|
+
* map
|
9
|
+
* concept
|
10
|
+
* names
|
11
|
+
* tags
|
12
|
+
* def
|
13
|
+
|
14
|
+
Let's start!.
|
15
|
+
|
16
|
+
---
|
17
|
+
|
18
|
+
# Text plain editor
|
19
|
+
|
20
|
+
* Create a text file, called for example: `demo/furniture.haml`.
|
21
|
+
* **map**: Once, at first line, we write keyword `map`. Example:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
%map{ :lang => 'en', :context => 'furniture, home', :version => '1'}
|
25
|
+
```
|
26
|
+
|
27
|
+
| Attribute | Description |
|
28
|
+
| --------- | ---------------------------------------------- |
|
29
|
+
| lang | Output texts will be created in English. Valid values: en, es |
|
30
|
+
| context | Comma separated labels that define map content |
|
31
|
+
| version | Input file format version. Valid value: 1 |
|
32
|
+
|
33
|
+
This input file will contain concepts about furniture context.
|
34
|
+
Use diferents input files to define diferents contexts.
|
35
|
+
|
36
|
+
> Use separated contexts is good idea. Sometimes, diferents concept from diferents contexts has the same `names` value. For example:
|
37
|
+
> * free as free of charge, costless.
|
38
|
+
> * free as in freedom.
|
39
|
+
|
40
|
+
* **concept, names, tags**: So we define our first concept:
|
41
|
+
|
42
|
+
```
|
43
|
+
%concept
|
44
|
+
%names chair
|
45
|
+
%tags single, seat, leg, backrest
|
46
|
+
```
|
47
|
+
|
48
|
+
| Param | Description |
|
49
|
+
| ----- | ------------------------------- |
|
50
|
+
| names | Comma separated concept's names |
|
51
|
+
| tags | Comma separated tags that help to identify this concept |
|
52
|
+
|
53
|
+
* **def**: Use def keyword to add concept meaning. The `def` content must uniquely identifies our concept. You can use `def` more than once.
|
54
|
+
|
55
|
+
```
|
56
|
+
%concept
|
57
|
+
%names chair
|
58
|
+
%tags single, seat, leg, backrest
|
59
|
+
%def Single seat with legs and backrest
|
60
|
+
%def Furniture that is placed around the table to sit
|
61
|
+
```
|
62
|
+
|
63
|
+
At this time, we may generate questions with:
|
64
|
+
|
65
|
+
```bash
|
66
|
+
asker demo/furniture.haml
|
67
|
+
```
|
68
|
+
|
69
|
+
---
|
70
|
+
|
71
|
+
# Formats
|
72
|
+
|
73
|
+
HAML is a special format. It's necesary write exactly:
|
74
|
+
* 0 spaces before map.
|
75
|
+
* 2 spaces before concept.
|
76
|
+
* 4 spaces before names, tags and def.
|
77
|
+
|
78
|
+
It's posible write the same using XML format instead. Take a look:
|
79
|
+
|
80
|
+
```xml
|
81
|
+
<map lang='en' context='furniture, home' version='1'>
|
82
|
+
<concept>
|
83
|
+
<names>chair</names>
|
84
|
+
<tags>single, seat, leg, backrest</tags>
|
85
|
+
<def>Single seat with legs and backrest</def>
|
86
|
+
<def>Furniture that is placed around the table to sit</def>
|
87
|
+
</concept>
|
88
|
+
</map>
|
89
|
+
```
|
90
|
+
|
91
|
+
Notice that `demo/furniture.haml` is HAML file and `demo/furniture.xml` a XML file. Both are valid.
|
92
|
+
|
93
|
+
> HAML format files are the same as XML format files.
|
94
|
+
Internaly HAML files are translated automaticaly to an XML equivalent.
|
95
|
+
>
|
96
|
+
> Why write into HAML instead of XML? HAML It's easier (for me).
|
97
|
+
You don't have to close every tag, only be carefuly with indentation.
|
98
|
+
>
|
99
|
+
> If you prefer, you could write your input files using XML.
|
100
|
+
|
101
|
+
---
|
102
|
+
|
103
|
+
# Adding images
|
104
|
+
|
105
|
+
Example:
|
106
|
+

|
107
|
+
|
108
|
+
**def** can be used with image URL. So we have to find an image that uniquely identifies our concept and write this:
|
109
|
+
|
110
|
+
```
|
111
|
+
%def{:type => 'image_url'}https://www.portobellostreet.es/imagenes_muebles/Muebles-Silla-colonial-Fusta-Bora-Bora.jpg
|
112
|
+
```
|
113
|
+
|
114
|
+
| Attribute | Description |
|
115
|
+
| --------- | ------------ |
|
116
|
+
| type | Content type |
|
117
|
+
|
118
|
+
---
|
119
|
+
|
120
|
+
# Increase questions number
|
121
|
+
|
122
|
+
Adding more concepts will increase questions number generated by ASKER:
|
123
|
+
|
124
|
+
```
|
125
|
+
%concept
|
126
|
+
%names couch
|
127
|
+
%tags furniture, seat, two, threee, people, bench, armrest
|
128
|
+
|
129
|
+
%concept
|
130
|
+
%names table
|
131
|
+
%tags furniture, flat, top, leg, surface, work, eat
|
132
|
+
|
133
|
+
%concept
|
134
|
+
%names bed
|
135
|
+
%tags furniture, place, sleep, relax
|
136
|
+
```
|
137
|
+
|
138
|
+
Examples:
|
139
|
+
* [furniture.haml](../examples/home/furniture.haml)
|
140
|
+
* [furniture.xml](../examples/home/xml/furniture.xml)
|
141
|
+
|
142
|
+
[>> Learn about tables](tables.md)
|