diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index ad421db..b703b4e 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -43,14 +43,6 @@ jobs: - name: Run Playwright E2E tests run: BASE_URL=http://localhost:5000 pytest e2e/ -v - - name: Upload test artifacts - if: failure() - uses: actions/upload-artifact@v4 - with: - name: playwright-report - path: playwright-report/ - retention-days: 7 - - name: Stop services if: always() run: docker compose down diff --git a/e2e/test_exercise_flow.py b/e2e/test_exercise_flow.py index 2efc8df..b97224e 100644 --- a/e2e/test_exercise_flow.py +++ b/e2e/test_exercise_flow.py @@ -15,7 +15,7 @@ # Helpers # --------------------------------------------------------------------------- -def _load_prebuilt_exercise(page, base_url, exercise_file="robotrain.json"): +def _load_prebuilt_exercise(page, base_url, exercise_file="equivalent.json"): """Navigate to the predefined exercise page for a prebuilt JSON file.""" page.goto(f"{base_url}/exercise/predefined?sourceuri=preload:{exercise_file}") page.wait_for_selector("#questions") @@ -44,7 +44,7 @@ def _answer_and_advance(page): """Select the first radio option, check the answer, then click Next.""" visible = page.locator(".question:visible") # Remember the current question number so we can detect advance - text = visible.locator("small.text-muted").inner_text() + text = visible.locator(".question-counter").inner_text() m = re.search(r"Question (\d+) of (\d+)", text) current_q = int(m.group(1)) total_q = int(m.group(2)) @@ -66,7 +66,7 @@ def _answer_and_advance(page): f"""(() => {{ const vis = document.querySelector('.question:not([style*="display: none"])'); if (!vis) return false; - const t = vis.querySelector('small.text-muted')?.textContent || ''; + const t = vis.querySelector('.question-counter')?.textContent || ''; const m = t.match(/Question (\\d+) of/); return m && parseInt(m[1]) > {current_q}; }})()""", diff --git a/src/app.py b/src/app.py index b6a8f08..d5ac57f 100644 --- a/src/app.py +++ b/src/app.py @@ -1081,37 +1081,6 @@ def generate_new_name(): -@app.route('/entryexitticket/') -@login_required -def entryexitticket(ticket): - userId = getUserName() - if not userId: - return "USER ID IS NOT SET, PLEASE RELOAD THE PAGE." - - uidlen = len(userId) - choices = ["preload:robotrain-odd.json", "preload:robotrain-even.json"] - - entry_index = uidlen % 2 - exit_index = (uidlen + 1) % 2 - - if ticket == "entry": - return robotrain(choices[entry_index], exercise_name = "robotrain-entry") - elif ticket == "exit": - return robotrain(choices[exit_index], exercise_name = "robotrain-exit") - else: - return "Invalid ticket type." - -def robotrain(sourceuri, exercise_name): - try: - data = exerciseprocessor.load_questions_from_sourceuri(sourceuri, app.static_folder) - data = exerciseprocessor.randomize_questions(data) - data = exerciseprocessor.change_traces_to_render_data(data, literals = ["e", "h"]) - except Exception as e: - print(e) - return "Error loading exercise" - return render_template('/prebuiltexercises/robotrain.html', uid = getUserName(), questions=data, exercise_name=exercise_name) - - ###### Stepper routes ###### @app.route('/stepper', methods=['GET', 'POST']) diff --git a/src/static/css/common.css b/src/static/css/common.css index 0bb5dd0..7c4e192 100644 --- a/src/static/css/common.css +++ b/src/static/css/common.css @@ -2,6 +2,7 @@ background-color: rgba(0, 0, 0, 0.05); /* Change this color as needed */ } + .trace-option-label { cursor: pointer; } diff --git a/src/static/lightpanel.json b/src/static/lightpanel.json deleted file mode 100644 index 353159e..0000000 --- a/src/static/lightpanel.json +++ /dev/null @@ -1,358 +0,0 @@ -[ - { - "question": "The green light is never off", - "description": "The questions ask about the state of an instrument panel over time. The panel has three colors: Red (red), Green (green), and Blue (blue).", - "type": "englishtoltl", - "options": [ - { - "option": "G(green)", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "(F green)", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateQuantification" - ] - }, - { - "option": "green", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.ImplicitG" - ] - } - ] - }, - { - "question": "Whenever the Red light is on, it is off in the next state and on again in the state after that. ", - "description": "The questions ask about the state of an instrument panel over time. The panel has three colors: Red (red), Green (green), and Blue (blue).", - "type": "englishtoltl", - "options": [ - { - "option": "(G (red -> (X !red) & (X (X red)) ))", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "(G ((red -> (F (! red))) & (X red)))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.Precedence", - "MisconceptionCode.BadStateIndex" - ] - }, - { - "option": "(F ((red -> (F (! red))) & (X red)))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateQuantification" - ] - }, - { - "option": "((red -> (F (! red))) & (X red))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.ImplicitG" - ] - } - ] - }, - { - "question": "The Red light is on in exactly one state (not necessarily the first state).", - "description": "The questions ask about the state of an instrument panel over time. The panel has three colors: Red (red), Green (green), and Blue (blue).", - "type": "englishtoltl", - "options": [ - { - "option": "(F red) & (G (red -> X(G !red)))", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "F(red & X(G(!red)))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateIndex" - ] - }, - { - "option": "(F red)", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.OtherImplicit" - ] - }, - { - "option": "(F red) & (red -> X(G (!red)))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.ImplicitG" - ] - } - ] - }, - { - "question": "Red light cannot stay on for three states in a row. ", - "description": "The questions ask about the state of an instrument panel over time. The panel has three colors: Red (red), Green (green), and Blue (blue).", - "type": "englishtoltl", - "options": [ - { - "option": "! F(red & (X red) & (X (X red)))", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "! (red & (F red))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateQuantification" - ] - }, - { - "option": "! ((red & (F red)) & (X (F red)))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateIndex" - ] - } - ] - }, - { - "question": "Whenever the Red light is on, the Blue light will be on then or at some point in the future. ", - "description": "The questions ask about the state of an instrument panel over time. The panel has three colors: Red (red), Green (green), and Blue (blue).", - "type": "englishtoltl", - "options": [ - { - "option": "(G (red -> (blue | (F blue))))", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "(G ((red -> blue) | blue))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.Precedence", - "MisconceptionCode.ImplicitF" - ] - }, - { - "option": "(red -> blue) | blue", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.ImplicitG", - "MisconceptionCode.OtherImplicit" - ] - }, - { - "option": "(G (red -> (blue | (X blue))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateQuantification" - ] - } - ] - }, - { - "question": "The Red light is on for zero or more states, and then turns off and remains off in the future.", - "description": "The questions ask about the state of an instrument panel over time. The panel has three colors: Red (red), Green (green), and Blue (blue).", - "type": "englishtoltl", - "options": [ - { - "option": "(F (G !red))", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "(G (G (! red)))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateQuantification" - ] - }, - { - "option": "(G (! red))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.ImplicitF" - ] - }, - { - "option": "(F (! red))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.ImplicitG" - ] - } - ] - }, - { - "question": "G(red | blue)", - "type": "tracesatisfaction_yn", - "trace": "red & !green & !blue; !red & !green & blue; red & green & blue; cycle{!red & green & !blue}", - "description": "The questions ask about the state of an instrument panel over time. The panel has three colors: Red (red), Green (green), and Blue (blue).", - "options": [ - { - "option": "Yes", - "isCorrect": false, - "misconceptions": [] - }, - { - "option": "No", - "isCorrect": true, - "misconceptions": [] - } - ] - }, - { - "question": "F(red & green)", - "type": "tracesatisfaction_yn", - "trace": "!red & !green & !blue; !red & !green & blue; red & !green & !blue; !red & green & !blue; cycle{!red & !green & !blue}", - "description": "The questions ask about the state of an instrument panel over time. The panel has three colors: Red (red), Green (green), and Blue (blue).", - "options": [ - { - "option": "Yes", - "isCorrect": false, - "misconceptions": ["MisconceptionCode.OtherImplicit"] - }, - { - "option": "No", - "isCorrect": true, - "misconceptions": [] - } - ] - }, - { - "question": "(G (X red))", - "type": "tracesatisfaction_yn", - "trace": "!red & green & blue; red & !green & blue; !red & !green & !blue; cycle{!red & green & blue; red & green & blue}", - "description": "The questions ask about the state of an instrument panel over time. The panel has three colors: Red (red), Green (green), and Blue (blue).", - "options": [ - { - "option": "Yes", - "isCorrect": false, - "misconceptions": ["MisconceptionCode.BadStateQuantification"] - }, - { - "option": "No", - "isCorrect": true, - "misconceptions": [] - } - ] - }, - { - "question": "red", - "type": "tracesatisfaction_yn", - "trace": "!red & green & blue; red & green & blue; red & green & blue; cycle{red & green & blue}", - "description": "The questions ask about the state of an instrument panel over time. The panel has three colors: Red (red), Green (green), and Blue (blue).", - "options": [ - { - "option": "Yes", - "isCorrect": false, - "misconceptions": ["MisconceptionCode.BadStateIndex"] - }, - { - "option": "No", - "isCorrect": true, - "misconceptions": [] - } - ] - }, - { - "question": "F red", - "type": "tracesatisfaction_yn", - "trace": "red & !green & !blue; !red & !green & !blue; !red & green & !blue; cycle{!red & !green & !blue}", - "description": "The questions ask about the state of an instrument panel over time. The panel has three colors: Red (red), Green (green), and Blue (blue).", - "options": [ - { - "option": "Yes", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "No", - "isCorrect": false, - "misconceptions": ["MisconceptionCode.BadStateIndex"] - } - ] - }, - { - "question": "G (red -> X (X ( X (red))))", - "type": "tracesatisfaction_yn", - "trace": "!red & !green & !blue; red & green & blue; red & green & blue; !red & !green & !blue;cycle{red & green & blue}", - "description": "The questions ask about the state of an instrument panel over time. The panel has three colors: Red (red), Green (green), and Blue (blue).", - "options": [ - { - "option": "Yes", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "No", - "isCorrect": false, - "misconceptions": ["MisconceptionCode.BadStateIndex"] - } - ] - }, - { - "question": "X X X red", - "type": "tracesatisfaction_mc", - "description": "The questions ask about the state of an instrument panel over time. The panel has three colors: Red (red), Green (green), and Blue (blue).", - "options": [ - { - "option": "red & !green & !blue; !red & !green & !blue; !red & !green & !blue; red & !green & !blue; cycle{!red & !green & !blue}", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "1; red; 1; !red; cycle{1}", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateIndex" - ] - }, - { - "option": "1; 1; red; !red; cycle{1}", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.OtherImplicit" - ] - } - ] - }, - { - "question": "red U green", - "type": "tracesatisfaction_yn", - "trace": "red & !green & blue; red & !green & blue; red & !green & blue; red & green & blue;cycle{!red & !green & blue}", - "options": [ - { - "option": "Yes", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "No", - "isCorrect": false, - "misconceptions": ["MisconceptionCode.ExclusiveU"] - } - ] - }, - { - "question": "red U blue", - "type": "tracesatisfaction_yn", - "trace": "red & !green & !blue;red & !green & !blue;red & !green & !blue;cycle{red & !green & !blue}", - "description": "The questions ask about the state of an instrument panel over time. The panel has three colors: Red (red), Green (green), and Blue (blue).", - "options": [ - { - "option": "Yes", - "isCorrect": false, - "misconceptions": ["MisconceptionCode.WeakU"] - }, - { - "option": "No", - "isCorrect": true, - "misconceptions": [] - } - ] - } -] diff --git a/src/static/robotrain-even.json b/src/static/robotrain-even.json deleted file mode 100644 index 3f643e3..0000000 --- a/src/static/robotrain-even.json +++ /dev/null @@ -1,163 +0,0 @@ -[ - { - "question": "Whenever the engine is on, it is off in the next state and on again in the state after that.", - "type": "englishtoltl", - "options": [ - { - "option": "G (e -> (X (!e)) & (X (X e)))", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "(G ((e -> (X (! e))) & (X (X e))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.Precedence" - ] - }, - { - "option": "(G (e -> ((X (! e)) & (X e))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateIndex" - ] - }, - { - "option": "(F (e -> ((X (! e)) & (X (X e)))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateQuantification" - ] - }, - { - "option": "(e -> ((X (! e)) & (X (X e))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.ImplicitG" - ] - }, - { - "option": "(G (e -> ((X (! e)) & (F (X e)))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.OtherImplicit" - ] - } - ] - }, - { - "question": "The engine cannot stay on for three states in a row.", - "type": "englishtoltl", - "options": [ - { - "option": "G ((e & (X e)) -> (X (X (!e))))", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "(G ((e & (X e)) -> (X (! e))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateIndex" - ] - }, - { - "option": "(F ((e & (X e)) -> (X (X (! e)))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateQuantification" - ] - }, - { - "option": "((e & (X e)) -> (X (X (! e))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.ImplicitG" - ] - }, - { - "option": "(G ((e & (F e)) -> (F (X (! e)))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.OtherImplicit" - ] - } - ] - }, - { - "question": "The engine is on for zero or more states, and then turns off and remains off in the future.", - "type": "englishtoltl", - "options": [ - { - "option": "e U (G (!e))", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "((F e) U (G (! e)))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateQuantification" - ] - }, - { - "option": "(e U (! e))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.ImplicitG" - ] - }, - { - "option": "e", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.OtherImplicit" - ] - } - ] - }, - { - "question": "(X e) U (X h)", - "type": "tracesatisfaction_mc", - "options": [ - { - "option": "!e & !h; cycle{!e & h}", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "e & h; e & !h; cycle{e & !h}", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateQuantification" - ] - }, - { - "option": "h; !e & !h; cycle{!e & !h}", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.OtherImplicit" - ] - } - ] - }, - { - "question": "X X X e", - "type": "tracesatisfaction_yn", - "trace": "e;!e;!e;e;cycle{!e}", - "options": [ - { - "option": "Yes", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "No", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateIndex" - ] - } - ] - } -] \ No newline at end of file diff --git a/src/static/robotrain-odd.json b/src/static/robotrain-odd.json deleted file mode 100644 index 9dab9ac..0000000 --- a/src/static/robotrain-odd.json +++ /dev/null @@ -1 +0,0 @@ -[{"question": "The engine is on in exactly one state, but not necessarily the first state.", "type": "englishtoltl", "options": [{"option": "!e U (e & (X (G (!e))))", "isCorrect": true, "misconceptions": []}, {"option": "(! ((e U e) & (X (G (! e)))))", "isCorrect": false, "misconceptions": ["MisconceptionCode.Precedence"]}, {"option": "(! ((G e) U (e & (X (G (! e))))))", "isCorrect": false, "misconceptions": ["MisconceptionCode.BadStateQuantification"]}, {"option": "(! (e U (e & (X (! e)))))", "isCorrect": false, "misconceptions": ["MisconceptionCode.ImplicitG"]}, {"option": "(! (e U (e & (F (G (! e))))))", "isCorrect": false, "misconceptions": ["MisconceptionCode.OtherImplicit"]}, {"option": "(! ((e U (e & (X (G (! e))))) & (F (e & (X (G (! e)))))))", "isCorrect": false, "misconceptions": ["MisconceptionCode.WeakU"]}]}, {"question": "Whenever the engine is on, the headlight will be on then or at some point in the future.", "type": "englishtoltl", "options": [{"option": "(G (e -> (F h)))", "isCorrect": true, "misconceptions": []}, {"option": "(F (e -> (F h)))", "isCorrect": false, "misconceptions": ["MisconceptionCode.BadStateQuantification"]}, {"option": "(G (e -> h))", "isCorrect": false, "misconceptions": ["MisconceptionCode.ImplicitF"]}, {"option": "(e -> (F h))", "isCorrect": false, "misconceptions": ["MisconceptionCode.ImplicitG", "MisconceptionCode.OtherImplicit"]}]}, {"question": "G (e -> (X (X (X e))))", "type": "tracesatisfaction_mc", "options": [{"option": "!e & !h; e & h;e & h; !e & !h; cycle{e & h}", "isCorrect": true, "misconceptions": []}, {"option": "e & !h; !e & !h; e & h; !e & !h; cycle{e & h}", "isCorrect": false, "misconceptions": ["MisconceptionCode.BadStateQuantification"]}, {"option": "!e & !h; e & !h; e & !h; e & h; !e; cycle{e & h}", "isCorrect": false, "misconceptions": ["MisconceptionCode.ImplicitG"]}, {"option": "e & !h; !e & h; !e & h; !e & h; cycle{e & h; !e & h}", "isCorrect": false, "misconceptions": ["MisconceptionCode.OtherImplicit"]}]}, {"question": "e", "type": "tracesatisfaction_yn", "trace": "!e & h; e & h; e & h;cycle{e & h}", "options": [{"option": "Yes", "isCorrect": false, "misconceptions": ["MisconceptionCode.ImplicitG"]}, {"option": "No", "isCorrect": true, "misconceptions": []}]}, {"question": "e U h", "type": "tracesatisfaction_yn", "trace": "e & !h;e & !h;cycle{e & h}", "options": [{"option": "No", "isCorrect": false, "misconceptions": ["MisconceptionCode.ExclusiveU"]}, {"option": "Yes", "isCorrect": true, "misconceptions": []}]}] \ No newline at end of file diff --git a/src/static/robotrain.json b/src/static/robotrain.json deleted file mode 100644 index 67878cd..0000000 --- a/src/static/robotrain.json +++ /dev/null @@ -1,306 +0,0 @@ -[ - { - "question": "Whenever the engine is on, it is off in the next state and on again in the state after that.", - "type": "englishtoltl", - "options": [ - { - "option": "G (e -> (X (!e)) & (X (X e)))", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "(G ((e -> (X (! e))) & (X (X e))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.Precedence" - ] - }, - { - "option": "(G (e -> ((X (! e)) & (X e))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateIndex" - ] - }, - { - "option": "(F (e -> ((X (! e)) & (X (X e)))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateQuantification" - ] - }, - { - "option": "(e -> ((X (! e)) & (X (X e))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.ImplicitG" - ] - }, - { - "option": "(G (e -> ((X (! e)) & (F (X e)))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.OtherImplicit" - ] - } - ] - }, - { - "question": "The engine is on in exactly one state, but not necessarily the first state.", - "type": "englishtoltl", - "options": [ - { - "option": "!e U (e & (X (G (!e))))", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "(! ((e U e) & (X (G (! e)))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.Precedence" - ] - }, - { - "option": "(! ((G e) U (e & (X (G (! e))))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateQuantification" - ] - }, - { - "option": "(! (e U (e & (X (! e)))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.ImplicitG" - ] - }, - { - "option": "(! (e U (e & (F (G (! e))))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.OtherImplicit" - ] - }, - { - "option": "(! ((e U (e & (X (G (! e))))) & (F (e & (X (G (! e)))))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.WeakU" - ] - } - ] - }, - { - "question": "The engine cannot stay on for three states in a row.", - "type": "englishtoltl", - "options": [ - { - "option": "G ((e & (X e)) -> (X (X (!e))))", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "(G ((e & (X e)) -> (X (! e))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateIndex" - ] - }, - { - "option": "(F ((e & (X e)) -> (X (X (! e)))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateQuantification" - ] - }, - { - "option": "((e & (X e)) -> (X (X (! e))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.ImplicitG" - ] - }, - { - "option": "(G ((e & (F e)) -> (F (X (! e)))))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.OtherImplicit" - ] - } - ] - }, - { - "question": "Whenever the engine is on, the headlight will be on then or at some point in the future.", - "type": "englishtoltl", - "options": [ - { - "option": "(G (e -> (F h)))", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "(F (e -> (F h)))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateQuantification" - ] - }, - { - "option": "(G (e -> h))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.ImplicitF" - ] - }, - { - "option": "(e -> (F h))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.ImplicitG", - "MisconceptionCode.OtherImplicit" - ] - } - ] - }, - { - "question": "The engine is on for zero or more states, and then turns off and remains off in the future.", - "type": "englishtoltl", - "options": [ - { - "option": "e U (G (!e))", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "((F e) U (G (! e)))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateQuantification" - ] - }, - { - "option": "(e U (! e))", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.ImplicitG" - ] - }, - { - "option": "e", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.OtherImplicit" - ] - } - ] - }, - { - "question": "G (e -> (X (X (X e))))", - "type": "tracesatisfaction_mc", - "options": [ - { - "option": "!e & !h; e & h;e & h; !e & !h; cycle{e & h}", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "e & !h; !e & !h; e & h; !e & !h; cycle{e & h}", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateQuantification" - ] - }, - { - "option": "!e & !h; e & !h; e & !h; e & h; !e; cycle{e & h}", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.ImplicitG" - ] - }, - { - "option": "e & !h; !e & h; !e & h; !e & h; cycle{e & h; !e & h}", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.OtherImplicit" - ] - } - ] - }, - { - "question": "(X e) U (X h)", - "type": "tracesatisfaction_mc", - "options": [ - { - "option": "!e & !h; cycle{!e & h}", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "e & h; e & !h; cycle{e & !h}", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.BadStateQuantification" - ] - }, - { - "option": "h; !e & !h; cycle{!e & !h}", - "isCorrect": false, - "misconceptions": [ - "MisconceptionCode.OtherImplicit" - ] - } - ] - }, - { - "question": "e", - "type": "tracesatisfaction_yn", - "trace": "!e & h; e & h; e & h;cycle{e & h}", - "options": [ - { - "option": "Yes", - "isCorrect": false, - "misconceptions": ["MisconceptionCode.ImplicitG"] - }, - { - "option": "No", - "isCorrect": true, - "misconceptions": [] - } - ] - }, - { - "question": "X X X e", - "type": "tracesatisfaction_yn", - "trace": "e;!e;!e;e;cycle{!e}", - "options": [ - { - "option": "Yes", - "isCorrect": true, - "misconceptions": [] - }, - { - "option": "No", - "isCorrect": false, - "misconceptions": ["MisconceptionCode.BadStateIndex"] - } - ] - }, - { - "question": "e U h", - "type": "tracesatisfaction_yn", - "trace": "e & !h;e & !h;cycle{e & h}", - "options": [ - { - "option": "No", - "isCorrect": false, - "misconceptions": ["MisconceptionCode.ExclusiveU"] - }, - { - "option": "Yes", - "isCorrect": true, - "misconceptions": [] - } - ] - } -] \ No newline at end of file diff --git a/src/templates/exercise.html b/src/templates/exercise.html index 7cd3b03..6200357 100644 --- a/src/templates/exercise.html +++ b/src/templates/exercise.html @@ -35,53 +35,35 @@
{% include 'navbar.html' %} -
{{ exercise_name }}
- {% if syntax_choice %} -

- Syntax: {{ syntax_choice }} -

- {% endif %} -
{% for q in questions %} {%set qindex = loop.index %}
- - - -
-
-
-

- {% if q.description %} - {{ q.description }} - {% endif %} -

-
-
-
-
-

- {% if q.type == "englishtoltl" %} - Which of the following LTL formulae best represents this English sentence? - {% elif q.type == "tracesatisfaction_mc" %} - Which of the following traces satisfies the following LTL formula? - {% elif q.type == "tracesatisfaction_yn" %} - Does this trace satisfy the following LTL formula? - {% else %} -

- {% endif %} -

-
-
- Question {{ qindex }} of {{ questions | length}} - -
+
+
+ + {{ exercise_name }} + {% if syntax_choice %}ยท{{ syntax_choice }}{% endif %} + + Question {{ qindex }} of {{ questions | length }}
- +

+ {% if q.type == "englishtoltl" %} + Which of the following LTL formulae best represents this English sentence? + {% elif q.type == "tracesatisfaction_mc" %} + Which of the following traces satisfies the following LTL formula? + {% elif q.type == "tracesatisfaction_yn" %} + Does this trace satisfy the following LTL formula? + {% else %} +

+ {% endif %} +

+ {% if q.description %} +

{{ q.description }}

+ {% endif %}
@@ -125,7 +107,7 @@
    {% for option in q.options %} -
  • +
