Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GCompris
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
27
Issues
27
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Education
GCompris
Commits
1b05b48a
Commit
1b05b48a
authored
Jul 29, 2020
by
Timothée Giet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
learn_digits, add ReadyButton on start to give time for some intro voice
parent
9ab05730
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
7 deletions
+36
-7
src/activities/learn_digits/Learn_digits.qml
src/activities/learn_digits/Learn_digits.qml
+30
-6
src/activities/learn_digits/learn_digits.js
src/activities/learn_digits/learn_digits.js
+6
-1
No files found.
src/activities/learn_digits/Learn_digits.qml
View file @
1b05b48a
...
...
@@ -63,6 +63,7 @@ ActivityBase {
property
alias
circlesLine
:
circlesLine
property
alias
fileId
:
fileId
property
alias
locale
:
background
.
locale
property
alias
iAmReady
:
iAmReady
property
int
currentSubLevel
:
0
property
int
nbSubLevel
property
int
answer
:
0
...
...
@@ -76,14 +77,28 @@ ActivityBase {
property
bool
isHorizontal
:
layoutArea
.
width
>=
layoutArea
.
height
onStart
:
{
if
(
!
DownloadManager
.
areVoicesRegistered
())
{
repeatItem
.
visible
=
false
;
repeatItem
.
enabled
=
false
;
}
Activity
.
start
(
items
)
}
onStop
:
{
Activity
.
stop
()
}
function
itemsVisible
()
{
iAmReady
.
visible
=
false
;
if
(
DownloadManager
.
areVoicesRegistered
())
{
repeatItem
.
visible
=
true
;
}
questionText
.
visible
=
true
;
scoreArea
.
visible
=
true
;
circlesBackground
.
visible
=
true
;
circlesArea
.
visible
=
true
;
Activity
.
initQuestion
();
items
.
inputLocked
=
false
;
}
ReadyButton
{
id
:
iAmReady
onClicked
:
background
.
itemsVisible
();
}
Item
{
id
:
layoutArea
anchors.top
:
parent
.
top
...
...
@@ -107,12 +122,14 @@ ActivityBase {
BarButton
{
id
:
repeatItem
visible
:
false
source
:
"
qrc:/gcompris/src/core/resource/bar_repeat.svg
"
sourceSize.width
:
repeatArea
.
height
>
repeatArea
.
width
?
repeatArea
.
width
*
0.6
:
repeatArea
.
height
*
0.6
anchors.centerIn
:
repeatArea
onClicked
:{
Activity
.
playLetter
(
items
.
question
.
toString
());
if
(
!
items
.
inputLocked
)
Activity
.
playLetter
(
items
.
question
.
toString
());
}
}
...
...
@@ -122,6 +139,7 @@ ActivityBase {
}
GCText
{
id
:
questionText
visible
:
false
width
:
textArea
.
width
height
:
textArea
.
height
anchors.centerIn
:
textArea
...
...
@@ -140,6 +158,7 @@ ActivityBase {
id
:
scoreArea
width
:
textArea
.
width
height
:
textArea
.
height
visible
:
false
property
int
scoreItemsSize
:
10
Score
{
id
:
score
...
...
@@ -161,7 +180,10 @@ ActivityBase {
sourceSize.height
:
height
sourceSize.width
:
height
enabled
:
!
items
.
inputLocked
onClicked
:
Activity
.
checkAnswer
();
onClicked
:
{
if
(
!
items
.
inputLocked
)
Activity
.
checkAnswer
();
}
}
states
:
[
State
{
...
...
@@ -213,6 +235,7 @@ ActivityBase {
Rectangle
{
id
:
circlesBackground
visible
:
false
color
:
"
#D0FFFFFF
"
anchors.bottom
:
layoutArea
.
bottom
anchors.right
:
layoutArea
.
right
...
...
@@ -221,6 +244,7 @@ ActivityBase {
}
Item
{
id
:
circlesArea
visible
:
false
property
int
itemWidth
:
10
//temp values overriden with states
width
:
10
height
:
10
...
...
src/activities/learn_digits/learn_digits.js
View file @
1b05b48a
...
...
@@ -52,7 +52,8 @@ function initLevel() {
items
.
circlesModel
=
items
.
levels
[
currentLevel
].
circlesModel
;
items
.
currentSubLevel
=
0
;
items
.
nbSubLevel
=
questionsArray
.
length
;
initQuestion
();
if
(
!
items
.
iAmReady
.
visible
)
initQuestion
();
if
(
items
.
selectedCircle
>=
0
)
items
.
selectedCircle
=
0
;
}
...
...
@@ -128,6 +129,10 @@ function stopVoice() {
function
processKey
(
event
)
{
if
(
items
.
inputLocked
)
return
;
if
(
items
.
iAmReady
.
visible
)
{
items
.
iAmReady
.
clicked
();
return
;
}
if
(
event
.
key
===
Qt
.
Key_Right
||
event
.
key
===
Qt
.
Key_Down
)
{
if
(
items
.
selectedCircle
<
items
.
circlesModel
-
1
)
++
items
.
selectedCircle
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment