Since I went down this road yesterday, I figured I'd write down what would be needed to allow Materia to embed content into course pages if we end up deciding that we want to do this.
The RETURN_URL logic in the frontend LTI picker controller needs to be able to handle the different endpoint method. The URL query looks like this: return_type=oembed&endpoint=https://materia.ucf.edu/lti/oembed/0dIDA
Step 3: Add Oembed support
Basically just need a page that returns some JSON for what to return to Canvas:
public function action_oembed($inst_id) {
return <<<EOF
{"version": "1.0","type": "rich","width": 75,"height": 75,"html":"\u003Ciframe src=\u0022https:\/\/materia.qa.cdl.ucf.edu\/embed\/{$inst_id}\u0022 width=700 height=600 alt=\u0022 Assignment\u0022 \/\u003E"}
EOF;
}
Step 4: Add UI
Better UI is needed, and some messaging about the widget not being scorable should be added, too.
Since I went down this road yesterday, I figured I'd write down what would be needed to allow Materia to embed content into course pages if we end up deciding that we want to do this.
Step 1: update Materia XML to add editor button
https://www.eduappcenter.com/tools/xml_builder is a great tool for exploring what extension needs to be added.
Step 2: Allow LTI to accept the new return URL
https://github.com/ucfcdl/Materia/blob/issue/fix-flaky-tests/fuel/app/modules/lti/classes/controller/lti.php#L47-48 need to be updated to support the new selection directive and return URL. Some code needs to be added around the Js::push_inline to clarify whether this is an assignment selection or a course selection. Scorable widgets should probably be blocked from showing up in the picker.
The RETURN_URL logic in the frontend LTI picker controller needs to be able to handle the different endpoint method. The URL query looks like this:
return_type=oembed&endpoint=https://materia.ucf.edu/lti/oembed/0dIDA
Step 3: Add Oembed support
Basically just need a page that returns some JSON for what to return to Canvas:
Step 4: Add UI
Better UI is needed, and some messaging about the widget not being scorable should be added, too.