projects
/
mkwsxb-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ad29d36
)
Include require.js so the LMS can load MKWS too
author
Jason Skomorowski
<jason@indexdata.com>
Thu, 14 Aug 2014 18:22:09 +0000
(14:22 -0400)
committer
Jason Skomorowski
<jason@indexdata.com>
Thu, 14 Aug 2014 18:22:09 +0000
(14:22 -0400)
mkwsref/mkwsref/mkwsref.py
patch
|
blob
|
history
diff --git
a/mkwsref/mkwsref/mkwsref.py
b/mkwsref/mkwsref/mkwsref.py
index
dd0fce0
..
a09e496
100644
(file)
--- a/
mkwsref/mkwsref/mkwsref.py
+++ b/
mkwsref/mkwsref/mkwsref.py
@@
-33,12
+33,16
@@
class MKWSRef(XBlock):
# student.js uses require.js as it cannot guarantee mkws-complete.js has loaded
# in studio without it. We'll need to add it if we're in the LMS:
frag.add_javascript_url("/static/js/vendor/require.js");
# student.js uses require.js as it cannot guarantee mkws-complete.js has loaded
# in studio without it. We'll need to add it if we're in the LMS:
frag.add_javascript_url("/static/js/vendor/require.js");
+ # frag.add_resource_url("//mkws.indexdata.com/mkws-complete", "text/javascript", "head");
+ # frag.add_resource('<script src="//mkws.indexdata.com/mkws-complete.js"></script>', "text/html", "head");
frag.add_javascript(self.resource_string("static/js/src/student.js"))
frag.initialize_js('MKWSRef')
return frag;
def author_view(self, context=None):
frag.add_javascript(self.resource_string("static/js/src/student.js"))
frag.initialize_js('MKWSRef')
return frag;
def author_view(self, context=None):
- """View of the MKWS XBlock shown when authoring courses."""
+ """The primary view of the MKWS XBlock, shown when authoring courses."""
+ # This should closely mirror the student_view. Here all we do is not include
+ # require.js as it's already in Studio and the lms path won't work.
html = self.resource_string("static/html/student.html")
frag = Fragment(html.format(query=self.query, team=random.randint(0, 100000)))
frag.add_javascript(self.resource_string("static/js/src/student.js"))
html = self.resource_string("static/html/student.html")
frag = Fragment(html.format(query=self.query, team=random.randint(0, 100000)))
frag.add_javascript(self.resource_string("static/js/src/student.js"))