mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-11 16:18:11 +00:00
Merge pull request #675 from hrcn/patch-2
initialize variable i in for loops
This commit is contained in:
commit
864093238b
@ -48,7 +48,7 @@ jsPsych.plugins['cloze'] = (function () {
|
||||
var elements = trial.text.split('%');
|
||||
var solutions = [];
|
||||
|
||||
for (i=0; i<elements.length; i++)
|
||||
for (var i=0; i<elements.length; i++)
|
||||
{
|
||||
if (i%2 === 0)
|
||||
{
|
||||
@ -69,7 +69,7 @@ jsPsych.plugins['cloze'] = (function () {
|
||||
var answers = [];
|
||||
var answers_correct = true;
|
||||
|
||||
for (i=0; i<solutions.length; i++)
|
||||
for (var i=0; i<solutions.length; i++)
|
||||
{
|
||||
var field = document.getElementById('input'+i);
|
||||
answers.push(field.value.trim());
|
||||
@ -109,4 +109,4 @@ jsPsych.plugins['cloze'] = (function () {
|
||||
};
|
||||
|
||||
return plugin;
|
||||
})();
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user