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

List Student Progress, missing endpoint? #169

Open
eri-trabiccolo opened this issue Jun 19, 2020 · 2 comments
Open

List Student Progress, missing endpoint? #169

eri-trabiccolo opened this issue Jun 19, 2020 · 2 comments
Labels

Comments

@eri-trabiccolo
Copy link
Contributor

In our documentation we have, as student link:

'progress' => [
    "href": "/wp-json/llms/v1/students/456/progress"
]

(https://developer.lifterlms.com/rest-api/#tag/Students)

But actually we have not defined any endpoint to list all the student progresses.

I think we wanted to implement it as we did for the enrollments, but I couldn't find any issue opened.
If I'm wrong, and we don't want that endpoint, then we should remove that student's link.

@eri-trabiccolo eri-trabiccolo added Severity: Normal Type: Bug Bugs and errors Type: Question This issue is a question labels Jun 19, 2020
@thomasplevy thomasplevy removed the Type: Question This issue is a question label Jun 22, 2020
@thomasplevy
Copy link
Contributor

I don't recall any specific reason why the endpoint doesn't exist. I probably intended to build it and never got to it and forgot about it.

@thomasplevy
Copy link
Contributor

@eri-trabiccolo I was having a look at this issue today and I'm not sure how we would really expect to handle listing progress...

The problem I'm seeing is that "progress" isn't a true resource in the database. These records kind-of exist but kind-of dont.

I guess we could query postmeta data (for any post id) by student id and return a list of the results. Is this a useful way of looking at progress though?

The resulting list would not be terribly structured as it would be (by default) sorted probably by ID and include progress records for courses, sections, and lessons all mixed together.

By this logic then I think we should allow listing filters for post_type so that one could request a list of course progress records for a single student, ie: students/$student_id/progress?post_type=course

I suppose this all makes sense, right?

Ordering by progress (the float) would be next to impossible since that's a generated number based on child-element progress for courses and sections at least. But it feels inconsistent to allow progress ordering by certain post types and not others. Unless we build a really gnarly SQL query with a HAVING clause and calculate the overall progress of a course in SQL. That feels awful to me. But I think a consumer that want's to list progress is probably going to want to be able to list progress records by the actual progress...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

2 participants