D26196: Add multiple dataset in guessnumber activity

Johnny Jazeix noreply at phabricator.kde.org
Sat Jan 4 20:28:21 GMT 2020


jjazeix added inline comments.

INLINE COMMENTS

> AnswerArea.qml:71
> +        if(userEntry == "")
> +            userEntryText.text = ""
>          if(userEntry != "")

why not keeping the binding?

> Guessnumber.qml:140
> +                    Rectangle {
> +                    id: suiteNumber
> +                    width: answerArea.width / 1.3

indentation

> Guessnumber.qml:152
> +                    }
> +                        GCText {
> +                            text: modelData

indentation

> guessnumber.js:47
>      items.numpad.resetText()
> -    switch(currentLevel) {
> -    case 0: items.currentMax = 20
> -            numberToGuess = getRandomInt(1,items.currentMax)
> -            break;
> -    case 1: items.currentMax = 40
> -            numberToGuess = getRandomInt(1,items.currentMax)
> -            break;
> -    case 2: items.currentMax = 60
> -            numberToGuess = getRandomInt(1,items.currentMax)
> -            break;
> -    case 3: items.currentMax = 100
> -            numberToGuess = getRandomInt(1,items.currentMax)
> -            break;
> -    case 4: items.currentMax = 500
> -            numberToGuess = getRandomInt(1,items.currentMax)
> -            break;
> -    case 5: items.currentMax = 1000
> -            numberToGuess = getRandomInt(1,items.currentMax)
> -            break;
> -    case 6: items.currentMax = 5000
> -            numberToGuess = getRandomInt(1,items.currentMax)
> -            break;
> -    case 7: items.currentMax = 10000
> -           numberToGuess = getRandomInt(1,items.currentMax)
> -           break;
> -    case 8: items.currentMax = 50000
> -            numberToGuess = getRandomInt(1,items.currentMax)
> -            break;
> -    }
> -    items.textArea.text = qsTr("Guess a number between 1 and %1").arg(items.currentMax);
> +    if(items.levels)
> +        numberToGuess = getRandomInt(1, items.levels[currentLevel].maxNumber)

there is no need to check it there, you already access it before so if it is undefined, it will "crash" before

> Data.qml:22
> +
> +import QtQuick 2.6
> +import GCompris 1.0

the imports of QtQuick and GCompris are not needed, you can remove them

REPOSITORY
  R2 GCompris

REVISION DETAIL
  https://phabricator.kde.org/D26196

To: sambhavkaul, #gcompris_improvements
Cc: jjazeix, echarruau, kde-edu, sanjayshetty, parimalprasoon, harrymecwan, ganeshredcobra, asagtani, nityanandkumar, andreask, rahulyadav, narvaez, scagarwal, apol, timotheegiet, bcoudoin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20200104/75ad3175/attachment-0001.html>


More information about the kde-edu mailing list