Commit 6dcdf2c4 authored by Johnny Jazeix's avatar Johnny Jazeix
Browse files

Display the good help. Shuffle the answers else the first one is always the good answer

parent f76fd1a0
...@@ -220,6 +220,11 @@ ActivityBase { ...@@ -220,6 +220,11 @@ ActivityBase {
source: imageFrame source: imageFrame
} }
DialogHelp {
id: dialogHelp
onClose: home()
}
Bar { Bar {
id: bar id: bar
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
.pragma library .pragma library
.import QtQuick 2.0 as Quick .import QtQuick 2.0 as Quick
.import GCompris 1.0 as GCompris .import GCompris 1.0 as GCompris
.import "qrc:/gcompris/src/core/core.js" as Core
var currentLevel = 0; var currentLevel = 0;
var currentSubLevel = 0; var currentSubLevel = 0;
...@@ -98,9 +99,11 @@ function initLevel() { ...@@ -98,9 +99,11 @@ function initLevel() {
// initialize sublevel // initialize sublevel
items.score.currentSubLevel = currentSubLevel + 1; items.score.currentSubLevel = currentSubLevel + 1;
items.wordListModel.clear(); items.wordListModel.clear();
items.wordListModel.append( {"word": qsTr(dataset[currentSubLevel].good)} ); // shuffle the words in the list so it is not always the first word to be the good one
for (var i = 0; i < dataset[currentSubLevel].bad.length; i++) var allWords = dataset[currentSubLevel].bad.slice().concat(dataset[currentSubLevel].good);
items.wordListModel.append( {"word": qsTr(dataset[currentSubLevel].bad[i])} ); Core.shuffle(allWords);
for (var i = 0; i < allWords.length; i++)
items.wordListModel.append( {"word": allWords[i] } );
items.wordImage.source = baseUrl + "/" + dataset[currentSubLevel].image; items.wordImage.source = baseUrl + "/" + dataset[currentSubLevel].image;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment