From: Jason Skomorowski Date: Thu, 31 Jul 2014 18:52:51 +0000 (-0400) Subject: Assign unique teams to allow multiple MKWS blocks X-Git-Url: http://git.indexdata.com/?p=mkwsxb-moved-to-github.git;a=commitdiff_plain;h=0aa27ab7fe0996efbcfd5a16f994d87b852fd46d Assign unique teams to allow multiple MKWS blocks --- diff --git a/mkwsxb/mkwsxb.py b/mkwsxb/mkwsxb.py index 9fed202..6c11a22 100644 --- a/mkwsxb/mkwsxb.py +++ b/mkwsxb/mkwsxb.py @@ -1,6 +1,7 @@ """Embed widgets from MKWS, the MasterKey Widget Set""" import pkg_resources +import random from xblock.core import XBlock from xblock.fields import Integer, Scope, String, Any, Boolean, Dict @@ -24,7 +25,7 @@ class MKWSXB(XBlock): def student_view(self, context=None): """The primary view of the MKWS XBlock, shown to students when viewing courses.""" html = self.resource_string("static/html/mkwsxb.html") - frag = Fragment(html.format(query=self.query)) + frag = Fragment(html.format(query=self.query, team=random.randint(0, 100000))) frag.add_javascript_url("//mkws.indexdata.com/mkws-complete.js") frag.add_javascript_url("//example.indexdata.com/mkws-widget-ru.js") frag.add_css(self.resource_string("static/css/mkws-widget-ru.css")) diff --git a/mkwsxb/static/html/mkwsxb.html b/mkwsxb/static/html/mkwsxb.html index e5627d9..e1107a6 100644 --- a/mkwsxb/static/html/mkwsxb.html +++ b/mkwsxb/static/html/mkwsxb.html @@ -1,3 +1,3 @@
-
Searching Reference Universe...
+
Searching Reference Universe...