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

[BUG 🐞] CourseCompletionStatus boolean properties cast issue #21

Open
jbpenrath opened this issue Jan 13, 2025 · 0 comments
Open

[BUG 🐞] CourseCompletionStatus boolean properties cast issue #21

jbpenrath opened this issue Jan 13, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@jbpenrath
Copy link

Describe the bug

core_completion_get_course_completion_status response has a cast issue. The class CourseCompletionStatus cast boolean values as integer that is weird.

To Reproduce
Steps to reproduce the behavior:

  1. Call the 'core_completion_get_course_completion_status' ws function for a relevant courseid/userid couple
  2. See that completed and complete property returned by Moodle are boolean values but once passed to CourseCompletionStatus there are integers...

Expected behavior
Boolean values returned by the Moodle API should be cast as bool by MoodlePy.

Desktop (please complete the following information):

  • Python Version 3.10
  • Version 0.24.1
@jbpenrath jbpenrath added the bug Something isn't working label Jan 13, 2025
@jbpenrath jbpenrath changed the title [BUG 🐞] [BUG 🐞] CourseCompletionStatus boolean properties cast issue Jan 13, 2025
jbpenrath added a commit to openfun/joanie that referenced this issue Jan 13, 2025
We expect that the method `get_grades` of an lms backend returns a dict with
boolean property `passed`. Currently for moodle, due to a transformation made by
 moodlepy, the passed property has an integer value (0 or 1). We aim to fix
 that into moodlepy directly but to fix the issue as soon as possible we first
 cast the integer value as a bool.

 hexatester/moodlepy#21
jbpenrath added a commit to openfun/joanie that referenced this issue Jan 13, 2025
We expect that the method `get_grades` of an lms backend returns a dict with
boolean property `passed`. Currently for moodle, due to a transformation made by
 moodlepy, the passed property has an integer value (0 or 1). We aim to fix
 that into moodlepy directly but to fix the issue as soon as possible we first
 cast the integer value as a bool.

 hexatester/moodlepy#21

 Fix #1005
jbpenrath added a commit to openfun/joanie that referenced this issue Jan 13, 2025
We expect that the method `get_grades` of an lms backend returns a dict with
boolean property `passed`. Currently for moodle, due to a transformation made by
 moodlepy, the passed property has an integer value (0 or 1). We aim to fix
 that into moodlepy directly but to fix the issue as soon as possible we first
 cast the integer value as a bool.

 hexatester/moodlepy#21

 Fix #1005
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant