forked from apluslms/a-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix_lti_issues
- Loading branch information
Showing
31 changed files
with
921 additions
and
52 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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,24 @@ | ||
# Generated by Django 4.2.13 on 2024-10-08 08:17 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('userprofile', '0006_auto_20210812_1536'), | ||
('course', '0059_submissiontag'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='StudentModuleGoal', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('goal_points', models.IntegerField(default=0)), | ||
('module', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='course.coursemodule')), | ||
('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='userprofile.userprofile')), | ||
], | ||
), | ||
] |
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,42 @@ | ||
from playwright.sync_api import Page, expect | ||
|
||
from e2e_tests.helpers import login | ||
|
||
|
||
def test_points_goal_set(page: Page) -> None: | ||
login(page, "student", "student") | ||
|
||
page.get_by_role("link", name="Def. Course Current DEF000 1.").click() | ||
page.get_by_role("link", name="Your points").click() | ||
page.locator("#progress-questionnaires").get_by_role("button", name="Points goal").click() | ||
page.get_by_label("Input personalized goal as").fill("50") | ||
page.get_by_label("Input personalized goal as").press("Tab") | ||
page.get_by_role("button", name="Save").click() | ||
expect(page.locator("#success-alert")).to_contain_text("Succesfully set personalized points goal") | ||
page.get_by_role("button", name="Close", exact=True).click() | ||
expect(page.get_by_text("Points goal: 50")) | ||
expect(page.locator("#goal-points")) | ||
|
||
|
||
def test_points_goal_reached(page: Page) -> None: | ||
login(page, "student", "student") | ||
page.get_by_role("link", name="Def. Course Current DEF000 1.").click() | ||
page.get_by_role("link", name="Creating questionnaire exercises").click() | ||
page.locator("label").filter(has_text="2").first.click() | ||
page.locator("label").filter(has_text="an integer").first.click() | ||
page.locator("div:nth-child(4) > div:nth-child(6) > label").click() | ||
page.locator("label").filter(has_text="-").nth(1).click() | ||
page.locator("label").filter(has_text="an integer").nth(1).click() | ||
page.locator("div:nth-child(5) > div:nth-child(6) > label").click() | ||
page.locator("label").filter(has_text="-").nth(3).click() | ||
page.locator("#chapter-exercise-1").get_by_role("button", name="Submit").click() | ||
expect(page.get_by_label("5.1.1 Single-choice and")).to_contain_text("30 / 40") | ||
page.get_by_role("link", name="Your points").click() | ||
page.locator("#progress-questionnaires").get_by_role("button", name="Points goal").click() | ||
page.get_by_label("Input personalized goal as").fill("30") | ||
page.get_by_role("button", name="Save").click() | ||
expect(page.locator("#success-alert")).to_contain_text("Succesfully set personalized points goal") | ||
page.get_by_role("button", name="Close", exact=True).click() | ||
progress_bar_locator = page.locator("#progress-questionnaires > .progress > .aplus-progress-bar") | ||
expect(progress_bar_locator).\ | ||
to_have_class("aplus-progress-bar aplus-progress-bar-striped aplus-progress-bar-primary") |
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
Oops, something went wrong.