<table><tr><td style="">jjazeix added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D26196">View Revision</a></tr></table><br /><div><div><p>Please fix the following errors:<br />
qrc:/gcompris/src/activities/guessnumber/Guessnumber.qml:65: TypeError: Cannot read property 'difficulty' of null<br />
qrc:/gcompris/src/activities/guessnumber/Guessnumber.qml:64: TypeError: Cannot read property 'data' of null<br />
qrc:/gcompris/src/activities/guessnumber/Guessnumber.qml:183: Error: Cannot assign to non-existent property "currentLevel"</p></div></div><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D26196#inline-147832">View Inline</a><span style="color: #4b4d51; font-weight: bold;">AnswerArea.qml:73</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #aa4000">if</span><span class="p">(</span><span style="color: #004012">userEntry</span> <span style="color: #aa2211">!=</span> <span style="color: #766510">""</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #004012">userEntryText</span><span class="p">.</span><span style="color: #004012">text</span> <span style="color: #aa2211">=</span> <span style="color: #304a96">Number</span><span class="p">(</span><span style="color: #004012">answerBackground</span><span class="p">.</span><span style="color: #004012">userEntry</span><span class="p">).</span><span style="color: #004012">toLocaleString</span><span class="p">(</span><span style="color: #004012">Qt</span><span class="p">.</span><span style="color: #004012">locale</span><span class="p">(),</span> <span style="color: #766510">'f'</span><span class="p">,</span> <span style="color: #601200">0</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #004012">Activity</span><span class="p">.</span><span style="color: #004012">setUserAnswer</span><span class="p">(</span><span style="color: #304a96">parseInt</span><span class="p">(</span><span style="color: #004012">userEntry</span><span class="p">))</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">you have to use the locale used in GCompris, not the one of the computer</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D26196#inline-147833">View Inline</a><span style="color: #4b4d51; font-weight: bold;">Guessnumber.qml:65</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #004012">property</span> <span style="color: #aa4000">var</span> <span style="color: #aa4000">levels:</span> <span style="color: #004012">activity</span><span class="p">.</span><span style="color: #004012">datasetLoader</span><span class="p">.</span><span style="color: #004012">item</span><span class="p">.</span><span style="color: #004012">data</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #004012">property</span> <span style="color: #aa4000">var</span> <span style="color: #aa4000">difficulty:</span> <span style="color: #004012">activity</span><span class="p">.</span><span style="color: #004012">datasetLoader</span><span class="p">.</span><span style="color: #004012">item</span><span class="p">.</span><span style="color: #004012">difficulty</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #004012">property</span> <span style="color: #304a96">int</span> <span style="color: #aa4000">currentMax:</span> <span style="color: #601200">0</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">it's an integer so it's better to declare it as integer than var</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D26196#inline-147834">View Inline</a><span style="color: #4b4d51; font-weight: bold;">Guessnumber.qml:129</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">topMargin:</span> <span style="color: #601200">20</span> <span style="color: #aa2211">+</span> <span style="color: #004012">textArea</span><span class="p">.</span><span style="color: #004012">contentHeight</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="p">}</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">visible:</span> <span style="color: #000a65">false</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">indentation</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D26196#inline-147835">View Inline</a><span style="color: #4b4d51; font-weight: bold;">Guessnumber.qml:134</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">id: repeatNumbers</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">model:</span> <span class="p">[</span><span style="color: #766510">"1"</span><span class="p">,</span> <span style="color: #766510">"2"</span><span class="p">,</span> <span style="color: #766510">"3"</span><span class="p">,</span> <span style="color: #766510">"4"</span><span class="p">,</span> <span style="color: #766510">"5"</span><span class="p">,</span> <span style="color: #766510">"6"</span><span class="p">,</span> <span style="color: #766510">"7"</span><span class="p">,</span> <span style="color: #766510">"8"</span><span class="p">,</span> <span style="color: #766510">"9"</span><span class="p">,</span> <span style="color: #766510">"10"</span><span class="p">,</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #766510">"11"</span><span class="p">,</span> <span style="color: #766510">"12"</span><span class="p">,</span> <span style="color: #766510">"13"</span><span class="p">,</span> <span style="color: #766510">"14"</span><span class="p">,</span> <span style="color: #766510">"15"</span><span class="p">,</span> <span style="color: #766510">"16"</span><span class="p">,</span> <span style="color: #766510">"17"</span><span class="p">,</span> <span style="color: #766510">"18"</span><span class="p">,</span> <span style="color: #766510">"19"</span><span class="p">,</span> <span style="color: #766510">"20"</span><span class="p">]</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">It should be dependent on the dataset max value (and handle well the scale), not hardcoded.<br />
Maybe it would be nice to only have a max number of displayed values (5 or 10) and round, for example for first dataset, and the plane moves accordingly:</p>
<div class="remarkup-table-wrap"><table style="border-collapse: separate;
border-spacing: 1px;
background: #d3d3d3;
margin: 12px 0;">
<tr><td style="background: #ffffff;
padding: 3px 6px;">0</td><td style="background: #ffffff;
padding: 3px 6px;">5</td><td style="background: #ffffff;
padding: 3px 6px;">10</td><td style="background: #ffffff;
padding: 3px 6px;">15</td><td style="background: #ffffff;
padding: 3px 6px;">20</td></tr>
</table></div></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D26196#inline-147837">View Inline</a><span style="color: #4b4d51; font-weight: bold;">Guessnumber.qml:137</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #004012">Rectangle</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">id: suiteNumber</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">width:</span> <span style="color: #601200">80</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">this does not scale well (if you have a small screen, you don't see the last numbers)</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D26196#inline-147838">View Inline</a><span style="color: #4b4d51; font-weight: bold;">Guessnumber.qml:145</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">gradient:</span> <span style="color: #004012">Gradient</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #004012">GradientStop</span> <span class="p">{</span> <span style="color: #aa4000">position:</span> <span style="color: #601200">0.0</span><span class="p">;</span> <span style="color: #aa4000">color:</span> <span style="color: #766510">"#CCFFFFFF"</span> <span class="p">}</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #004012">GradientStop</span> <span class="p">{</span> <span style="color: #aa4000">position:</span> <span style="color: #601200">0.5</span><span class="p">;</span> <span style="color: #aa4000">color:</span> <span style="color: #766510">"#80FFFFFF"</span> <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">indentation</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D26196#inline-147836">View Inline</a><span style="color: #4b4d51; font-weight: bold;">Guessnumber.qml:149</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="p">}</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #004012">Text</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">text:</span> <span style="color: #004012">modelData</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">indentation + use GCText for texts (to have the good font used)</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D26196#inline-147839">View Inline</a><span style="color: #4b4d51; font-weight: bold;">guessnumber.js:49</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span class="bright"></span><span style="color: #aa4000"><span class="bright">case</span></span><span class="bright"> </span><span style="color: #601200"><span class="bright">0</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">:</span></span> <span style="color: #004012">items</span><span class="p">.</span><span style="color: #004012">current<span class="bright">Max</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">=</span></span><span class="bright"> </span><span style="color: #601200"><span class="bright">20</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span class="bright"> </span><span style="color: #004012"><span class="bright">numberToGuess</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">=</span></span><span class="bright"> </span><span style="color: #004012"><span class="bright">getRandomInt</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #601200"><span class="bright">1</span></span><span class="bright"></span><span class="p"><span class="bright">,</span></span><span style="color: #004012">items</span><span class="p">.<span class="bright"></span></span><span class="bright"></span><span style="color: #004012"><span class="bright">currentMax</span></span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span class="bright"> </span><span style="color: #aa4000"><span class="bright">break</span></span><span class="bright"></span><span class="p"><span class="bright">;</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="bright"> </span><span style="color: #004012"><span class="bright">numberToGuess</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">=</span></span><span class="bright"> </span><span style="color: #004012"><span class="bright">getRandomInt</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #601200"><span class="bright">1</span></span><span class="bright"></span><span class="p"><span class="bright">,</span></span> <span style="color: #004012">items</span><span class="p">.<span class="bright"></span></span><span class="bright"></span><span style="color: #004012"><span class="bright">levels</span></span><span class="bright"></span><span class="p"><span class="bright">[</span></span><span style="color: #004012">current<span class="bright">Level</span></span><span class="bright"></span><span class="p"><span class="bright">].</span></span><span class="bright"></span><span style="color: #004012"><span class="bright">maxNumber</span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="bright"></span><span style="color: #aa4000"><span class="bright">if</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span style="color: #004012">items</span><span class="p">.<span class="bright"></span></span><span class="bright"></span><span style="color: #004012"><span class="bright">difficulty</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">==</span></span><span class="bright"> </span><span style="color: #601200"><span class="bright">1</span></span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="bright"></span><span style="color: #aa4000"><span class="bright">if</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #004012"><span class="bright">currentLevel</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">==</span></span><span class="bright"> </span><span style="color: #601200"><span class="bright">0</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">||</span></span><span class="bright"> </span><span style="color: #004012"><span class="bright">currentLevel</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">==</span></span><span class="bright"> </span><span style="color: #601200"><span class="bright">2</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">||</span></span><span class="bright"> </span><span style="color: #004012"><span class="bright">currentLevel</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">==</span></span><span class="bright"> </span><span style="color: #601200"><span class="bright">4</span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">make the visibility of the item a variable of the dataset, we don't want hardcode depending on the dataset in the common code</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R2 GCompris</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D26196">https://phabricator.kde.org/D26196</a></div></div><br /><div><strong>To: </strong>sambhavkaul, GCompris: Improvements<br /><strong>Cc: </strong>jjazeix, echarruau, kde-edu, sanjayshetty, parimalprasoon, harrymecwan, ganeshredcobra, asagtani, nityanandkumar, andreask, rahulyadav, narvaez, scagarwal, apol, timotheegiet, bcoudoin<br /></div>