Skip to content

Commit

Permalink
Changes in EduTutorialNew for the documentation site
Browse files Browse the repository at this point in the history
annekekleppe committed Nov 18, 2024
1 parent 5b37bb6 commit 56eec16
Showing 33 changed files with 912 additions and 40 deletions.
17 changes: 17 additions & 0 deletions packages/samples/EduTutorialNew/lesson3-defs/edu-flow-table.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* This file contains the rules-as-tables editor definition. */

editor rules_as_table

FlowRule {[
-------------------------------------
Name: ${name}
Description: ${self.description}
For page ${page}

${self.transitions table rows}
]}

PageTransition { table [
Condition | Goto Page
${self.condition} | ${self.toPage}
]}
27 changes: 27 additions & 0 deletions packages/samples/EduTutorialNew/lesson3-defs/edu-flow.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
language Education

modelunit Flow {
reference subject: Subject;
rules: FlowRule[];
}

concept FlowRule {
name: identifier;
description: string;
reference page: Page;
transitions: PageTransition[];
}

concept PageTransition { /* E.g. Grade A => show pageA, Grade F => show pageC */
condition: Grade;
reference toPage: Page;
}

limited Grade {
gradeA;
gradeB;
gradeC;
gradeD;
gradeE;
gradeF;
}
22 changes: 22 additions & 0 deletions packages/samples/EduTutorialNew/lesson3-defs/edu-flow.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* This file contains the default editor definition. */

editor default

Flow {[
Flow ${self.name} for subject ${self.subject}

${self.rules vertical}
]}

FlowRule {[
-------------------------------------
Name: ${self.name}
Description: ${self.description}
From page ${self.page}

${self.transitions}
]}

PageTransition {[
when ${self.condition} goto page ${self.toPage}
]}
17 changes: 17 additions & 0 deletions packages/samples/EduTutorialNew/lesson3-defs/edu-subjects.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language Education

model Education /* Computer Aided Learning */ {
name: identifier;
topic: Topic[];
flow: Flow[];
tests: Test[];
overviews: Subject[];
}

modelunit Subject {
name: identifier;
description: string; /* e.g. Mathematics, fractions for students age 10 */
reference topics: Topic[];
reference flows: Flow[];
reference tests: Test[];
}
15 changes: 15 additions & 0 deletions packages/samples/EduTutorialNew/lesson3-defs/edu-subjects.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* This file contains the default editor definition. */

editor default

Subject {[
Subject Overview

Name: ${self.name}

Description: ${self.description}

Topics: ${self.topics}

Flows: ${self.flows}
]}
5 changes: 5 additions & 0 deletions packages/samples/EduTutorialNew/lesson3-defs/edu-tests.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language Education

modelunit Test {
name: identifier;
}
56 changes: 56 additions & 0 deletions packages/samples/EduTutorialNew/lesson3-defs/edu-topics.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
language Education

modelunit Topic {
name: identifier;
reference subject: Subject;
description: string;
pages: Page[];
}

abstract concept Page {
name: identifier;
questions: Question[];
}

concept Theory base Page {
/* For the sake of the example this is simplified.
Should be formatted text including pictures, etc. */
content: Line[];
}

concept Line { // todo use MultiLine Component
content: string;
}

concept Video base Page {
url: string;
}

concept WorkSheet base Page {
}

concept ExamplePage base Page {
content: Line[];
}

concept InDepthMaterial base Page {
content: Line[];
}

concept Question {
name: identifier;
content: string;
correctAnswer: NumberConcept;
}

abstract concept NumberConcept {
}

concept SimpleNumber base NumberConcept {
value: number;
}

concept Fraction base NumberConcept {
numerator: number;
denominator: number;
}
80 changes: 80 additions & 0 deletions packages/samples/EduTutorialNew/lesson3-defs/edu-topics.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/* This file contains the default editor definition. */

editor default

