Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exp-lookit-instructions-video produces console error "Failed to compile frameSchemaProperties" #309

Open
becky-gilbert opened this issue Sep 27, 2022 · 0 comments · May be fixed by #328
Open

Comments

@becky-gilbert
Copy link
Contributor

becky-gilbert commented Sep 27, 2022

Describe the bug

The exp-lookit-instrucions-video frame produces the following console error:

"Failed to compile frameSchemaProperties to use for validating researcher usage of frame type ..."

This is caused by a capitalization error in the frame's frameSchemeProperties (type: 'Boolean' should be type: 'boolean'). Thus the frameplayer is unable to validate the study protocol because the frame schema is invalid. Printing more information about the validation error would help identify the same type of problem in the future.

Which frame or frames does it affect?

  • exp-lookit-instructions-video: requireWatchOrRead parameter

requireWatchOrRead: {
type: 'Boolean',
description: 'Whether to require that the participant watches the video (or reads the whole transcript) to move on',
default: true
},

There are at least two other frames that have capitalization errors in property specifications. However the errors in these two frames are in the data specification, rather than protocol parameters, so these frames do not produce console errors.

  • exp-lookit-change-detection: rightSequence and leftSequence data properties

leftSequence: {
type: 'Object'
},
/**
* Sequence of images shown on the right
* @attribute rightSequence
*/
rightSequence: {
type: 'Object'
},

  • exp-lookit-images-audio: correctImageSelected data property

correctImageSelected: {
type: 'Boolean'
},

To Reproduce

Create a study with the exp-lookit-instructions-video frame type and run the study with console open. You should see the above console error message.

Expected behavior

The exp-lookit-instructions-video frame should not produce this console error.
Also, if a frame's schema has not been specified correctly, the console error should provide more detail to make it easier to identify the relevant parameter(s) (see below).

Additional information

More information about the specific schema validation error(s) could be added to the console by printing the value of error in the catch block here:

var frameSchema = {type: 'object', properties: this.get('frameSchemaProperties')};
try {
var validate = ajv.compile(frameSchema);
var valid = validate(this);
if (!valid) {
console.warn('Invalid: ' + ajv.errorsText(validate.errors));
}
}
catch (error) {
console.error(`Failed to compile frameSchemaProperties to use for validating researcher usage of frame type '${this.get('kind')}.`);
}

Thanks to Alexander Maksiaev for reporting on slack 👍

@becky-gilbert becky-gilbert self-assigned this Sep 27, 2022
@Vantoine2019 Vantoine2019 linked a pull request Apr 12, 2023 that will close this issue
2 tasks
@becky-gilbert becky-gilbert linked a pull request Apr 13, 2023 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Tech Debt
Development

Successfully merging a pull request may close this issue.

1 participant