Skip to content

Commit

Permalink
coursedata/ to content/ 2 (hedyorg#2377)
Browse files Browse the repository at this point in the history
  • Loading branch information
aelhamah authored Apr 2, 2022
1 parent 1184cb3 commit cc90539
Show file tree
Hide file tree
Showing 307 changed files with 985 additions and 1,260 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ batchhedy/output_*
#generated grammars
grammars-Total/*.lark
*.tsbuildinfo
!/coursedata/adventures-transformed/
!/coursedata/level-defaults-transformed/
!/content/adventures-transformed/
!/content/level-defaults-transformed/

#vscode excludes
.vscode
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ on which IDE you are using. Here are the IDEs we know about:
{
// ...
"yaml.schemas": {
"coursedata/adventures/adventures.schema.json": "adventures/*.yaml"
"content/adventures/adventures.schema.json": "adventures/*.yaml"
}
}
```
Expand All @@ -193,6 +193,6 @@ on which IDE you are using. Here are the IDEs we know about:
* Open **Preferences**
* Navigate to **Languages & Frameworks → Schemas and DTDs → JSON Schema Mappings**.
* Click the **+** to add a new schema.
* Behind **Schema file or URL**, click the browse button and navigate to the `<your Hedy checkout>/coursedata/adventures/adventures.schema.json` file.
* Click the **+** at the bottom, select **Directory**. In the new line that appears, paste `coursedata/adventures`.
* Behind **Schema file or URL**, click the browse button and navigate to the `<your Hedy checkout>/content/adventures/adventures.schema.json` file.
* Click the **+** at the bottom, select **Directory**. In the new line that appears, paste `content/adventures`.
* Click **OK** to close the window.
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1207,8 +1207,8 @@ def translate_keywords():
def client_messages():
# Not really nice, but we don't call this often as it is cached
d = collections.defaultdict(lambda: 'Unknown Exception')
d.update(YamlFile.for_file('coursedata/client-messages/en.yaml').to_dict())
d.update(YamlFile.for_file(f'coursedata/client-messages/{g.lang}.yaml').to_dict())
d.update(YamlFile.for_file('content/client-messages/en.yaml').to_dict())
d.update(YamlFile.for_file(f'content/client-messages/{g.lang}.yaml').to_dict())

response = make_response(render_template("client_messages.js", error_messages=json.dumps(d)))

Expand Down
2 changes: 1 addition & 1 deletion babel.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[python: website/**.py]
[python: app.py]
[python: utils.py]
[python: coursedata/**.txt]
[python: content/**.txt]
[jinja2: templates/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_
2 changes: 1 addition & 1 deletion build-tools/github/validate-texts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const yaml = require ('yaml');

const ajv = new (require ('ajv'));

const path = require ('path').join (process.argv [2], '../../coursedata/texts') + '/';
const path = require ('path').join (process.argv [2], '../../content/texts') + '/';

// The English translation is our reference
const texts = yaml.parse (fs.readFileSync(path + 'en.yaml', 'utf8'));
Expand Down
2 changes: 1 addition & 1 deletion build-tools/github/validate-yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ echo "------> Validating YAML"
pajv=$scriptdir/../../node_modules/.bin/pajv

echo "------> Validating adventures"
cd ../../coursedata/adventures/
cd ../../content/adventures/
$pajv validate \
--errors=text \
-s "adventures.schema.json" \
Expand Down
2 changes: 1 addition & 1 deletion build-tools/heroku/generate-localized-highlighting.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

language = 'id'

keywords_path = 'coursedata/keywords/'
keywords_path = 'content/keywords/'
typescript_path = 'static/js/'

keywords_file_path = os.path.join(keywords_path, f'{language}.yaml')
Expand Down
2 changes: 1 addition & 1 deletion build-tools/heroku/tailwind/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
// Put any file here that could contain HTML or CSS classes.
'../../../templates/**/*.html',
'../../../main/**/*.md',
'../../../coursedata/**/*.md',
'../../../content/**/*.md',
'../../../static/js/**/*.js',
],
theme: {
Expand Down
2 changes: 1 addition & 1 deletion build-tools/heroku/tailwind/tailwind.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
content: [
'../../../templates/**/*.html',
'../../../main/**/*.md',
'../../../coursedata/**/*.md',
'../../../content/**/*.md',
'../../../static/js/**/*.js',
],
safelist: [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
139 changes: 0 additions & 139 deletions coursedata/adventures/en.yaml → content/adventures/en.yaml
Original file line number Diff line number Diff line change
@@ -1,143 +1,4 @@
adventures:
money:
name: "Money Week"
description: "Aflatoun"
image: "piggybank.png"
default_save_name: "Money"
levels:
1:
story_text: |
## Sing a song about money
Use the `{print}` command to print line in the output screen.
Do you want to hear Hedy sing it? Use the read-aloud function beneath the 'run code' button.
Play the song and listen to 'Mo money, mo problems' by the notorious B.I.G.
## Challenge
Do you know any other songs about money that you can let Hedy sing?
This adventure was co-created with Aflatoun.
example_code: |
## Example Hedy code
```
{print} I don't know what they want from me
{print} It's like the more money we come across
{print} The more problems we see
{print} I don't know what they want from me
{print} It's like the more money we come across
{print} The more problems we see
```
start_code: "{print} Mo money Mo problems"
2:
story_text: |
## Make your own virtual shop
In this adventure you can create your own virtual shop. The example codes gives an easy example, but we bet that you could make your shop more interesting.
## Challenge
Turn the example code into your own virtual shop. What kind of shop would you like to own?
How much money will you charge your costumers? What can you do to make your shop more appealing?
example_code: |
## Example Hedy code
```
price {is} 3
{print} Welcome to my shop
product {is} {ask} What would you like to buy?
{print} You would like to buy a product
{print} That will be price euro please
{print} Thank you! Bye!
```
start_code: "{print} Welcome to my shop"
3:
story_text: |
## Make smart choices
In this level you are faced with some financial dilemmas. You can make a list of products and a list of prices.
Hedy will randomly pick a product and a price and ask you if you think that's a smart choice to buy!
## Challenge
Make your own list of products and prices and play the game with your friends. Would they buy the same products as you?
Who is the smartest spender?
example_code: |
## Example Hedy code
```
price {is} 1 euro, 10 euros, 100 euros, 1 million euros
product {is} skateboard, banana, race car, dog
print Would you buy...
{print} a product {at} {random} for price {at} {random}
answer {is} {ask} Would you buy it?
```
start_code: "{print} Make smart choices!"
4:
story_text: |
## Make your own virtual restaurant
After opening your own shop in level 2, it's time to open a restaurant! Check out the example.
Please note that from this level on the print and ask command require quotation marks.
## Challenge
Make the restaurant your own. Maybe you'd pefer to have a sandwich shop, or a fastfood drive-through or a icecream parlor?
You can make anything you want with our example as inspiration!
example_code: |
## Example Hedy code
```
{print} 'Welcome to Hedys restaurant!'
{print} 'Today we are serving pizza or lasagna.'
food {is} {ask} 'What would you like to eat?'
{print} 'Great choice! The ' food ' is my favorite!'
drinks {is} {ask} 'What would you like to drink with that?'
{print} 'Thank you for your order.'
price {is} 20 euros
{print} 'That will be ' price
payment {is} {ask} 'Would you like to pay cash or card?'
{print} 'No problem!'
{print} 'Your ' food ' and ' drinks ' are on their way!'
```
start_code: "{print} 'Welcome to Hedys restaurant!'"

5:
story_text: |
## The price is right
In this level you can create your own virtual version of the televisionshow 'The price is right'.
In this show the contestants have to guess the price of a product correctly to win it.
## Challenge
The example code only gives away one price. Can you add more prices to win?
example_code: |
## Example Hedy code
```
{print} 'Welcome to The Price Is Right!'
{print} 'Im your host, Hedy.'
{print} 'Our first price tonight is a skateboard!'
price {is} 30
{print} 'Your options are 5 euros, 15 euros or 30 euros'
guess {is} {ask} 'How much do you guess it costs?'
{if} guess {is} price {print} 'Great job! You won the skateboard!'
{else} {print} 'No! You lose! The actual price was... ' price
```
start_code: "{print} 'Welcome to The Price is right!'"
6:
story_text: |
## Piggybank
In this level you can create your own digital Piggy Bank.
You can see how much money you've saved and vcalculate how long it will take you to save up for anything you'd like to buy.
Try it out!
## Challenge
Can you think of extra features you could add to your digital piggy bank?
example_code: |
## Example Hedy code
```
{print} 'The digital piggy bank'
wish = {ask} 'What would you like to buy?'
price = {ask} 'How much does that cost?'
saved = {ask} 'How much money have you saved already?'
allowance = {ask} 'How much pocket money do you get per week?'
to_save = price - saved
weeks = to_save / allowance
{print} 'You can buy a ' wish ' in ' weeks ' weeks.'
```
start_code: "{print} 'The digital piggy bank'"
story:
name: "Story"
description: "Story"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
136 changes: 0 additions & 136 deletions coursedata/adventures/nl.yaml → content/adventures/nl.yaml
Original file line number Diff line number Diff line change
@@ -1,140 +1,4 @@
adventures:
money:
name: "Week van het geld"
description: "Aflatoun"
image: "piggybank.png"
default_save_name: "Geld"
levels:
1:
story_text: |
## Zing een liedje over geld
Gebruik `{print}` om de songtekst van een liedje te laten verschijnen op het uitvoerscherm.
Wil je Hedy het liedje horen zingen? Gebruik dan de voorleesfuctie onder de uitvoerknop.
Speel het liedje af en luister naar 'Mo money, mo problems' van the notorious B.I.G.
## Challenge
Ken jij nog andere liedjes over geld die Hedy zou kunnen zingen?
Dit avontuur is gemaakt samen met Aflatoun.
example_code: |
## Voorbeeld Hedy code
```
{print} I don't know what they want from me
{print} It's like the more money we come across
{print} The more problems we see
{print} I don't know what they want from me
{print} It's like the more money we come across
{print} The more problems we see
```
start_code: "{print} Mo money Mo problems"
2:
story_text: |
## Maak je eigen virtuele winkel
In dit avontuur kun je je eigen virtuele (web)winkel maken. De voorbeeldcode toont een simpel voorbeeld, maar jij kan er vast zelf een interessantere versie van maken!
## Challenge
Gebruik de voorbeeldcode als inspiratie en maak er je eigen winkel van. Wat voor winkel zou je willen?
Wat wil je verkopen en hoeveel kost dat? Wat kun je doen om je winkel nog aantrekkelijker te maken?
example_code: |
## Voorbeeld Hedy code
```
prijs {is} 3
{print} Welkom in mijn winkel
product {is} {ask} Wat wil je kopen?
{print} Jij wil graag een product kopen.
{print} Dat wordt dan prijs euro alstublieft.
{print} Bedankt en tot ziens!
```
start_code: "{print} Welkom in de winkel"
3:
story_text: |
## Slim kiezen
In dit level sta je voor financiële dilema's. Maak een lijstje met producten en een lijstje met prijzen.
Hedy kiest random een product en een prijs en vraagt dan of je het zou kopen of niet.
## Challenge
Maak je eigen lijstje en speel met je vrienden. Zouden zij hetzelfde kopen als jij? Wie kan er het beste met geld om gaan?
example_code: |
## Voorbeeld Hedy code
```
prijs {is} 1 euro, 10 euro, 100 euro, 1 miljoen euro
product {is} skateboard, banaan, racewagen, konijn
{print} Zou jij dit kopen...
{print} een product {at} {random} voor prijs {at} {random}
antwoord {is} {ask} Zou jij het kopen?
```
start_code: "{print} Slim kiezen!"
4:
story_text: |
## Maak je eigen virtuele restaurant
Nadat je in level 2 je eigen winkel hebt geopend is het tijd voor een tweede zaak: Je eigen restaurant!
Kijk maar naar het voorbeeld. Let op! Op dit level moet je aanhalingstekens gebruiken bij print en ask.
## Challenge
Maak je eigen versie van het restaurant. Misschien wil jij geen Italiaan, maar een broodjeszaak, snackbar of ijssalon?
Je kunt de code aanpassen naar wat jij maar wil!
example_code: |
## Voorbeeld Hedy code
```
{print} 'Welkom bij restaurant Hedy!'
{print} 'Vandaag serveren we pizza of lasagna.'
eten {is} {ask} 'Wat wil je eten?'
{print} 'Goede keuze! Ik hou ook van ' eten
drinken {is} {ask} 'Wat wil je drinken?'
{print} 'Bedankt voor uw bestelling.'
prijs {is} 20 euro
{print} 'Dat wordt dan ' prijs
betalen {is} {ask} 'Wilt u pinnen?'
{print} 'Geen probleem!'
{print} 'Uw ' eten ' en ' drinken ' zijn onderweg!'
```
start_code: "{print} 'Welkom in restaurant Hedy!'"
5:
story_text: |
## Prijzenslag
In dit level kun je je eigen versie maken van het tv-programma 'Prijzenslag'.
In die show moeten de deelnemers raden hoe duur de prijs is om de prijs te winnen.
## Challenge
In het voorbeeld staat maar één prijs. Kun jij er meer toevoegen?
example_code: |
## Voorbeeld Hedy code
```
{print} 'Prijzenslag!'
{print} 'Ik ben uw presentator, Hedy.'
{print} 'Onze eerste prijs voor vanavond is een skateboard!'
prijs {is} 30
{print} 'De opties zijn 5 euro, 15 euro of 30 euro'
gok {is} {ask} 'Hoeveel denk jij dat het kost?'
{if} gok {is} prijs {print} 'Goed gedaan! Je wint het skateboard'
{else} {print} 'Helaas... Het kostte ' prijs
```
start_code: "{print} 'Welkom bij Prijzenslag!'"
6:
story_text: |
## Spaarvarkentje
In dit level kun je je eigen spaarvarken maken. Je kunt hiermee berekenen hoe lang het nog suurt voordat je (eindelijk) kun kopen wat je graag wilt hebben.
Probeer maar!
## Challenge
Kun jij nog meer toevoegingen bedenken voor je spaarvarkentje?
example_code: |
## Voorbeeld Hedy code
```
{print} 'Het digitale spaarvarken'
wens = {ask} 'Wat zou je graag willen hebben?'
prijs = {ask} 'Hoeveel kost dat?'
gespaard = {ask} 'Hoeveel geld heb je al gespaard?'
zakgeld = {ask} 'Hoeveel zakgeld krijg je per week?'
sparen = prijs - gespaard
weken = sparen / zakgeld
{print} 'Je kunt over ' weken ' weken een ' wens ' kopen!'
```
start_code: "{print} 'Het digitale spaarvarken'"
story:
name: "Verhaal"
description: "Maak een interactief verhaal"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit cc90539

Please sign in to comment.