Skip to content

Commit

Permalink
Removed examples_left implementation (hedyorg#2079)
Browse files Browse the repository at this point in the history
  • Loading branch information
TiBiBa authored Feb 24, 2022
1 parent 68e7e23 commit 658ec9c
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 34 deletions.
1 change: 0 additions & 1 deletion coursedata/texts/de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ Auth:
achievement_earned: Du hast eine Leistung erbracht!
teacher_invitation_require_login: Um dein LehrerIn Profil zu erstellen musst du dich anmelden. Wenn du noch kein Konto besitzt, dann erstell dir bitte eins.
teacher_welcome: Willkommen bei Hedy! Du bist nun eine stolze BesitzerIn eines LehrerIn Kontos, welches dir erlaubt Klassen zu erstellen und Schüler einzuladen.
examples_used: Du hast bereits die maximal erlaubte Anzahl an Beispielprogrammen ausprobiert in diesem level! Versuch als Nächstes etwas eigenes zu erstellen.
explore: Erkunde
overwrite_warning: Du hast bereits eine Programm mit diesem Namen, wenn du jetzt speicherst überschreibst du das Vorhandene. Bist du dir sicher?
copy_link_to_share: Kopiere den Link um ihn zu teilen
Expand Down
1 change: 0 additions & 1 deletion coursedata/texts/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ Auth:
other_text: "Another text language"
teacher_invitation_require_login: "To set up your profile as a teacher we will need you to log in. If you don't have an account, please create one."
teacher_welcome: "Welcome to Hedy! Your are now the proud owner of a teachers account which allows you to create classes and invite students."
examples_used: "You've already tried the maximum amount of allowed example programs in this level! Next try programming something yourself."
translate_error: "Something went wrong while translating the code. Try running the code to see if it has an error. Code with errors can not be translated."

# These variables are added here to make the code simpler, but conceptually they belong to the UI.
Expand Down
1 change: 0 additions & 1 deletion coursedata/texts/hi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ Auth:
other_text: एक और पाठ भाषा
teacher_invitation_require_login: एक शिक्षक के रूप में आपकी प्रोफ़ाइल सेट करने के लिए हमें आपको लॉग इन करने की आवश्यकता होगी। यदि आपके पास कोई खाता नहीं है, तो कृपया एक बनाएं।
teacher_welcome: हेडी में आपका स्वागत है! अब आप एक शिक्षक खाते के गर्वित स्वामी हैं जो आपको कक्षाएं बनाने और छात्रों को आमंत्रित करने की अनुमति देता है।
examples_used: आप पहले से ही इस स्तर में अनुमत उदाहरण प्रोग्राम्स की अधिकतम मात्रा की कोशिश कर चुके हैं! इसके बाद स्वयं कुछ प्रोग्रामिंग करने का प्रयास करें।
program_header: मेरे प्रोग्राम्स
explore: अन्वेषण करें
save_prompt: अपने प्रोग्राम को सहेजने के लिए आपके पास एक खाता होना चाहिए। क्या आप अभी लॉग इन करना चाहेंगे?
Expand Down
1 change: 0 additions & 1 deletion coursedata/texts/nl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ Auth:
other_text: "Een andere teksttaal"
teacher_invitation_require_login: "Om je leerkrachtenaccount te activeren moet je eerst inloggen. Als je nog geen account hebt, maak dan eerst een account aan."
teacher_welcome: "Welkom bij Hedy! Jouw account is omgezet naar een leerkrachtenaccount. Je kan nu klassen maken en er leerlingen in uitnodigen."
examples_used: "Je hebt jouw maximaal aantal voorbeeldprogramma's voor dit level al gebruikt! Probeer nu zelf iets te programmeren."
translate_error: "Er is iets misgegaan met het vertalen van de code. Probeer je code te runnen om te kijken of er misschien een foutje in zit. Code met foutjes kan niet vertaald worden."

# These variables are added here to make the code simpler, but conceptually they belong to the UI.
Expand Down
10 changes: 0 additions & 10 deletions static/js/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,16 +456,6 @@ function highlightAceError(editor: AceAjax.Editor, row: number, col?: number, le
* Called when the user clicks the "Try" button in one of the palette buttons
*/
export function tryPaletteCode(exampleCode: string) {
if (auth.profile) {
if (window.State.examples_left > 0) {
window.State.examples_left = window.State.examples_left - 1;
} else {
$("#commands-window").hide();
$("#toggle-button").hide();
modal.alert(auth.texts['examples_used'], 3000, true);
return;
}
}
var editor = ace.edit("editor");

var MOVE_CURSOR_TO_END = 1;
Expand Down
16 changes: 8 additions & 8 deletions static/js/appbundle.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions static/js/appbundle.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions static/js/hedy.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ interface State {
* Current keyword language
*/
keyword_language?: string;
other_keyword_language?: string;
/**
* Title of current level
*/
Expand Down Expand Up @@ -64,8 +63,6 @@ interface State {

unsaved_changes?: boolean;

examples_left?: integer;

no_unload_prompt?: boolean;

programsInExecution?: integer;
Expand Down
6 changes: 0 additions & 6 deletions templates/code-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
window.State.level = "{{ level }}";
window.State.level_title = "{{ ui.level_title }}";
window.State.keyword_language = "{{ g.keyword_lang }}";
{% if username %}
window.State.examples_left = 20;
{% endif %}
{% if not username %}
window.State.examples_left = Number.MAX_SAFE_INTEGER; // We want to give the user unlimited tries
{% endif %}
window.State.adventure_name = "{{ adventure_name }}";
// A copy of window.State.adventure_name but that we don't overwrite when changing tabs. Useful for loading/saving programs when changing tabs.
window.State.adventure_name_onload = window.State.adventure_name;
Expand Down

0 comments on commit 658ec9c

Please sign in to comment.