ucfopen / Materia

Engage students with easily embedded apps for online courses. Supercharge your course with compelling experiences and game mechanics.
https://ucfopen.github.io/Materia-Docs/
GNU Affero General Public License v3.0
36 stars 34 forks source link

[React Branch] Re-implement postMessages on LTI resource selection #1474

Closed clpetersonucf closed 1 year ago

clpetersonucf commented 1 year ago

This is required for Obojobo support. See the relevant section in MSCA: https://github.com/ucfopen/Materia-Server-Client-Assets/blob/7ce05180949c8086fa73921e7561d7d32c6b8f38/src/js/controllers/ctrl-lti-resource-selection.js

const announceChoice = () => {
        const widgetData = $scope.selectedWidget
        delete widgetData.element
        delete widgetData.searchCache

        // the host system can listen for this postMessage "message" event:
        if (JSON.stringify && parent.postMessage) {
            parent.postMessage(JSON.stringify(widgetData), '*')
        }
    }
clpetersonucf commented 1 year ago

Resolved in #1475