-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
71d4402
commit f7d0fad
Showing
43 changed files
with
7,755 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
scoper EducationScoper for language Education | ||
|
||
isnamespace { Page } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
language Education | ||
|
||
modelunit Flow { | ||
reference main: MainTopic; | ||
reference main: SiteGroup; | ||
rules: FlowRule[]; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
|
||
editor default | ||
|
||
MainTopic {[ | ||
MainTopic Overview | ||
SiteGroup {[ | ||
SiteGroup Overview | ||
|
||
Name: ${self.name} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
scoper EducationScoper for language Education | ||
|
||
isnamespace { Page, Step } | ||
|
||
Step { | ||
namespace_addition = self.fromPage; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/samples/EduTutorialNew/lesson8-defs/edu-flow-table.edit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} | ||
]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
language Education | ||
|
||
modelunit Flow { | ||
reference main: SiteGroup; | ||
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
22
packages/samples/EduTutorialNew/lesson8-defs/edu-flow.edit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 SiteGroup ${self.main} | ||
|
||
${self.rules vertical} | ||
]} | ||
|
||
FlowRule {[ | ||
------------------------------------- | ||
Name: ${self.name} | ||
Description: ${self.description} | ||
From page ${self.page} | ||
|
||
${self.transitions} | ||
]} | ||
|
||
PageTransition {[ | ||
when ${self.condition} goto page ${self.toPage} | ||
]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: SiteGroup[]; | ||
} | ||
|
||
modelunit SiteGroup { | ||
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
15
packages/samples/EduTutorialNew/lesson8-defs/edu-main.edit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* This file contains the default editor definition. */ | ||
|
||
editor default | ||
|
||
SiteGroup {[ | ||
SiteGroup Overview | ||
|
||
Name: ${self.name} | ||
|
||
Description: ${self.description} | ||
|
||
Topics: ${self.topics} | ||
|
||
Flows: ${self.flows} | ||
]} |
70 changes: 70 additions & 0 deletions
70
packages/samples/EduTutorialNew/lesson8-defs/edu-scoring.ast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
54
packages/samples/EduTutorialNew/lesson8-defs/edu-scoring.edit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "==" | ||
} |
31 changes: 31 additions & 0 deletions
31
packages/samples/EduTutorialNew/lesson8-defs/edu-tests.ast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
language Education | ||
|
||
modelunit Test { | ||
name: identifier; | ||
scenarios: Scenario[]; | ||
reference main: SiteGroup; | ||
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 fromPage: Page; | ||
answerSeries: Answer[]; | ||
} | ||
|
||
concept LastStep base Step { | ||
} | ||
|
||
concept Answer { | ||
reference question: Question; | ||
value: NumberConcept; | ||
} |
Oops, something went wrong.