Skip to content
This repository was archived by the owner on Jun 30, 2024. It is now read-only.

Commit bbb1f69

Browse files
committed
Detect webwork questions when rendering previews
1 parent 83346b6 commit bbb1f69

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

static/js/admin.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,6 +1909,12 @@ async function renderRunestoneComponent(componentSrc, whereDiv, moreOpts) {
19091909
}
19101910

19111911
let componentKind = $($(`#${whereDiv} [data-component]`)[0]).data("component");
1912+
// webwork problems do not have a data-component attribute so we have to try to figure it out.
1913+
//
1914+
if (! componentKind &&
1915+
(componentSrc.indexOf("handleWW") >= 0) || (componentSrc.indexOf("webwork") >= 0)) {
1916+
componentKind = "webwork";
1917+
}
19121918
// Import all the js needed for this component before rendering
19131919
await runestoneComponents.runestone_import(componentKind);
19141920
let opt = {};

0 commit comments

Comments
 (0)