Skip to content

Commit

Permalink
Merge branch 'master' of github.com:h5p/h5p-question-set into HFP-574…
Browse files Browse the repository at this point in the history
…-remove-override-settings
  • Loading branch information
tajakobsen committed Jun 7, 2017
2 parents 45b00ff + b3887c0 commit df11efd
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 30 deletions.
12 changes: 0 additions & 12 deletions css/questionset.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
/* IcoMoon font licensed under the GNU General Public License: http://www.gnu.org/licenses/gpl.html */
@font-face {
font-family: 'icomoon-questionset';
src:url('../fonts/icomoon.eot');
src:url('../fonts/icomoon.eot?#iefix') format('embedded-opentype'),
url('../fonts/icomoon.woff') format('woff'),
url('../fonts/icomoon.ttf') format('truetype'),
url('../fonts/icomoon.svg#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}

.questionset-results h2 {
font-size: 1.2em;
font-weight: bold;
Expand Down
Binary file removed fonts/icomoon.eot
Binary file not shown.
14 changes: 0 additions & 14 deletions fonts/icomoon.svg

This file was deleted.

Binary file removed fonts/icomoon.ttf
Binary file not shown.
Binary file removed fonts/icomoon.woff
Binary file not shown.
23 changes: 22 additions & 1 deletion js/questionset.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ H5P.QuestionSet = function (options, contentId, contentData) {
' </div>' +
'</div>';

var solutionButtonTemplate = options.endGame.showSolutionButton ?
' <button type="button" class="h5p-joubelui-button h5p-button qs-solutionbutton"><%= solutionButtonText %></button>':
'';

var resulttemplate =
'<div class="questionset-results">' +
' <div class="greeting"><%= message %></div>' +
Expand All @@ -76,7 +80,7 @@ H5P.QuestionSet = function (options, contentId, contentData) {
' <% } %>' +
' <div class="buttons">' +
' <button type="button" class="h5p-joubelui-button h5p-button qs-finishbutton"><%= finishButtonText %></button>' +
' <button type="button" class="h5p-joubelui-button h5p-button qs-solutionbutton"><%= solutionButtonText %></button>' +
solutionButtonTemplate +
' <button type="button" class="h5p-joubelui-button h5p-button qs-retrybutton"><%= retryButtonText %></button>' +
' </div>' +
'</div>';
Expand Down Expand Up @@ -350,6 +354,8 @@ H5P.QuestionSet = function (options, contentId, contentData) {

currentQuestion = questionNumber;

handleAutoPlay(currentQuestion);

// Hide all questions
$('.question-container', $myDom).hide().eq(questionNumber).show();

Expand Down Expand Up @@ -400,6 +406,21 @@ H5P.QuestionSet = function (options, contentId, contentData) {
return currentQuestion;
};

/**
* Handle autoplays, limit to one at a time
*/
var handleAutoPlay = function (currentQuestion) {
for (var i = 0; i < questionInstances.length; i++) {
questionInstances[i].pause();
}

var hasAutoPlay = params.questions[currentQuestion].params.media.params.playback.autoplay;

if (hasAutoPlay) {
questionInstances[currentQuestion].play();
}
};

/**
* Show solutions for subcontent, and hide subcontent buttons.
* Used for contracts with integrated content.
Expand Down
3 changes: 3 additions & 0 deletions language/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
{
"label": "عرض النتائج"
},
{
"label": "Display solution button"
},
{
"label": "No results message",
"description": "Text displayed on end page when \"Display results\" is disabled",
Expand Down
3 changes: 3 additions & 0 deletions language/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@
{
"label": "Afficher les résultats"
},
{
"label": "Display solution button"
},
{
"label": "Message si pas de résultats",
"description": "Texte affiché sur la page finale si l'option \"Afficher les résultats\" est désactivée.",
Expand Down
3 changes: 3 additions & 0 deletions language/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
{
"label": "Visualizza risultati"
},
{
"label": "Display solution button"
},
{
"label": "No results message",
"description": "Text displayed on end page when \"Display results\" is disabled",
Expand Down
3 changes: 3 additions & 0 deletions language/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@
{
"label": "Vis resultater"
},
{
"label": "Vis resultatknapp"
},
{
"label": "Melding når resultater ikke vises",
"description": "Teksten vises på avslutnings-siden når resultater ikke vises",
Expand Down
3 changes: 3 additions & 0 deletions language/nn.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@
{
"label": "Vis resultat"
},
{
"label": "Vis resultatknapp"
},
{
"label": "Melding når resultater ikke vises",
"description": "Teksten vises på avslutnings-siden når resultater ikke vises",
Expand Down
4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"description": "Put together a set of different questions that has to be solved. (Quiz)",
"contentType": "question",
"majorVersion": 1,
"minorVersion": 12,
"patchVersion": 1,
"minorVersion": 13,
"patchVersion": 0,
"embedTypes": [
"iframe"
],
Expand Down
8 changes: 7 additions & 1 deletion semantics.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"description": "Library for this question.",
"options": [
"H5P.MultiChoice 1.9",
"H5P.DragQuestion 1.9",
"H5P.DragQuestion 1.10",
"H5P.Blanks 1.7",
"H5P.MarkTheWords 1.6",
"H5P.DragText 1.5",
Expand Down Expand Up @@ -255,6 +255,12 @@
"importance": "low",
"default": true
},
{
"name": "showSolutionButton",
"type": "boolean",
"label": "Display solution button",
"default": true
},
{
"name": "noResultMessage",
"type": "text",
Expand Down

0 comments on commit df11efd

Please sign in to comment.