Skip to content

Commit

Permalink
Changes in sample project for the documentation site
Browse files Browse the repository at this point in the history
  • Loading branch information
annekekleppe committed Nov 15, 2024
1 parent 1c4868b commit 5b37bb6
Show file tree
Hide file tree
Showing 36 changed files with 4,310 additions and 35 deletions.
27 changes: 27 additions & 0 deletions packages/samples/EduTutorialNew/lesson1-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;
}
17 changes: 17 additions & 0 deletions packages/samples/EduTutorialNew/lesson1-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[];
}
5 changes: 5 additions & 0 deletions packages/samples/EduTutorialNew/lesson1-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/lesson1-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;
}
27 changes: 27 additions & 0 deletions packages/samples/EduTutorialNew/lesson2-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;
}
17 changes: 17 additions & 0 deletions packages/samples/EduTutorialNew/lesson2-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/lesson2-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/lesson2-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/lesson2-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;
}
85 changes: 85 additions & 0 deletions packages/samples/EduTutorialNew/lesson2-defs/edu-topics.edit
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/* 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]}

Questions:
${self.questions vertical}
]}

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

Questions:
${self.questions vertical}
]}

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

Questions:
${self.questions vertical}
]}

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

Now, please, answer the following questions.

Questions:
${self.questions vertical}
]}

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

Test your understanding by answering the following questions.

Questions:
${self.questions vertical}
]}

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

Line {
[${self.content}]
}

SimpleNumber {
[${self.value}]
}

Fraction {
[${numerator} / ${denominator}]
trigger = "/"
}
27 changes: 27 additions & 0 deletions packages/samples/EduTutorialNew/lesson4-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;
}
17 changes: 17 additions & 0 deletions packages/samples/EduTutorialNew/lesson4-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/lesson4-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}
]}
Loading

0 comments on commit 5b37bb6

Please sign in to comment.