1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-12 08:38:10 +00:00

Merge pull request #326 from RebeccaHirst/_addformComplete

add formComplete method (code cleanup)
This commit is contained in:
Sotiri Bakagiannis 2021-05-10 11:58:19 +01:00 committed by GitHub
commit 2d299c7730
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -329,9 +329,20 @@ export class Form extends util.mix(VisualStim).with(ColorMixin)
// return a copy of this._items: // return a copy of this._items:
return this._items.map(item => Object.assign({}, item)); return this._items.map(item => Object.assign({}, item));
} }
/**
* Check if the form is complete.
*
* @name module:visual.Form#formComplete
* @function
* @public
* @return {boolean} - whether there are any remaining incomplete responses.
*/
formComplete()
{
//same as complete but might be used by some experiments before 2020.2
this.getData();
return this._items._complete;
}
/** /**
* Add the form data to the given experiment. * Add the form data to the given experiment.
* *