Open abanghendri opened 2 years ago
@abanghendri do you implement this library successfully in your tool end?
@anubhabmondalDirac yes, I'm able to implement it until content launch but now I face some issue on NRPS and AGS service I use moodle for LTI consumer, but when I access moodle token, I always got this error
OAT \ Library \ Lti1p3Core \ Exception \ LtiException (400)
Cannot get line item: Cannot get access token: Client error: `POST http://moodle.local/mod/lti/token.php` resulted in a `400 Bad Request` response: { "error" : "Cannot handle token prior to 2023-02-10T16:39:07+0700" }
I don't know if this error comes from this library or moodle, because it says 400 which mean client (my platform) error
@abanghendri oh okk .. Sorry, I am also new to LTI 1.3. I am trying to understand how to embed it into my tool I am also using Moodle for LMS. Do you have any code examples to understand the workflow and launch? Thanks!
How can I implement find registration? what will be my code structure any one help?
use OAT\Library\Lti1p3Core\Registration\RegistrationInterface; use OAT\Library\Lti1p3Core\Registration\RegistrationRepositoryInterface;
$registrationRepository = new class implements RegistrationRepositoryInterface { public function find(string $identifier): ?RegistrationInterface { // TODO: Implement find() method to find a registration by identifier, or null if not found. }
public function findAll(): array { // TODO: Implement findAll() method to find all available registrations. }
public function findByClientId(string $clientId) : ?RegistrationInterface { // TODO: Implement findByClientId() method to find a registration by client id, or null if not found. }
public function findByPlatformIssuer(string $issuer, string $clientId = null): ?RegistrationInterface { // TODO: Implement findByPlatformIssuer() method to find a registration by platform issuer, and client id if provided. }
public function findByToolIssuer(string $issuer, string $clientId = null): ?RegistrationInterface { // TODO: Implement findByToolIssuer() method to find a registration by tool issuer, and client id if provided. } };
any demo example code available ? Thanks in advance !
since it our company's propietary code thus I cannot share as is to anyone, so I'll back to you as soon as possible with my new integration example, may be 2-4 days @anubhabmondalDirac
Ok, I understand. Thank you so much.
Hi @anubhabmondalDirac , you can fork my repo here Laravel LTI Example
the steps is
@abanghendri Thank you so much. For me, it will be beneficial. But my tool is based on PHP Codeigniter, I never use laravel but will try to implement it as you say. Thanks again!
@anubhabmondalDirac not too different I think, I used to use Codeigniter too, since this library is framework agnostic, you can use it on any PHP project even on native PHP I just use ordinary controller and traits which also supported by CI framework
@abanghendri Thanks, I will try my best.
Hello, I need help about this package, I still confuse about step by step guide if I want integrate my laravel app as a LTI platform, I use moodle as LTI Tool provider and moodle give me Registration URL, what can I do with that link? I cannot find any code that tell me to process that link, what essential routes needed to be a Platform, how to process from Registration URL and get all the data from tool provider and then launch the course.
thank you in advance