multiplication_tables_sok_schoolMode completed
Needs ReviewPublic

Authored by nitish on Mar 9 2017, 4:43 AM.

Details

Summary

School mode is the mode where user can select the questions to be asked to the students from the settings window.
In the setting window, all questions from the dataset will be displayed in form of check boxes. The ones which will be selected will be displayed in the question grid on main screen.
Apart from that some minor code refracting & cleanup is done.
please share your feedback.

Diff Detail

Repository
R2 GCompris
Lint
Lint Skipped
Unit
Unit Tests Skipped
nitish created this revision.Mar 9 2017, 4:43 AM
jjazeix edited edge metadata.Mar 13 2017, 2:40 PM

Really quick review, I didn't test it yet and the review is only on this commit, not the whole activity

src/activities/multiplication_tables/Multiplication_tables.qml
74

I'm not sure but didn't we say we don't name then "normal" and "school" mode?

173

remove trailing spaces

299

indentation

src/activities/multiplication_tables/multiplication_tables.js
118

concat?

nitish marked an inline comment as done.Mar 15 2017, 7:01 PM

There is no mode by default:
property string modeType: modeType is empty when you don't have any configuration at first run, you need to initialize it to "normal".

The screen resizing is not handled at all (on both activity and config).
Don't set a fixed value for the model, it should depend on the dataset

str1, verifyAnswer2 are not explicit names.

Question.qml misses copyright and author.

In English, there is no dash (-) after colon (:)
qsTr(question[i]) will never work, the " =" should be part of the question (dataset).

javascript has functions avoiding to have to do loops manually to append arrays.

verifyAnswer is the same as verifyAnswer2, you can factorize the code. Also, use a temp var to store items.repeater.itemAt(j). You can remove the "items.repeater.itemAt(j).answerText.toString() != answer2[j]" in the "else if", you already kow it's different.

almost the same for canAnswer/cannotAnswer.

The virtual keyboard is not displayed, the processKeyEvent won' work (copied pasted from another activity without any change)

on resetValue, you reset a lot of time:

scoreCounter = 0
items.score.visible = false

some variables are unused (schoolMode in the js, data in items), I haven't checked all

thank you @jjazeix , I'll make the changes & improvements you mentioned.