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

Cache and re-use a lineitem? #56

Open
cmcfadden opened this issue Feb 11, 2021 · 1 comment
Open

Cache and re-use a lineitem? #56

cmcfadden opened this issue Feb 11, 2021 · 1 comment

Comments

@cmcfadden
Copy link

Curious to sanity check something before doing a fork.

We have an app that will create multiple lineitems, and then may be updating them frequently. Rather than going back to the LMS continually to fetch that info, I'd like to just cache those in our app.

Right now, the AGS put_grade method will always reload a lineitem, unless it was the claim/endpoint.

I was thinking of adding a new conditional in put_grade line 22

} else if($lineitem !== null && !empty($lineitem->get_id()) {
$score_url = $lineitem->get_id();
}

Anyone see a problem with doing that?

@kpommerenke
Copy link

We've been using the exact same two lines in production for two months and have not had any issues.

What did create an issue was to get the launch data from cache based on the launch ID stored in the session, when students were able to switch from one course to another in our tool without relaunching from the LMS, as the launch data from the session then showed the wrong context ID and picked the wrong lineitem URL.

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

No branches or pull requests

2 participants