This is an implementation of the byui-design-lti in Angular. It is a tool that provides course designers quick and easy access to frequenly used html elements. Express and lti-middleware are used to handle lti requests.
Currently the features are being compiled in Google Docs
To install dependencies, navigate to this repositoty in the console and type:
npm install --save repository-name
To start the development server, type this in the console:
npm start
This will run the Angular serve command which will open a new window in your browser and run the app. To start the Express server for development in Canvas, type:
npm run build
npm restart
Navigate to the WYSIWYG course editor in Canvas and choose the drop down for more tools and click the Toolbox dev tool. The server will update automatically when you make changes to server files. If you want the app to reflect changes made to the UI, you have to rebuild the tool using npm run build.
You will need to set the following env vars to run the app
Variable | Windows Code | Purpose |
---|---|---|
SESSION_SECRET | set SESSION_SECRET= |
This key is used for session security |
LTI_KEY | set LTI_KEY= |
The LTI Key |
LTI_SECRET | set LTI_SECRET= |
The LTI Secret |
npm restart
Open the page below, click advanced, and click proceed anyway
https://localhost:1820
Do this by running the commands above with the correct keys.
Example: set LTI_SECRET=asldkjalk
See information about the Angular Cli for helpful production tips: https://github.com/angular/angular-cli
Lti parameters are sent to the app in the lti launch. There is a lti object sent with the launch that has information such as the return url, course information and who is using the tool.
The lti-service returns lti parameters from the endpoints in routes/index.js.
router.route('/api/course-name').get((req, res) => {
var ltiParams = req.session.lti.params; // use this ltiParams object if you need any more info about the user
var courseName = ltiParams.context_title;
res.send(JSON.stringify(courseName));
})
The tool returns the selected html element to the WYSIWYG.
Example:
This will do all of the heavy lifting required for the lti app.
Serve the UI for the app at the conclusion of the request.
Prepare the content items object for the return post request to Canvas.
Use form submission (post) to return content to Canvas through the content items object
Example:
Make sure to include canvas-wrapper
as a developer dependency when you need it:
npm i --save-dev byuitechops/canvas-wrapper
Here are instructions on how to set up the development server:
.....