From f9e8360a7f594f5da0b448bd8f8042b77f5d176a Mon Sep 17 00:00:00 2001 From: Frank Ronny Larsen Date: Wed, 16 Jan 2013 19:33:59 +0100 Subject: [PATCH] Changes to example content. Example content is now a working board game sans Images. It can be uploaded using the H5P module too. It will work. (At least with the next commit) --- content.json | 0 css/questionset.css | 27 +++++++++++++++++++++++++++ js/questionset.js | 42 ++++++++++-------------------------------- library.json | 16 ++++++++++++++++ views/questionset.ejs | 29 ----------------------------- 5 files changed, 53 insertions(+), 61 deletions(-) delete mode 100644 content.json create mode 100644 css/questionset.css diff --git a/content.json b/content.json deleted file mode 100644 index e69de29..0000000 diff --git a/css/questionset.css b/css/questionset.css new file mode 100644 index 0000000..fdc21b3 --- /dev/null +++ b/css/questionset.css @@ -0,0 +1,27 @@ +.dots-container { + text-align: center; +} +.progress-dot { + display: inline-block; + width: 10px; + height: 10px; + border-radius: 50%; +} +.progress-dot.unanswered { + background: darkred; +} +.progress-dot.answered { + background: darkgreen; +} +.progress-dot.current { + box-shadow: 0px 0px 6px firebrick; +} +.intro-page { + background: white; + position: absolute; + z-index: 20; + height: 100%; + width: 100%; + left: 0px; + top: 0px; +} diff --git a/js/questionset.js b/js/questionset.js index ca85d98..a3dbbff 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -19,35 +19,6 @@ H5P.QuestionSet = function (options) { var $ = H5P.jQuery; var texttemplate = '' + -'' + '
' + ' <% if (introPage.showIntroPage) { %>' + '
' + @@ -197,10 +168,17 @@ H5P.QuestionSet = function (options) { // Function for attaching the multichoice to a DOM element. var attach = function (targetId) { + if (typeof(target) == "string") { + target = $("#" + target); + } else { + target = $(target); + } + // Render own DOM into target. - template.update(targetId, params); - $myDom = $('#' + targetId); - $myDom.css({backgroundImage: 'url(' + params.backgroundImage + ')'}); + $myDom = target; + $myDom.html(template.render(params)).css({ + backgroundImage: 'url(' + params.backgroundImage + ')' + }); // Attach questions for (var i=0; i -.dots-container { - text-align: center; -} -.progress-dot { - display: inline-block; - width: 10px; - height: 10px; - border-radius: 50%; -} -.progress-dot.unanswered { - background: darkred; -} -.progress-dot.answered { - background: darkgreen; -} -.progress-dot.current { - box-shadow: 0px 0px 6px firebrick; -} -.intro-page { - background: white; - position: absolute; - z-index: 20; - height: 100%; - width: 100%; - left: 0px; - top: 0px; -} -
<% if (introPage.showIntroPage) { %>