Topic {[
Subject: ${self.subject}
Topic: ${self.name}
Topic description: ${self.description}

Pages:
${self.pages vertical }
]}

Page {[
${self.name}
]}

Theory {[
----------------------------------------------------
Theory [=>Page]
${self.content vertical terminator[== END OF LINE]}

[=>Page:footing]
]}

Video {[
----------------------------------------------------
Video [=>Page]
Maybe this video will help you understand.
${self.url}

[=>Page:footing]
]}

WorkSheet {[
----------------------------------------------------
Worksheet [=>Page]
See if you can answer the following questions.

[=>Page:footing]
]}

ExamplePage {[
----------------------------------------------------
Example [=>Page]
${self.content}

Now, please, answer the following questions.

[=>Page:footing]
]}

InDepthMaterial {[
----------------------------------------------------
InDepthMaterial [=>Page]
${self.content}

Test your understanding by answering the following questions.

[=>Page:footing]
]}

Question {[
${self.name}
${self.content}
Correct Answer: ${self.correctAnswer}
]}

Line {
[${self.content}]
}

SimpleNumber {
[${self.value}]
}

Fraction {
[${numerator} / ${denominator}]
trigger = "/"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* This file contains the footing editor definition. */

editor footing

Page {[
Questions:
${self.questions vertical terminator [END]}
]}
2 changes: 1 addition & 1 deletion packages/samples/EduTutorialNew/lesson4-defs/edu-flow.ast
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ concept FlowRule {
}

concept PageTransition { /* E.g. Grade A => show pageA, Grade F => show pageC */
condition: Grade; /* Note: will be changed into an expression later in the tutorial. */
condition: Grade;
reference toPage: Page;
}

27 changes: 0 additions & 27 deletions packages/samples/EduTutorialNew/lesson4-defs/edu-tests.ast
Original file line number Diff line number Diff line change
@@ -2,31 +2,4 @@ language Education

modelunit Test {
name: identifier;
scenarios: Scenario[];
reference subject: Subject;
reference flow: Flow;
}

concept Scenario {
description: string;
testFlow: TestFlow[];
steps: Step[]; /* Note that the order is of importance */
}
concept TestFlow {
steps: Step[]; /* Note that the order is of importance */
}
concept Step {
reference expectedPage: Page;
answerSeries: Answer[];
}

concept StartStep base Step {
reference fromPage: Page;
reference expectedPage: Page;
answerSeries: Answer[];
}

concept Answer {
reference question: Question;
value: NumberConcept;
}
17 changes: 17 additions & 0 deletions packages/samples/EduTutorialNew/lesson5-defs/edu-flow-table.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* This file contains the rules-as-tables editor definition. */

editor rules_as_table

FlowRule {[
-------------------------------------
Name: ${name}
Description: ${self.description}
For page ${page}

${self.transitions table rows}
]}

PageTransition { table [
Condition | Goto Page
${self.condition} | ${self.toPage}
]}
27 changes: 27 additions & 0 deletions packages/samples/EduTutorialNew/lesson5-defs/edu-flow.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
language Education

modelunit Flow {
reference subject: Subject;
rules: FlowRule[];
}

concept FlowRule {
name: identifier;
description: string;
reference page: Page;
transitions: PageTransition[];
}

concept PageTransition { /* E.g. Grade A => show pageA, Grade F => show pageC */
condition: Grade; /* Note: will be changed into an expression later in the tutorial. */
reference toPage: Page;
}

limited Grade {
gradeA;
gradeB;
gradeC;
gradeD;
gradeE;
gradeF;
}
22 changes: 22 additions & 0 deletions packages/samples/EduTutorialNew/lesson5-defs/edu-flow.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* This file contains the default editor definition. */

editor default

Flow {[
Flow ${self.name} for subject ${self.subject}

${self.rules vertical}
]}

FlowRule {[
-------------------------------------
Name: ${self.name}
Description: ${self.description}
From page ${self.page}

${self.transitions}
]}

PageTransition {[
when ${self.condition} goto page ${self.toPage}
]}
70 changes: 70 additions & 0 deletions packages/samples/EduTutorialNew/lesson5-defs/edu-scoring.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
language Education

concept GradeScore {
grade: Grade;
expr: ScoreExpression;
}

///////////////////////////////////
/// Expressions
//////////////////////////////////
abstract expression ScoreExpression {
}

/* The value of a question reference is the answer given to the
given question */
expression QuestionReference base ScoreExpression {
reference question: Question;
}

/* The value of NrOfCorrectAnswers is the total number of correct
answers on a page. */
expression NrOfCorrectAnswers base ScoreExpression {
}

/* The value of a NumberLiteralExpression is simply a number, like '24' */
expression NumberLiteralExpression base ScoreExpression {
value: number;
}

///////////////////////////////////
/// Boolean AND and OR
//////////////////////////////////
abstract binary expression BinaryExpression base ScoreExpression {
left: ScoreExpression;
right: ScoreExpression;
}

binary expression AndExpression base BinaryExpression {
priority = 1;
}

binary expression OrExpression base BinaryExpression {
priority = 1;
}

///////////////////////////////////
/// Comparisons: <=, >=, >, <, ===
//////////////////////////////////
abstract binary expression ComparisonExpression base BinaryExpression {
}

binary expression LessOrEqualsExpression base ComparisonExpression {
priority = 2;
}

binary expression GreaterOrEqualsExpression base ComparisonExpression {
priority = 2;
}

binary expression LessThenExpression base ComparisonExpression {
priority = 2;
}

binary expression GreaterThenExpression base ComparisonExpression {
priority = 2;
}

binary expression EqualsExpression base ComparisonExpression {
priority = 2;
}
54 changes: 54 additions & 0 deletions packages/samples/EduTutorialNew/lesson5-defs/edu-scoring.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
editor default

GradeScore {[
${self.grade} : ${self.expr}
]}

///////////////////////////////////
/// Expressions
//////////////////////////////////

QuestionReference {
[ Answer to ${self.question} is correct ]
trigger = "question"
referenceShortcut = ${self.question}
}

NrOfCorrectAnswers {
[Number Of Correct Answers]
}

NumberLiteralExpression {
[${value}]
}

///////////////////////////////////
/// Boolean AND and OR
//////////////////////////////////

OrExpression {
symbol = "or"
}
AndExpression {
symbol = "and"
}

///////////////////////////////////
/// Comparisons: <=, >=, >, <, ===
//////////////////////////////////

LessOrEqualsExpression {
symbol = "<="
}
GreaterOrEqualsExpression {
symbol = ">="
}
LessThenExpression {
symbol = "<"
}
GreaterThenExpression {
symbol = ">"
}
EqualsExpression {
symbol = "=="
}
17 changes: 17 additions & 0 deletions packages/samples/EduTutorialNew/lesson5-defs/edu-subjects.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language Education

model Education /* Computer Aided Learning */ {
name: identifier;
topic: Topic[];
flow: Flow[];
tests: Test[];
overviews: Subject[];
}

modelunit Subject {
name: identifier;
description: string; /* e.g. Mathematics, fractions for students age 10 */
reference topics: Topic[];
reference flows: Flow[];
reference tests: Test[];
}
15 changes: 15 additions & 0 deletions packages/samples/EduTutorialNew/lesson5-defs/edu-subjects.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* This file contains the default editor definition. */

editor default

Subject {[
Subject Overview

Name: ${self.name}

Description: ${self.description}

Topics: ${self.topics}

Flows: ${self.flows}
]}
57 changes: 57 additions & 0 deletions packages/samples/EduTutorialNew/lesson5-defs/edu-topics.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
language Education

modelunit Topic {
name: identifier;
reference subject: Subject;
description: string;
pages: Page[];
}

abstract concept Page {
name: identifier;
questions: Question[];
grading: GradeScore[]; /* concept from 'edu-scoring.ast' */
}

concept Theory base Page {
/* For the sake of the example this is simplified.
Should be formatted text including pictures, etc. */
content: Line[];
}

concept Line { // todo use MultiLine Component
content: string;
}

concept Video base Page {
url: string;
}

concept WorkSheet base Page {
}

concept ExamplePage base Page {
content: Line[];
}

concept InDepthMaterial base Page {
content: Line[];
}

concept Question {
name: identifier;
content: string;
correctAnswer: NumberConcept;
}

abstract concept NumberConcept {
}

concept SimpleNumber base NumberConcept {
value: number;
}

concept Fraction base NumberConcept {
numerator: number;
denominator: number;
}
80 changes: 80 additions & 0 deletions packages/samples/EduTutorialNew/lesson5-defs/edu-topics.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/* This file contains the default editor definition. */

editor default

Topic {[
Subject: ${self.subject}
Topic: ${self.name}
Topic description: ${self.description}

Pages:
${self.pages vertical }
]}

Page {[
${self.name}
]}

Theory {[
----------------------------------------------------
Theory [=>Page]
${self.content vertical}

[=>Page:footing]
]}

Video {[
----------------------------------------------------
Video [=>Page]
Maybe this video will help you understand.
${self.url}

[=>Page:footing]
]}

WorkSheet {[
----------------------------------------------------
Worksheet [=>Page]
See if you can answer the following questions.

[=>Page:footing]
]}

ExamplePage {[
----------------------------------------------------
Example [=>Page]
${self.content}

Now, please, answer the following questions.

[=>Page:footing]
]}

InDepthMaterial {[
----------------------------------------------------
InDepthMaterial [=>Page]
${self.content}

Test your understanding by answering the following questions.

[=>Page:footing]
]}

Question {[
${self.name}
${self.content}
Correct Answer: ${self.correctAnswer}
]}

Line {
[${self.content}]
}

SimpleNumber {
[${self.value}]
}

Fraction {
[${numerator} / ${denominator}]
trigger = "/"
}
11 changes: 11 additions & 0 deletions packages/samples/EduTutorialNew/lesson5-defs/page-footing.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* This file contains the footing editor definition. */

editor footing

Page {[
Questions:
${self.questions vertical terminator [END]}

Score
${self.grading vertical}
]}
32 changes: 32 additions & 0 deletions packages/samples/EduTutorialNew/lesson7-defs/edu-tests.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
language Education

modelunit Test {
name: identifier;
scenarios: Scenario[];
reference subject: Subject;
reference flow: Flow;
}

concept Scenario {
description: string;
testFlow: TestFlow[];
steps: Step[]; /* Note that the order is of importance */
}
concept TestFlow {
steps: Step[]; /* Note that the order is of importance */
}
concept Step {
reference expectedPage: Page;
answerSeries: Answer[];
}

concept StartStep base Step {
reference fromPage: Page;
reference expectedPage: Page;
answerSeries: Answer[];
}

concept Answer {
reference question: Question;
value: NumberConcept;
}
17 changes: 17 additions & 0 deletions packages/samples/EduTutorialNew/src/defs/edu-flow-table.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* This file contains the rules-as-tables editor definition. */

editor rules_as_table

FlowRule {[
-------------------------------------
Name: ${name}
Description: ${self.description}
For page ${page}

${self.transitions table rows}
]}

PageTransition { table [
Condition | Goto Page
${self.condition} | ${self.toPage}
]}
2 changes: 1 addition & 1 deletion packages/samples/EduTutorialNew/src/defs/edu-flow.ast
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ concept FlowRule {
}

concept PageTransition { /* E.g. Grade A => show pageA, Grade F => show pageC */
condition: Grade;
condition: Grade; /* Note: will be changed into an expression later in the tutorial. */
reference toPage: Page;
}

22 changes: 22 additions & 0 deletions packages/samples/EduTutorialNew/src/defs/edu-flow.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* This file contains the default editor definition. */

editor default

Flow {[
Flow ${self.name} for subject ${self.subject}

${self.rules vertical}
]}

FlowRule {[
-------------------------------------
Name: ${self.name}
Description: ${self.description}
From page ${self.page}

${self.transitions}
]}

PageTransition {[
when ${self.condition} goto page ${self.toPage}
]}
70 changes: 70 additions & 0 deletions packages/samples/EduTutorialNew/src/defs/edu-scoring.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
language Education

concept GradeScore {
grade: Grade;
expr: ScoreExpression;
}

///////////////////////////////////
/// Expressions
//////////////////////////////////
abstract expression ScoreExpression {
}

/* The value of a question reference is the answer given to the
given question */
expression QuestionReference base ScoreExpression {
reference question: Question;
}

/* The value of NrOfCorrectAnswers is the total number of correct
answers on a page. */
expression NrOfCorrectAnswers base ScoreExpression {
}

/* The value of a NumberLiteralExpression is simply a number, like '24' */
expression NumberLiteralExpression base ScoreExpression {
value: number;
}

///////////////////////////////////
/// Boolean AND and OR
//////////////////////////////////
abstract binary expression BinaryExpression base ScoreExpression {
left: ScoreExpression;
right: ScoreExpression;
}

binary expression AndExpression base BinaryExpression {
priority = 1;
}

binary expression OrExpression base BinaryExpression {
priority = 1;
}

///////////////////////////////////
/// Comparisons: <=, >=, >, <, ===
//////////////////////////////////
abstract binary expression ComparisonExpression base BinaryExpression {
}

binary expression LessOrEqualsExpression base ComparisonExpression {
priority = 2;
}

binary expression GreaterOrEqualsExpression base ComparisonExpression {
priority = 2;
}

binary expression LessThenExpression base ComparisonExpression {
priority = 2;
}

binary expression GreaterThenExpression base ComparisonExpression {
priority = 2;
}

binary expression EqualsExpression base ComparisonExpression {
priority = 2;
}
54 changes: 54 additions & 0 deletions packages/samples/EduTutorialNew/src/defs/edu-scoring.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
editor default

GradeScore {[
${self.grade} : ${self.expr}
]}

///////////////////////////////////
/// Expressions
//////////////////////////////////

QuestionReference {
[ Answer to ${self.question} is correct ]
trigger = "question"
referenceShortcut = ${self.question}
}

NrOfCorrectAnswers {
[Number Of Correct Answers]
}

NumberLiteralExpression {
[${value}]
}

///////////////////////////////////
/// Boolean AND and OR
//////////////////////////////////

OrExpression {
symbol = "or"
}
AndExpression {
symbol = "and"
}

///////////////////////////////////
/// Comparisons: <=, >=, >, <, ===
//////////////////////////////////

LessOrEqualsExpression {
symbol = "<="
}
GreaterOrEqualsExpression {
symbol = ">="
}
LessThenExpression {
symbol = "<"
}
GreaterThenExpression {
symbol = ">"
}
EqualsExpression {
symbol = "=="
}
1 change: 1 addition & 0 deletions packages/samples/EduTutorialNew/src/defs/edu-topics.ast
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ modelunit Topic {
abstract concept Page {
name: identifier;
questions: Question[];
grading: GradeScore[]; /* concept from 'edu-scoring.ast' */
}

concept Theory base Page {
17 changes: 6 additions & 11 deletions packages/samples/EduTutorialNew/src/defs/edu-topics.edit
Original file line number Diff line number Diff line change
@@ -18,10 +18,9 @@ Page {[
Theory {[
----------------------------------------------------
Theory [=>Page]
${self.content vertical terminator[== END OF LINE]}
${self.content vertical}

Questions:
${self.questions vertical}
[=>Page:footing]
]}

Video {[
@@ -30,17 +29,15 @@ Video {[
Maybe this video will help you understand.
${self.url}

Questions:
${self.questions vertical}
[=>Page:footing]
]}

WorkSheet {[
----------------------------------------------------
Worksheet [=>Page]
See if you can answer the following questions.

Questions:
${self.questions vertical}
[=>Page:footing]
]}

ExamplePage {[
@@ -50,8 +47,7 @@ ExamplePage {[

Now, please, answer the following questions.

Questions:
${self.questions vertical}
[=>Page:footing]
]}

InDepthMaterial {[
@@ -61,8 +57,7 @@ InDepthMaterial {[

Test your understanding by answering the following questions.

Questions:
${self.questions vertical}
[=>Page:footing]
]}

Question {[
11 changes: 11 additions & 0 deletions packages/samples/EduTutorialNew/src/defs/page-footing.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* This file contains the footing editor definition. */

editor footing

Page {[
Questions:
${self.questions vertical terminator [END]}

Score
${self.grading vertical}
]}
40 changes: 40 additions & 0 deletions packages/server/modelstore/lesson1/Fractions101.json
Original file line number Diff line number Diff line change
@@ -103,6 +103,14 @@
"ID-30",
"ID-98"
]
},
{
"containment": {
"language": "-default-key-Education",
"version": "2023.1",
"key": "-default-key-Page-grading"
},
"children": []
}
],
"references": [],
@@ -484,6 +492,14 @@
"key": "-default-key-Page-questions"
},
"children": []
},
{
"containment": {
"language": "-default-key-Education",
"version": "2023.1",
"key": "-default-key-Page-grading"
},
"children": []
}
],
"references": [],
@@ -523,6 +539,14 @@
"key": "-default-key-Page-questions"
},
"children": []
},
{
"containment": {
"language": "-default-key-Education",
"version": "2023.1",
"key": "-default-key-Page-grading"
},
"children": []
}
],
"references": [],
@@ -566,6 +590,14 @@
"children": [
"ID-119"
]
},
{
"containment": {
"language": "-default-key-Education",
"version": "2023.1",
"key": "-default-key-Page-grading"
},
"children": []
}
],
"references": [],
@@ -692,6 +724,14 @@
"children": [
"ID-71"
]
},
{
"containment": {
"language": "-default-key-Education",
"version": "2023.1",
"key": "-default-key-Page-grading"
},
"children": []
}
],
"references": [],
40 changes: 40 additions & 0 deletions packages/server/modelstore/lesson1/Fractions101Public.json
Original file line number Diff line number Diff line change
@@ -103,6 +103,14 @@
"ID-30",
"ID-98"
]
},
{
"containment": {
"language": "-default-key-Education",
"version": "2023.1",
"key": "-default-key-Page-grading"
},
"children": []
}
],
"references": [],
@@ -484,6 +492,14 @@
"key": "-default-key-Page-questions"
},
"children": []
},
{
"containment": {
"language": "-default-key-Education",
"version": "2023.1",
"key": "-default-key-Page-grading"
},
"children": []
}
],
"references": [],
@@ -523,6 +539,14 @@
"key": "-default-key-Page-questions"
},
"children": []
},
{
"containment": {
"language": "-default-key-Education",
"version": "2023.1",
"key": "-default-key-Page-grading"
},
"children": []
}
],
"references": [],
@@ -566,6 +590,14 @@
"children": [
"ID-119"
]
},
{
"containment": {
"language": "-default-key-Education",
"version": "2023.1",
"key": "-default-key-Page-grading"
},
"children": []
}
],
"references": [],
@@ -692,6 +724,14 @@
"children": [
"ID-71"
]
},
{
"containment": {
"language": "-default-key-Education",
"version": "2023.1",
"key": "-default-key-Page-grading"
},
"children": []
}
],
"references": [],

0 comments on commit 56eec16

Please sign in to comment.