Type Definitions
-
app_config
-
App configuration.
Type:
- object
- Source:
Properties:
Name Type Argument Description anytime_finish
boolean <optional>
Finish button is always unlocked. You no longer have to go through all the phrases to use it.
auto_arrows
boolean <optional>
The arrows between tables are automatically set correctly and haven't to be selected manually.
auto_pk
boolean <optional>
When creating a table, an artificial primary key is created automatically.
comments
object <optional>
Show comments to support the user.
Properties
Name Type Argument Description input
boolean <optional>
Show comments during input (hints like "start creating tables" or "start to connect tables").
wrong
boolean <optional>
Show comments as feedback on an incorrect solution.
correct
boolean <optional>
Show comments as feedback on a correct solution.
correction
boolean <optional>
Allows the user to correct an incorrect solution.
css
array CSS dependencies.
data
object <optional>
Source of app state data.
default
object <optional>
Default notations data.
feedback
boolean <optional>
Show visual feedback and any comments after submitting a solution.
fixed_notation
boolean <optional>
The notation used in the ER diagram cannot be changed.
helper
array Dependency on helper functions.
hide_own_fk
boolean <optional>
No foreign key is offered for the table's own main attribute.
html
array HTML template dependencies.
lang
array <optional>
Dependency on component for multilingualism.
legend
boolean <optional>
Button to display a legend for the different notations in the ER diagram.
license
boolean <optional>
Show license information in the bottom of the app.
logos
string <optional>
Show image of logos in the bottom of the app.
modal
object Dependencies on component instances for modal dialogs.
Properties
Name Type Argument Description attr
array Modal dialog for editing attributes of a table.
legend
array <optional>
Modal dialog to display a legend for the different notations in the ER diagram.
notations
Object.<string, notation_data> Data of the different notations in the ER diagram.
number
number <optional>
Number of phrases to be asked. By default, all phrases are asked.
onchange
function <optional>
When something changes in the app (notation change, show legend, submit, correction, show solution, next phrase).
onfinish
function | object <optional>
When the finish button is clicked. Sets the finish actions.
onready
function <optional>
Is called once before the first start of the app.
onstart
function <optional>
When the app has finished starting.
phrases
object Data of the phrases.
show_solution
boolean <optional>
If the user solves the phrase incorrectly, he can reveal a correct solution. After that, the user can no longer correct his input.
shuffle
boolean <optional>
The phrases are shuffled, so the order in which the phrases are asked is different each time the app is started.
skip
boolean <optional>
Phrases can be skipped, so that not all phrases have to be answered.
text
boolean Contains the static texts (e.g. task description, labeling of buttons, hints on feedback).
user
boolean <optional>
Dependency on component for user authentication.
-
app_state
-
App state data.
Type:
- object
- Source:
Properties:
Name Type Description correct
number Number of correctly answered phrases.
notation
string Current selected notation (e.g. 'abrial', 'arrow', 'chen', 'crow', 'mc', 'uml').
phrases
Array.<phrase_data> Phrases used in the order they are queried.
results
Array.<result_data> Result data of the phrases processed so far.
Example
{ "correct": 1, "notation": "abrial", "phrases": [ { "text": "Eine Bibliothek möchte die einzelnen Seiten ausgewählter Bücher digitalisieren.", "entities": [ "Buch", "Seite" ], "relation": "hat", "solution": [ "n", "1" ] }, ... ] "results": [ { "input": [ null, [ 0, 6, 0 ], [ 0, 1058, 6 ] ], "correct": true, "solution": [ null, [ 0, 6, 0 ], [ 0, 1058, 6 ] ] }, ... ] }
-
attr_value
-
Bit mask of a table attribute.
0: not set
2^0=1: is optional (NULL)
2^1=2: is mandatory (NOT NULL)
2^2=4: is part of primary key (PK)
2^3=8: is part of alternate key (AK)
2^4=16: is part of foreign key to relation table (FK0)
2^5=32: is part of foreign key to entity 1 (FK1)
2^6=64: is part of foreign key to entity 2 (FK2)
2^7=128: is part of foreign key to entity 3 (FK3)
2^8=256: is part of foreign key to entity 4 (FK4)
2^9=512: arrow for FK0 is set
2^10=1024: arrow for FK1 is set
2^11=2048: arrow for FK2 is set
2^12=4096: arrow for FK3 is set
2^13=8192: arrow for FK4 is setType:
- number
- Source:
Example
1058 // = 1024 + 32 + 2 // => Foreign key to entity 1 (FK1) with set arrow and NOT NULL.
-
entity_nr
-
Number of an entity (1-N: entity 1-N).
Type:
- number
- Source:
-
notation_data
-
Notation data.
Type:
- object
- Source:
Properties:
Name Type Argument Description key
string Unique key of the notation (e.g. 'abrial', 'arrow', 'chen', 'crow', 'mc', 'uml')
title
string Title of the notation (used for the selection of the notation).
swap
boolean <optional>
Notation has a reverse reading order than Abrial notation.
centered
boolean <optional>
The relational verb is centered vertically in the diagram and not slightly higher above a connecting line.
mirrored
boolean <optional>
The notation is mirrored on the left side.
comment
string <optional>
Note that informs about special aspects of a notation.
images
Array.<string> Image URLs or filenames of the images without a file extension.
format
string <optional>
File extension of the image files (when using only filenames).
path
string <optional>
Image URLs without filename and file extension (when using only filenames).
Examples
{ "key": "arial", "title": "Abrial", "centered": true, "images": [ "https://ccmjs.github.io/eild/er_trainer/resources/img/abrial/e.svg", "https://ccmjs.github.io/eild/er_trainer/resources/img/abrial/1.svg", "https://ccmjs.github.io/eild/er_trainer/resources/img/abrial/c.svg", "https://ccmjs.github.io/eild/er_trainer/resources/img/abrial/n.svg", "https://ccmjs.github.io/eild/er_trainer/resources/img/abrial/cn.svg", "https://ccmjs.github.io/eild/er_trainer/resources/img/abrial/r.svg", "https://ccmjs.github.io/eild/er_trainer/resources/img/abrial/s.svg" ] }
{ "key": "arial", "title": "Abrial", "centered": true, "format": "svg", "images": [ "e", "1", "c", "n", "cn", "r", "s" ], "path": "https://ccmjs.github.io/eild/er_trainer/resources/img/" }
-
phrase_data
-
Phrase data.
Type:
- object
- Source:
Properties:
Name Type Argument Description text
string Text of the phrase.
entities
Array.<string> Names of the entities.
roles
Array.<string> <optional>
Role names of the entities (useful in recursive relationships).
relation
string <optional>
Name of the relation between the entities (default: has relation of a generalization/specialization).
solution
Array.<string> Solution of the phrase ('1': simple, 'c': conditional, 'n': multiple, 'cn': conditional multiple).
Example
{ "text": "Eine Bibliothek möchte die einzelnen Seiten ausgewählter Bücher digitalisieren.", "entities": [ "Buch", "Seite" ], "relation": "hat", "solution": [ "n", "1" ] }
-
result_data
-
Result data of a phrase.
Type:
- object
- Source:
Properties:
Name Type Argument Description input
Array.<table_data> Input data of the tables.
correct
boolean <optional>
Phrase answered correctly.
solution
Array.<table_data> Solution data of the tables (main solution).
alternate_solution
Array.<table_data> <optional>
Alternate solution found.
Example
{ "correct": true, "input": [ null, [ 0, 6, 0 ], [ 0, 1058, 6 ] ], "solution": [ null, [ 0, 6, 0 ], [ 0, 1058, 6 ] ] }
-
table_data
-
Table data.
null: not created
[0]: ID attribute of relation table
[1]: ID attribute of entity 1
[2]: ID attribute of entity 2
[3]: ID attribute of entity 3
[4]: ID attribute of entity 4Type:
- Array.<attr_value>
- Source:
Example
[ 0, 1058, 6 ]
-
table_nr
-
Number of a relation scheme table (0: extra table, 1-N: entity table 1-N).
Type:
- number
- Source: