Commit 4b67a6ed authored by Bruno Coudoin's avatar Bruno Coudoin
Browse files

missing letter, add voice play of the selected letter

parent 6f6476a6
......@@ -59,6 +59,7 @@ ActivityBase
property alias questionText: questionText
property alias answers: answers
property alias currentQuestionNumberText : currentQuestionNumberText
property GCAudio audioVoices: activity.audioVoices
}
onStart: { Activity.start(items) }
......@@ -87,7 +88,10 @@ ActivityBase
textLabel: modelData
isCorrectAnswer: modelData === Activity.getCorrectAnswer()
onCorrectlyPressed: Activity.answerPressed(modelData)
onPressed: if(modelData === Activity.getCorrectAnswer()) Activity.showAnswer()
onPressed: {
Activity.playLetter(modelData)
if(modelData === Activity.getCorrectAnswer()) Activity.showAnswer()
}
}
}
}
......
......@@ -22,6 +22,7 @@
.pragma library
.import QtQuick 2.0 as Quick
.import "qrc:/gcompris/src/core/core.js" as Core
.import GCompris 1.0 as GCompris //for ApplicationInfo
var url = "qrc:/gcompris/src/activities/missing-letter/resource/"
......@@ -250,3 +251,8 @@ function createLastLevel()
questions.push(lastData)
}
function playLetter(letter) {
items.audioVoices.append(GCompris.ApplicationInfo.getAudioFilePath("voices/$LOCALE/alphabet/"
+ Core.getSoundFilenamForChar(letter)))
}
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