The dataset has been added as mentioned here https://phabricator.kde.org/T12422
Details
- Reviewers
jjazeix - Group Reviewers
GCompris: Improvements - Maniphest Tasks
- T12422: Add multiple dataset in guessnumber activity
Diff Detail
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Hi,
Excellent work!
Just a point, in config display the menu are not exclusive, I can select option 1 and option 2. It could be good when I select option 2 that option 1 would be disabled.
Also I have an error message that was I think not there before
qrc:/gcompris/src/activities/guessnumber/AnswerArea.qml:69: TypeError: Cannot read property 'maxNumber' of undefined
Could you have a look please?
Also, let choose
MultipleData4: Recommended age: 9-10
max number 1 000 000.
Could you try to find a way to group numbers when you diplay them by three.
Exemple: 250 000 instead of 250000 which is too difficult to read even for an adult.
Emmanuel
Hi @echarruau ,
Made the following changes:
- config menu display updated
- error message removed
- Added spaces between group of 3 in display text using regex so that it is easily readable
Please see to it now.
Thanks
We added this possibility in the whole multiple dataset, it's to be able to select multiple levels. If you think on some activities they should be exclusive, let's discuss it in https://phabricator.kde.org/M146/541/
src/activities/guessnumber/AnswerArea.qml | ||
---|---|---|
71 | remove the added space at the end | |
src/activities/guessnumber/Guessnumber.qml | ||
173 | remove added space | |
src/activities/guessnumber/guessnumber.js | ||
71 | add a comment to specify what this line does, the name of the function is not relevant enough to understand what it does. Why not directly use the Qt function to do this (https://doc.qt.io/qt-5/qml-qtqml-number.html)? | |
src/activities/guessnumber/resource/1/Data.qml | ||
31 | is this attribute really useful? | |
32 | can you replace all of these with: //: first number is the minimum number and second the maximum number qsTr("Guess a number between %1 and %2").arg(1).arg(25)? This way, translators will only have one string to translate and this could avoid a lot of typo. What would be the best (but not sure if it works) would be to be able to use the minNumber/maxNumber directly, something like: qsTr("Guess a number between %1 and %2").arg(minNumber).arg(maxNumber) | |
56 | add a newline at the end of the file |
src/activities/guessnumber/guessnumber.js | ||
---|---|---|
71 | Hi @jjazeix , By using the Qt function it by default shows '0' in user entry text box at the beginning and the '0' gets overwrites when we type. So, there is always a zero at beginning. And it gives output with commas instead of spaces after a group of 3 digits. So if you allow should I go with the Qt function or let it be with the js function ? Thanks | |
src/activities/guessnumber/resource/1/Data.qml | ||
32 | Hi, @jjazeix Should I use qsTr("Guess a number between %1 and %2").arg(minNumber).arg(maxNumber) in js file as min and maxNumber can be accessed from there and also then there will be no use of objective and we can delete the objective attribute as well and instead of hard coding the values of max and min in data file it will be easier. Should I do this ? Thanks |
src/activities/guessnumber/guessnumber.js | ||
---|---|---|
71 | It gives comma because you are using a locale that uses commas as separator. It should use the same locale as GCompris. | |
src/activities/guessnumber/resource/1/Data.qml | ||
32 | No, the aim is to have the objectives in the Data.qml files by dataset directly. The final goal of multiple dataset will be to be able to directly load new datasets dynamically without having to compile again the application so we don't want them in the js directly. |
src/activities/guessnumber/guessnumber.js | ||
---|---|---|
46 | trailing spaces |
When starting the activity: qrc:/gcompris/src/activities/guessnumber/Guessnumber.qml:63: TypeError: Cannot read property 'data' of null
When changing level in configuration: qrc:/gcompris/src/activities/guessnumber/Guessnumber.qml:144: Error: Cannot assign to non-existent property "currentLevel"
Hi,
Updated the patch, following are the updates:
- Corrections as mentioned in comments are done
- Numerical suite has been added for multiple dataset 1, age 5 - 6
- The dataset has been updated as mention by @echarruau here https://phabricator.kde.org/T12422
Thanks
Please fix the following errors:
qrc:/gcompris/src/activities/guessnumber/Guessnumber.qml:65: TypeError: Cannot read property 'difficulty' of null
qrc:/gcompris/src/activities/guessnumber/Guessnumber.qml:64: TypeError: Cannot read property 'data' of null
qrc:/gcompris/src/activities/guessnumber/Guessnumber.qml:183: Error: Cannot assign to non-existent property "currentLevel"
src/activities/guessnumber/AnswerArea.qml | |||||||
---|---|---|---|---|---|---|---|
73 ↗ | (On Diff #72119) | you have to use the locale used in GCompris, not the one of the computer | |||||
src/activities/guessnumber/Guessnumber.qml | |||||||
65 ↗ | (On Diff #72119) | it's an integer so it's better to declare it as integer than var | |||||
129 ↗ | (On Diff #72119) | indentation | |||||
134 ↗ | (On Diff #72119) | It should be dependent on the dataset max value (and handle well the scale), not hardcoded.
| |||||
137 ↗ | (On Diff #72119) | this does not scale well (if you have a small screen, you don't see the last numbers) | |||||
145 ↗ | (On Diff #72119) | indentation | |||||
149 ↗ | (On Diff #72119) | indentation + use GCText for texts (to have the good font used) | |||||
src/activities/guessnumber/guessnumber.js | |||||||
48 ↗ | (On Diff #72119) | make the visibility of the item a variable of the dataset, we don't want hardcode depending on the dataset in the common code |
src/activities/guessnumber/Guessnumber.qml | ||
---|---|---|
134 ↗ | (On Diff #72119) | Suppose we have our first dataset as
So it should display only max number of displayed numbers means 10 in 1 - 10 level or numbers till 10 or 10 15 20 should be displayed on every level ? |
src/activities/guessnumber/Guessnumber.qml | ||
---|---|---|
134 ↗ | (On Diff #72119) | the max should be the maximum of the question, not the dataset (so 10, 15, 20 for your example). |
src/activities/guessnumber/Guessnumber.qml | ||
---|---|---|
134 ↗ | (On Diff #72119) | so 10 15 20 as in the example should be displayed on all the levels(i.e 3 levels for first dataset) ? But then what is the need of displaying these to every level ? allon suggested that the suite should contain numbers from which the child can take help. |
I have several problems.
- I can not see the numerical suite.
- When I choose "guess a number between 1 and 100" and "guess a number between 1 and 20", if I save it then go back to the settings, unselect "guess a number between 1 and 100", I still have the levels up to 100.
Hi,
I think the error problems is with the branch as mentioned here https://phabricator.kde.org/D26278. Other than that I have made the changes as suggested in comments.
- The numerical suite should be visible now but as for now it is hardcoded till number 20 for dataset 1. As Johnny was suggesting to put only max values , so further discussion in needed as mentioned here https://phabricator.kde.org/D26196#inline-147847
- Data has been updated as suggested
Thanks
src/activities/guessnumber/AnswerArea.qml | ||
---|---|---|
71 ↗ | (On Diff #72119) | why not keeping the binding? |
src/activities/guessnumber/Guessnumber.qml | ||
140 ↗ | (On Diff #72119) | indentation |
152 ↗ | (On Diff #72119) | indentation |
src/activities/guessnumber/guessnumber.js | ||
46–49 ↗ | (On Diff #72119) | there is no need to check it there, you already access it before so if it is undefined, it will "crash" before |
src/activities/guessnumber/resource/1/Data.qml | ||
23 ↗ | (On Diff #72119) | the imports of QtQuick and GCompris are not needed, you can remove them |
Hi, @jjazeix
I have made the changes as per the comments above.
Also please tell what should be added in numerical suite, the largest numbers of the level or the numbers from 1 to 20 as discussed here https://phabricator.kde.org/D26196#inline-147847 ?
Thanks
After discussion with @echarruau :
- can you do a first diff with only the dataset (just remove the numerical suite, keep the other features) that we can integrate directly. Having the separator on high numbers is a great addition.
- for the numerical suite, in a second time, instead of having it on one line, having the numbers on 2 lines (so 0 to 9 and 10 to 19) should be better. Centering it on the background should be enough to have all the numbers displayed. It is still not clear if we only have the numerical suite for the first level or if we will need adaptation for higher levels...
Thank you
src/activities/guessnumber/resource/3/Data.qml | ||
---|---|---|
26 ↗ | (On Diff #72119) | can you also put here qsTr("Guess a number between 1 and %1").arg(1000) and improve it so digits are also grouped by 3 depending on locale? This way we are coherent in both the questions and answers |
Hi, @jjazeix
I have updated the first diff as said without the numerical suite and made the changes mentioned in comment. Please see to it now. I will upload the second diff with numerical suite after this.
Thank you
src/activities/guessnumber/AnswerArea.qml | ||
---|---|---|
70 ↗ | (On Diff #72119) | There is still this thing that I'd like to be fixed. |
Tested, indeed last think to fix is the reset of the position of the helicopter.
Otherwise it works good.
Hi,
I have updated the diff with helico getting reset on every level. Please see to it now.
Thanks
Commited in https://commits.kde.org/gcompris/e4059da60a32cd61336af318eb1ed748c6f50b58
Thank you!