see opendsa readme
append string
if (score.correct) {
var taskId = 'custom-' + Khan.currentExerciseId.toLowerCase();
window.parent.postMessage(JSON.stringify({
taskId: taskId,
status: 'done'
}), '*');
}
before
$(Exercises).trigger("problemDone", {
in file OpenDSA/khan-exercises/interface.js
Also need some patching for run in different domain/subdomain
lib/odsaKA.js
lib/odsaKA-min.js
// MODULE_ORIGIN = parent.location.protocol + '//' + parent.location.host,
MODULE_ORIGIN = 'https://global.codio.com',
lib/odsaMOD.js
lib/odsaMOD-min.js
// var url = (window.location != window.parent.location) ? document.referrer : document.location;
var url = document.referrer;
khan-exercise.js
delete lines
// Hook out for exercise test runner
if (localMode && parent !== window && typeof parent.jQuery !== "undefined") {
parent.jQuery(parent.document).trigger("problemLoaded", [makeProblem, answerData.solution]);
}
Do not forget add codio client script file
metadata:
scripts:
- https://codio.com/codio-client.js
- https://global.codio.com/opendsa/passtocodio_v2.js
assets:
- SourceCode
- "DataStructures":
pattern: "*.js"
dst: ".guides/opendsa_v1/DataStructures"
- "DataStructures":
pattern: "*.css"
dst: ".guides/opendsa_v1/DataStructures"
- "Exercises":
pattern: "*.js"
dst: ".guides/opendsa_v1/Exercises"
- "Exercises":
pattern: "*.html"
dst: ".guides/opendsa_v1/Exercises"
- "Exercises":
pattern: "*.json"
dst: ".guides/opendsa_v1/Exercises"
- "AV":
pattern: "*.js"
dst: ".guides/opendsa_v1/AV"
- "AV":
pattern: "*.html"
dst: ".guides/opendsa_v1/AV"
- "AV":
pattern: "*.json"
dst: ".guides/opendsa_v1/AV"
- "AV":
pattern: "*.css"
dst: ".guides/opendsa_v1/AV"
- "AV":
pattern: "*.txt"
dst: ".guides/opendsa_v1/AV"
- "lib":
pattern: "*.js"
dst: ".guides/opendsa_v1/lib"
- "lib":
pattern: "*.html"
dst: ".guides/opendsa_v1/lib"
- "lib":
pattern: "*.json"
dst: ".guides/opendsa_v1/lib"
- "lib":
pattern: "*.png"
dst: ".guides/opendsa_v1/lib"
- "lib":
pattern: "*.css"
dst: ".guides/opendsa_v1/lib"
- "khan-exercises":
pattern: "*.js"
dst: ".guides/opendsa_v1/khan-exercises"
- "khan-exercises":
pattern: "*.css"
dst: ".guides/opendsa_v1/khan-exercises"
- "khan-exercises":
pattern: "*.html"
dst: ".guides/opendsa_v1/khan-exercises"
- "khan-exercises":
pattern: "*.png"
dst: ".guides/opendsa_v1/khan-exercises"
- "khan-exercises":
pattern: "*.gif"
dst: ".guides/opendsa_v1/khan-exercises"
- "khan-exercises":
pattern: "*.eot"
dst: ".guides/opendsa_v1/khan-exercises"
- "khan-exercises":
pattern: "*.otf"
dst: ".guides/opendsa_v1/khan-exercises"
- "khan-exercises":
pattern: "*.svg"
dst: ".guides/opendsa_v1/khan-exercises"
- "khan-exercises":
pattern: "*.woff"
dst: ".guides/opendsa_v1/khan-exercises"
- "RST/Images":
pattern: "*.*"
dst: "Images"
optimization:
optimizeImages: true
To make jsav iframe assets need to add to codio_structure.yaml
options
opendsa:
writeIframe: true
In generate folder will appear subfolder with name jsav
- need to upload it to base CDN path
Add an option to the codio_structure.yaml
with the language name from the list: "java", "c++", "python"
opendsa:
source_code: java