Type Definitions
-
app_config
-
App configuration.
Type:
- object
- Source:
Properties:
Name Type Argument Description anytime_finishboolean <optional>
Finish button is always unlocked. You no longer have to go through all the phrases to use it.
auto_arrowsboolean <optional>
The arrows between tables are automatically set correctly and haven't to be selected manually.
auto_pkboolean <optional>
When creating a table, an artificial primary key is created automatically.
commentsobject <optional>
Show comments to support the user.
Properties
Name Type Argument Description inputboolean <optional>
Show comments during input (hints like "start creating tables" or "start to connect tables").
wrongboolean <optional>
Show comments as feedback on an incorrect solution.
correctboolean <optional>
Show comments as feedback on a correct solution.
correctionboolean <optional>
Allows the user to correct an incorrect solution.
cssarray CSS dependencies.
dataobject <optional>
Source of app state data.
defaultobject <optional>
Default notations data.
feedbackboolean <optional>
Show visual feedback and any comments after submitting a solution.
fixed_notationboolean <optional>
The notation used in the ER diagram cannot be changed.
helperarray Dependency on helper functions.
hide_own_fkboolean <optional>
No foreign key is offered for the table's own main attribute.
htmlarray HTML template dependencies.
langarray <optional>
Dependency on component for multilingualism.
legendboolean <optional>
Button to display a legend for the different notations in the ER diagram.
licenseboolean <optional>
Show license information in the bottom of the app.
logosstring <optional>
Show image of logos in the bottom of the app.
modalobject Dependencies on component instances for modal dialogs.
Properties
Name Type Argument Description attrarray Modal dialog for editing attributes of a table.
legendarray <optional>
Modal dialog to display a legend for the different notations in the ER diagram.
notationsObject.<string, notation_data> Data of the different notations in the ER diagram.
numbernumber <optional>
Number of phrases to be asked. By default, all phrases are asked.
onchangefunction <optional>
When something changes in the app (notation change, show legend, submit, correction, show solution, next phrase).
onfinishfunction | object <optional>
When the finish button is clicked. Sets the finish actions.
onreadyfunction <optional>
Is called once before the first start of the app.
onstartfunction <optional>
When the app has finished starting.
phrasesobject Data of the phrases.
show_solutionboolean <optional>
If the user solves the phrase incorrectly, he can reveal a correct solution. After that, the user can no longer correct his input.
shuffleboolean <optional>
The phrases are shuffled, so the order in which the phrases are asked is different each time the app is started.
skipboolean <optional>
Phrases can be skipped, so that not all phrases have to be answered.
textboolean Contains the static texts (e.g. task description, labeling of buttons, hints on feedback).
userboolean <optional>
Dependency on component for user authentication.
-
app_state
-
App state data.
Type:
- object
- Source:
Properties:
Name Type Description correctnumber Number of correctly answered phrases.
notationstring Current selected notation (e.g. 'abrial', 'arrow', 'chen', 'crow', 'mc', 'uml').
phrasesArray.<phrase_data> Phrases used in the order they are queried.
resultsArray.<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 keystring Unique key of the notation (e.g. 'abrial', 'arrow', 'chen', 'crow', 'mc', 'uml')
titlestring Title of the notation (used for the selection of the notation).
swapboolean <optional>
Notation has a reverse reading order than Abrial notation.
centeredboolean <optional>
The relational verb is centered vertically in the diagram and not slightly higher above a connecting line.
mirroredboolean <optional>
The notation is mirrored on the left side.
commentstring <optional>
Note that informs about special aspects of a notation.
imagesArray.<string> Image URLs or filenames of the images without a file extension.
formatstring <optional>
File extension of the image files (when using only filenames).
pathstring <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 textstring Text of the phrase.
entitiesArray.<string> Names of the entities.
rolesArray.<string> <optional>
Role names of the entities (useful in recursive relationships).
relationstring <optional>
Name of the relation between the entities (default: has relation of a generalization/specialization).
solutionArray.<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 inputArray.<table_data> Input data of the tables.
correctboolean <optional>
Phrase answered correctly.
solutionArray.<table_data> Solution data of the tables (main solution).
alternate_solutionArray.<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: