Changes to default styles for QuestionSets

d3summaryChart
Frank Ronny Larsen 2013-01-25 10:22:47 +01:00
parent f23160d67b
commit 3cfbd5f586
10 changed files with 129 additions and 32 deletions

BIN
css/img/Paper-clean.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
css/img/mark-fail.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
css/img/mark-pass.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -1,3 +1,21 @@
.questionset {
width: 535px;
height: 400px;
padding: 50px;
background: transparent url(img/Paper-clean.png);
position: absolute;
top: 0;
left: 0;
-webkit-transition: top 2s, left 2s, -webkit-transform 2s;
}
.questionset.hidden {
-webkit-transform: rotate(-45deg);
top: 525px;
left: 100px;
}
.dots-container { .dots-container {
text-align: center; text-align: center;
} }
@ -17,16 +35,88 @@
box-shadow: 0px 0px 6px firebrick; box-shadow: 0px 0px 6px firebrick;
} }
.intro-page { .intro-page {
background-color: rgba(255,255,255,0.9); /*background-color: rgba(255,255,255,0.9);*/
padding: 10px; padding: 10px;
position: absolute; position: absolute;
z-index: 20; z-index: 20;
height: 100%; height: 100%;
width: 100%; /*width: 100%;*/
left: 0px; left: 0px;
top: 0px; top: 0px;
} }
.intro-page .title {
font-size: 200%;
font-weight: bold;
text-align: center;
margin-bottom: 1em;
}
.intro-page .introduction {
font-size: 125%;
margin: 1em 10%;
}
.intro-page .buttons {
text-align: right;
}
#qs-startbutton {
position: absolute;
bottom: 25px;
right: -40px; /* TODO: this is probably not right */
}
.qs-footer {
position: absolute;
bottom: 50px;
height: 40px;
width: 535px;
}
.qs-progress {
line-height: 40px;
padding: 0;
}
.qs-footer .button {
width: 80px;
height: 40px;
border: 1px solid #bababa;
border-radius: 4px;
position: absolute;
top: 0;
}
.qs-footer .button.next {
right: 100px;
}
.qs-footer .button.finish {
right: 0px;
}
.qs-footer .button.prev {
left: 0px;
}
.questionset-results { .questionset-results {
background-color: rgba(255, 255, 255, 0.75); background-color: rgba(255, 255, 255, 0.75);
padding: 10px; padding: 10px;
height: 480px;
text-align: center;
} }
.questionset-results .resulttext {
font-size: 20px;
line-height: 25px;
margin: 40px 100px;
padding-left: 60px;
min-height: 60px;
background-repeat: no-repeat;
background-position: left center;
}
.questionset-results .resulttext.fail {
background-image: url(img/mark-fail.png);
}
.questionset-results .resulttext.success {
background-image: url(img/mark-pass.png);
}
.questionset-results .buttons {
text-align: right;
}

View File

@ -20,22 +20,22 @@ H5P.QuestionSet = function (options, contentId) {
var cp = H5P.getContentPath(contentId); var cp = H5P.getContentPath(contentId);
var texttemplate = '' + var texttemplate = '' +
'<div class="questionset">' + '<% if (introPage.showIntroPage) { %>' +
' <% if (introPage.showIntroPage) { %>' + '<div class="intro-page">' +
' <div class="intro-page">' + ' <div class="title"><%= introPage.title %></div>' +
' <div class="title"><%= introPage.title %></div>' + ' <div class="introduction"><%= introPage.introduction %></div>' +
' <div class="introduction"><%= introPage.introduction %></div>' + ' <div class="buttons"><button id="qs-startbutton"><%= introPage.startButtonText %></button></div>' +
' <div class="buttons"><button id="qs-startbutton"><%= introPage.startButtonText %></button></div>' + '</div>' +
' </div>' + '<%} %>' +
' <%} %>' + '<div class="questionset hidden">' +
' <div class="title"><%= title %></div>' + ' <div class="title"><%= title %></div>' +
' <% for (var i=0; i<questions.length; i++) { %>' + ' <% for (var i=0; i<questions.length; i++) { %>' +
' <div class="question-container" id="q-<%= i %>">' + ' <div class="question-container" id="q-<%= i %>">' +
' <div><%= questions[i].machineName %></div>' + ' <div><%= questions[i].machineName %></div>' +
' </div>' + ' </div>' +
' <% } %>' + ' <% } %>' +
' <div class="question-footer">' + ' <div class="qs-footer">' +
' <div class="progress">' + ' <div class="qs-progress">' +
' <% if (progressType == "dots") { %>' + ' <% if (progressType == "dots") { %>' +
' <div class="dots-container">' + ' <div class="dots-container">' +
' <% for (var i=0; i<questions.length; i++) { %>' + ' <% for (var i=0; i<questions.length; i++) { %>' +
@ -57,8 +57,8 @@ H5P.QuestionSet = function (options, contentId) {
'<div class="questionset-results">' + '<div class="questionset-results">' +
' <div class="greeting"><%= greeting %></div>' + ' <div class="greeting"><%= greeting %></div>' +
' <div class="score <%= scoreclass %>"><%= score %></div>' + ' <div class="score <%= scoreclass %>"><%= score %></div>' +
' <div class="resulttext"><%= resulttext %></div>' + ' <div class="resulttext <%= scoreclass %>"><%= resulttext %></div>' +
' <div><button class="qs-finishbutton"><%= finishButtonText %></button></div>' + ' <div class="buttons"><button class="qs-finishbutton"><%= finishButtonText %></button></div>' +
'</div>' + '</div>' +
''; '';
@ -199,6 +199,7 @@ H5P.QuestionSet = function (options, contentId) {
$('#qs-startbutton').click(function (ev) { $('#qs-startbutton').click(function (ev) {
$(this).parents('.intro-page').hide(); $(this).parents('.intro-page').hide();
$('.questionset', $myDom).removeClass('hidden');
}); });
// Set event listeners. // Set event listeners.
@ -222,6 +223,7 @@ H5P.QuestionSet = function (options, contentId) {
score: scoreString, score: scoreString,
passed: success passed: success
}; };
// Display result page. // Display result page.
if (params.endGame.showResultPage) { if (params.endGame.showResultPage) {
// Render result page into. // Render result page into.

View File

@ -3,7 +3,7 @@
"contentType": "question", "contentType": "question",
"majorVersion": 1, "majorVersion": 1,
"minorVersion": 0, "minorVersion": 0,
"patchVersion": 0, "patchVersion": 2,
"runnable": 1, "runnable": 1,
"machineName": "H5P.QuestionSet", "machineName": "H5P.QuestionSet",
"author": "Amendor AS", "author": "Amendor AS",

View File

@ -147,6 +147,16 @@
"type": "boolean", "type": "boolean",
"default": false "default": false
}, },
"successVideo": {
"label": "Success video",
"description": "Video displayed on successful quiz",
"type": "video"
},
"failVideo": {
"label": "Fail video",
"description": "Video displayed on failed quiz",
"type": "video"
},
"successResultAnimation": { "successResultAnimation": {
"label": "Result animation for success", "label": "Result animation for success",
"description": "Add animation for successful completion of the quiz", "description": "Add animation for successful completion of the quiz",

View File

@ -1,5 +0,0 @@
<div class="questionset-intro">
<div class="title"><%= title %></div>
<div class="introduction"><%= introduction %></div>
<div class="buttons"><button id="qs-startbutton"><%= startButtonText %></button></div>
</div>

View File

@ -1,6 +1,6 @@
<div class="questionset-results"> <div class="questionset-results">
<div class="greeting"><%= greeting %></div> <div class="greeting"><%= greeting %></div>
<div class="score <%= scoreclass %>"><%= score %></div> <div class="score <%= scoreclass %>"><%= score %></div>
<div class="resulttext"><%= resulttext %></div> <div class="resulttext <%= scoreclass %>"><%= resulttext %></div>
<div><button class="qs-finishbutton"><%= finishButtonText %></button></div> <div class="buttons"><button class="qs-finishbutton"><%= finishButtonText %></button></div>
</div> </div>

View File

@ -1,19 +1,19 @@
<div class="questionset"> <% if (introPage.showIntroPage) { %>
<% if (introPage.showIntroPage) { %> <div class="intro-page">
<div class="intro-page"> <div class="title"><%= introPage.title %></div>
<div class="title"><%= introPage.title %></div> <div class="introduction"><%= introPage.introduction %></div>
<div class="introduction"><%= introPage.introduction %></div> <div class="buttons"><button id="qs-startbutton"><%= introPage.startButtonText %></button></div>
<div class="buttons"><button id="qs-startbutton"><%= introPage.startButtonText %></button></div> </div>
</div> <%} %>
<%} %> <div class="questionset hidden">
<div class="title"><%= title %></div> <div class="title"><%= title %></div>
<% for (var i=0; i<questions.length; i++) { %> <% for (var i=0; i<questions.length; i++) { %>
<div class="question-container" id="q-<%= i %>"> <div class="question-container" id="q-<%= i %>">
<div><%= questions[i].machineName %></div> <div><%= questions[i].machineName %></div>
</div> </div>
<% } %> <% } %>
<div class="question-footer"> <div class="qs-footer">
<div class="progress"> <div class="qs-progress">
<% if (progressType == "dots") { %> <% if (progressType == "dots") { %>
<div class="dots-container"> <div class="dots-container">
<% for (var i=0; i<questions.length; i++) { %> <% for (var i=0; i<questions.length; i++) { %>