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

Completion expiry should use timestamp instead of stored #125

Closed
garemoko opened this issue Dec 27, 2016 · 1 comment
Closed

Completion expiry should use timestamp instead of stored #125

garemoko opened this issue Dec 27, 2016 · 1 comment

Comments

@garemoko
Copy link
Collaborator

Comparing the expiry to a timestamp is better than to the stored date because what really matters is when the learner did the thing, not when it was stored in the LRS.

Modify tincanlaunch_get_completion_state in lib.php to not just check if statements are returned but also cycle through the statements and make sure that at least one has a timestamp greater than the expiry date.

Currently the relevant code looks like this:

        // If the statement exists, return true else return false.
        if (!empty($statementquery->content) && $statementquery->success) {
            $result = true;
        } else {
            $result = false;
        }

Note: setting the result variable to true/false and then returning the variable is unneeded. We can just return true or false.

@davidpesce
Copy link
Owner

Fixed in #198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants