handle size of datas
This commit is contained in:
parent
4c7737c531
commit
221bc4a1c4
1 changed files with 4 additions and 1 deletions
|
|
@ -6,6 +6,7 @@
|
|||
let iNb = 0;
|
||||
let ok = false;
|
||||
let hw = null;
|
||||
let datas_length = 0;
|
||||
|
||||
function init(options = {}) {
|
||||
displayChallenge(
|
||||
|
|
@ -14,6 +15,8 @@
|
|||
options.datas[iNb].pinyin
|
||||
);
|
||||
|
||||
datas_length = options.datas.length;
|
||||
|
||||
// Initialisation du writer
|
||||
hw = initHW(
|
||||
options.canvasID,
|
||||
|
|
@ -42,7 +45,7 @@
|
|||
// success
|
||||
iNb++;
|
||||
|
||||
if (iNb > 9) {
|
||||
if (iNb >= datas_length) {
|
||||
document.getElementById(options.feedbackID).textContent = "Fini !";
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue