Skip to content

Commit

Permalink
MDL-29207 SCORM: Auto-continue doesn't work with Pre-req due to JS er…
Browse files Browse the repository at this point in the history
…rors
  • Loading branch information
danmarsden committed Feb 3, 2013
1 parent 216e2e5 commit bb22d06
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions mod/scorm/datamodels/callback.js.php
Expand Up @@ -19,9 +19,27 @@


success: function(o) { success: function(o) {
YUI().use('yui2-treeview', 'yui2-layout', function(Y) { YUI().use('yui2-treeview', 'yui2-layout', function(Y) {
scorm_tree_node = Y.YUI2.widget.TreeView.getTree('scorm_tree'); // MDL-29159 The core version of getContentHtml doesn't escape text properly.
Y.YUI2.widget.TextNode.prototype.getContentHtml = function() {
var sb = [];
sb[sb.length] = this.href ? '<a' : '<span';
sb[sb.length] = ' id="' + Y.YUI2.lang.escapeHTML(this.labelElId) + '"';
sb[sb.length] = ' class="' + Y.YUI2.lang.escapeHTML(this.labelStyle) + '"';
if (this.href) {
sb[sb.length] = ' href="' + Y.YUI2.lang.escapeHTML(this.href) + '"';
sb[sb.length] = ' target="' + Y.YUI2.lang.escapeHTML(this.target) + '"';
}
if (this.title) {
sb[sb.length] = ' title="' + Y.YUI2.lang.escapeHTML(this.title) + '"';
}
sb[sb.length] = ' >';
sb[sb.length] = this.label;
sb[sb.length] = this.href?'</a>':'</span>';
return sb.join("");
};

if (o.responseText !== undefined) { if (o.responseText !== undefined) {
//alert('got a response: ' + o.responseText); var tree = new Y.YUI2.widget.TreeView('scorm_tree');
if (scorm_tree_node && o.responseText) { if (scorm_tree_node && o.responseText) {
var hnode = scorm_tree_node.getHighlightedNode(); var hnode = scorm_tree_node.getHighlightedNode();
var hidx = null; var hidx = null;
Expand Down

0 comments on commit bb22d06

Please sign in to comment.