Cvmcosta / ltijs

Turn your application into a fully integratable LTI 1.3 tool provider.
https://cvmcosta.github.io/ltijs/
Apache License 2.0
299 stars 67 forks source link

/deeplink creation does not create grading entries in gradebook #89

Closed markvitapoly closed 3 years ago

markvitapoly commented 3 years ago

Steps Deeplinking does not have an entry on the gradebook.

  1. use the example server and client against sandbox.moodle.com
  2. enable content-item message and grading services image
  3. click on select content, select one of the resources and submit

bug: while the deeplinked content is added to the course, it is not added to the gradebook. if adding the lti tool without using select content (deep linking), a gradebook entry is created.

Cvmcosta commented 3 years ago

Hello @markvitapoly! This is not a bug, it's a Moodle behaviour, deep linking allows us to create a line item automatically by sending it in the content item. Moodle no longer adds the grade line automatically. Check LTI Content Item documentation for more information:

const items = {
      type: 'ltiResourceLink',
      title: 'Ltijs Demo',
      custom: {
        name: resource.name,
        value: resource.value
      },
      lineItem:{
         label: 'score',
         scoreMaximum: 100
      }
    }
const form = await lti.DeepLinking.createDeepLinkingForm(res.locals.token, items, { message: 'Successfully Registered' })
Cvmcosta commented 3 years ago

I do believe that changing the following privacy setting to Always might make moodle revert back to creating line items automatically:

Screenshot from 2021-03-25 08-32-33

markvitapoly commented 3 years ago

you are awesome! that did the trick. 👍

Cvmcosta commented 3 years ago

Great! Please let me know if you have any more questions.