Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: task file import #438

Merged
merged 3 commits into from
Jun 1, 2024
Merged

Conversation

ublefo
Copy link
Contributor

@ublefo ublefo commented Apr 22, 2024

Fixes task file import bug where a task file import will attach the task sheets and resources to the wrong task. Now we use the longest match to ensure the task file is imported to the correct task.

A new task T10 has been added to test this behavior, and now the unit test will validate the content of the task sheets for T1 and T10 so we can catch this in the future.

@ublefo ublefo force-pushed the fix/task-file-import branch from e01ee4a to 9fe418c Compare April 22, 2024 10:59
Copy link
Member

@macite macite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix file matching to allow partial match of filename, searching for the longest matching abbreviation

app/models/unit.rb Outdated Show resolved Hide resolved
@macite macite marked this pull request as draft April 27, 2024 00:02
@ublefo ublefo force-pushed the fix/task-file-import branch from 9fe418c to 01454be Compare April 27, 2024 15:48
@ublefo ublefo force-pushed the fix/task-file-import branch from 01454be to c44b147 Compare April 27, 2024 16:22
@ublefo ublefo marked this pull request as ready for review April 27, 2024 16:23
@ublefo ublefo requested a review from macite April 27, 2024 16:23
@macite macite changed the base branch from development to 7.0.x June 1, 2024 05:09
@macite macite changed the base branch from 7.0.x to development June 1, 2024 05:09
@macite macite merged commit 8f37943 into doubtfire-lms:development Jun 1, 2024
4 checks passed
macite pushed a commit to macite/doubtfire-api that referenced this pull request Jun 1, 2024
* fix: sort taskdef by abbr length to ensure the longest match

* fix: add a new task to test task files import filename matching

* enhance: validate task sheet content in unit test
@ublefo ublefo deleted the fix/task-file-import branch June 2, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants