Added datasets, follow same pattern as for smallnumbers in https://phabricator.kde.org/T12390
Details
- Reviewers
echarruau jjazeix - Group Reviewers
GCompris: Improvements - Maniphest Tasks
- T12454: Improve multipledataset in smallnumber2
apply diff from adc807115b1a83c13a2968e9f42d201253cca6e1 (origin/multiple_dataset)
Diff Detail
- Repository
- R2 GCompris
- Branch
- smallnumbers2_multidataset
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 20848 Build 20866: arc lint + arc unit
Please use a hard copy of the data you want to modify to solve the problems you have. Be careful to not break gletters.
src/activities/gletters/gletters.js | ||
---|---|---|
35 | as seen in our discussion you do not need this value | |
131 | Here you are modifying the source itself, this means that next time you come back to a level you already did you will have the concatenation in the data presented and not what is in the json file. | |
156โ157 | why is this diff here? |
src/activities/gletters/gletters.js | ||
---|---|---|
129 | it creates new variable, which is a hard copy not a reference,as we discussed. | |
131 | this line will concatenate levelData to itself thrice, so we will get each copy of dominoes three times. | |
132 | this will restrict the number of dominoes in each level to 15. | |
151 | in line 137,156,159,167,170,171,178 just replaced the level.words with new variable levelData as we have to do every operation using this concatenated variable. | |
156โ157 | The previous code is treating all letters like a alphabets, and sometimes enabling shift even for digits. i have just added isDigit variable in if condition to ensure not to enable shift because of digit. counter case here is if levelData=[3,3]. the previous code will enable shift for this array. | |
192 | in previous code,function initRandomWord(currentLevel + 1) shuffles the items.word, here we have to take care to do every operation with levelData. i checked the defination of this function and generated the random list by shyuffling levelData. |
Sorry forgot to submit my comments yesterday. Here are then my comments.
src/activities/gletters/gletters.js | ||
---|---|---|
131 | we said yesterday that it does not work. If you have 1 data at the beginning you don't obtain 15 data. We said you need to create an array containing 15 data randomly taken from the available data. | |
132 | See previous comment. | |
151 | Good, did you make sure it does not breack gletters? It should not but please check. | |
192 | Not sure we need this since you will create our own random list, but here we may have a problem keeping gletters working. |
can i go with this way?
src/activities/gletters/gletters.js | ||
---|---|---|
131 | do i have to make data set of 15 for each level regardless of initial data size as current approach is only increasing it size three times? can i use a loop here which randomly pick a element from level.words 15 times and push it into levelData variable. | |
151 | i test it by playing all falling * activities and even sure with code changes which i have done, is there any more formal way to check? | |
192 | levelData is already shuffled, and we can't use initRandomWord function for smallumbers2 as it will shuffle level.words, so i can make changes like this? - if(items.ourActivity.activityName !== "smallnumbers2"){ items.wordlist.initRandomWord(currentLevel + 1) else items.wordlist.randomWordList = levelData |
See new comments about data choice algorithme.
src/activities/gletters/gletters.js | ||
---|---|---|
131 | we need to have a dataset made from data given in levelswords. The data should be randomly chosen but still have abotu equally distributed. | |
192 | I need to investigate this one furthut is is not clear to me :( |
Please build the mecanism which creates the data to be given to the user, it will solve most of our problems. Good luck :)
src/activities/gletters/gletters.js | ||
---|---|---|
192 | At the present moment this discussion is not necessary anymore as our current problem will be soved once you will have created your input data array containing the data to give to the user. |
sorry for delay, everything is working fine now, i have added sublevels size inside json and added setLevelData() and addNewElement() functions to create data. i have also tried to describe everything in comments and tested other activities too, they are not affected by this change.
commented on maxsublevel which is not self explanable variable name.
src/activities/gletters/gletters.js | ||
---|---|---|
132 | Here can you have a detailed comment to explain what maxSubLevel is used for. Something to say that it gives the number of falling elements presented for each level. ? |
src/activities/gletters/gletters.js | ||
---|---|---|
132 | Yes, maxSubLevel stores the number of dominoes to fall down in each level, in previous code it is equals to level.words.length but this time i added attribute sublevels in json to pass it a value. |
see my comment about comment :)
src/activities/gletters/gletters.js | ||
---|---|---|
132 | I mean a comment in the code, not for me :) |
src/activities/gletters/gletters.js | ||
---|---|---|
132 | it would be better to have an attribute named useDataset in the Activity.qml that is set to true for smallnumbers and smallnumbers2. |
Hi,
I tested it looked at the code and this is for me ready to be merged. Well done!
Emmanuel