From 0aa27ab7fe0996efbcfd5a16f994d87b852fd46d Mon Sep 17 00:00:00 2001 From: Jason Skomorowski Date: Thu, 31 Jul 2014 14:52:51 -0400 Subject: [PATCH] Assign unique teams to allow multiple MKWS blocks --- mkwsxb/mkwsxb.py | 3 ++- mkwsxb/static/html/mkwsxb.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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...
-- 1.7.10.4