ethz-let / moodle-qtype_lti

0 stars 1 forks source link

Selecting a preconfigured tool does not save the secure tool URL #1

Closed jmr-ua-pt closed 3 years ago

jmr-ua-pt commented 3 years ago

We have installed the moodle-qtype-lti plugin on a Moodle service, and we set up a Preconfigured Tool (named "Code Checker") to the LTI Provider https://codecheck.io. However, a curious issue happens when creating questions.

When I (in teacher role) try to create a new "External question", I follow the steps:

  1. Select our Preconfigured tool ("Code Checker").
  2. Fill in the secure tool URL. (It is checked: "Using tool configuration: Code Checker"),
  3. Press "Save changes".

Screenshot from 2021-02-04 23-14-07

But when I try to preview the question, it shows an error: "No assignment ID".

Screenshot from 2021-02-04 23-12-31

And when I edit the question, I find that the Secure tool URL is empty! (Why?).

I'll be happy to provide more details, if you need.

Workaround

I can manage to create the question if I proceed as follows:

  1. Select Preconfigured tool = "Automatic, based on tool URL".
  2. Fill in the secure tool URL, (it reports "Tool configuration not found for this URL").
  3. Press "Save changes".
  4. Edit the question. (The Secure tool URL is still there).
  5. Change Preconfigured tool to "Code Checker". (The Secure tool URL is cleared).
  6. Fill in the Secure tool URL again.
  7. Press "Save changes".

Then the preview works fine. Screenshot from 2021-02-04 23-33-31

This works, but it takes much more work.

nexterday commented 3 years ago

Hi Joa, when the preconfigured tool doesnt match the tool url, the url get deleted from the field. Can you tell me what is the preconfigured tool data are? (Remove pass/username from the screenshot).

jmr-ua-pt commented 3 years ago

I've asked our admin for the tool data, then I'll report it here. But please notice that the Secure Tool URL was validated in the first screenshot above.

nexterday commented 3 years ago

Understood, its just we have added deliberately a block to give superiority to the automatic preconfiguration hence the deletion, but if this is a case to be confirmed, then it needs to be fixed/adjusted. Awaiting your screenshot.

jmr-ua-pt commented 3 years ago

I meant the first screenshot in the bug report (https://github.com/ethz-let/moodle-qtype_lti/issues/1#issue-801720268).

jmr-ua-pt commented 3 years ago

Our admin has just sent me the tool data. Here it is: image

nexterday commented 3 years ago

Dear João (sorry for the typo in your name)

So:

  1. the provider link in the pre-configered tools should be (https://codecheck.io/lti/config) and once you save it, it will automatically update to (https://codecheck.io/assignment).
  2. when you create a question, and choose the pre-configered tool instead of automatic, the toolurl (and securetool url) should be disabled and never filled as this would be lead by the preconfigured tool already choosen. when you choose automatic tool, it will match the domain only, however if the securetool path has nothing to-do with the lti preconfigured tool, it will be automatically removed from securetool url as deemed "unsafe" to use. What I suggest here: A. securetoolurl is usually https://codecheck.io/assignment/2010140721rjdzuhv4nv9d4bjiourush0p , however, if your codecheck gives you a different lti link, then use it. please note that we normally have different lti link to the normal assignment link and that should be clearly mentioned in codecheck. B. make sure you have downloaded the latest version of our qtype_lti (from master branch) in case you have a difference. C. use automatic tool selection instead of pre-configered when you create a question unless the provider has deeper features to select which assignment you want. D. please refer to codecheck documentation as your screenshots do not match what the documentation suggest. you can find the details for end points here: https://horstmann.com/codecheck/lti.html

Ps. the fields should be disabled once you pick a preconfigered tool, hence you might have the outdated code?

Screenshot 2021-02-06 at 11 15 35
jmr-ua-pt commented 3 years ago

Today we were able to try your suggestion:

  1. The administrator set the Preconfigured tool URL to https://codecheck.io/lti/config.
  2. When creating a new question, I used the automatic tool selection.
  3. Then I filled in the Secure tool URL for my CodeCheck assignment. It was verified to match the preconfigured tool.
  4. Saved changes.

The question preview worked correctly. Re-editing the question also shows the updated Preconfigured tool, and the same Secure tool URL I had specified.

It seems the problem was with our set up and not a bug in the plugin.

Thank you very much.