-
Tickets
- - - - - - - - - - - - - - - - - -
- {% include 'navbar.html' %} - -

Light Panel

- - - - -
- {% for q in questions %} - {%set qindex = loop.index %} -
-
-

Question {{ qindex }} of {{ questions | length}}

-
- {% if q.type == "englishtoltl" %} - Which of the following LTL formulae best represents this English sentence? - {% elif q.type == "tracesatisfaction_mc" %} - Which of the following traces satisfies the following LTL formula? - {% elif q.type == "tracesatisfaction_yn" %} - Does this trace satisfy the following LTL formula? - {% else %} - - {% endif %} -
-
- {% if q.feedback %} - - {% endif %} - - - {% if q.type == "tracesatisfaction_yn" %} -
Formula: -
 {{ q.question}} 
-
- - -
Trace Alt: -
 {{ q.trace}}
-
- {% elif q.type == "tracesatisfaction_mc" %} -
Formula: -
{{ q.question}}
- {% else %} -
{{ q.question}} -
- {% endif %} - -
    - {% for option in q.options %} -
  • - - -
  • - {% endfor %} -
- - - - - - - - -
-
- {% endfor %} -
- - -
- -
- - -
- - - - - - - - \ No newline at end of file diff --git a/src/templates/prebuiltexercises/robotrain.html b/src/templates/prebuiltexercises/robotrain.html deleted file mode 100644 index d135edb..0000000 --- a/src/templates/prebuiltexercises/robotrain.html +++ /dev/null @@ -1,236 +0,0 @@ - - - - - LTL Tutor: RoboTrain - - - - - - - - - - - - - - - - - - - - - - - -
- {% include 'navbar.html' %} -
{{ exercise_name }}
- - - - -
- {% for q in questions %} - {%set qindex = loop.index %} -
- - -
-
- {% if q.type == "englishtoltl" %} - Which of the following LTL formulae best represents this English sentence? - {% elif q.type == "tracesatisfaction_mc" %} - Which of the following traces satisfies the following LTL formula? - {% elif q.type == "tracesatisfaction_yn" %} - Does this trace satisfy the following LTL formula? - {% else %} - - {% endif %} -
- Question {{ qindex }} of {{ questions | length}} -
- -
- - - {% if q.feedback %} - - {% endif %} - - - {% if q.type == "tracesatisfaction_yn" %} -
-
 {{ q.question}} 
-
-
- -
Trace Alt: -
 {{ q.trace}}
-
- {% elif q.type == "tracesatisfaction_mc" %} -
-
{{ q.question}}
-
- {% else %} -
{{ q.question}} -
- {% endif %} - -
    - {% for option in q.options %} -
  • - -
  • - {% endfor %} -
- - - - - - - - -
-
- {% endfor %} -
- - -
- -
- - -
- - - - - {% include 'footer.html' %} - - -