expandorg / worker-app

worker application
https://portal.expand.org/
Mozilla Public License 2.0
2 stars 0 forks source link

Can't pass rules for trivia task #242

Closed kieranoreilly closed 5 years ago

kieranoreilly commented 5 years ago

Users can't get past the rules screen here https://portal.expand.org/jobs/4 The console error is:

formValidationRules.js:26 Uncaught TypeError: t.reduce is not a function
    at e (formValidationRules.js:26)
    at formValidationRules.js:39
    at Array.reduce (<anonymous>)
    at e (formValidationRules.js:26)
    at Form.js:100
    at Object.<anonymous> (react-dom.production.min.js:14)
    at p (react-dom.production.min.js:15)
    at react-dom.production.min.js:15
    at P (react-dom.production.min.js:17)
    at j (react-dom.production.min.js:18)
kieranoreilly commented 5 years ago

this is the form:

{"modules": [{"name": "article", "type": "richText", "content": "<h1>Rules</h1>In beginning to this task you agree to the rules, terms and conditions, and privacy policy below."}, {"name": "rules", "type": "agreement", "label": "I agree", "button": "Rules", "modules": {"name": "content", "type": "richText", "content": "<h1>Rules</h1><h2>By starting this task you agree to:</h2><ul> <li> Read and understand all task instructions </li> <li>Do not submit math questions</li><li>Each answer choice must be plausible</li><li>Do not submit riddles</li><li>All questions must be fact checked</li><li>Questions should be significantly difficult. (Questions like who is the first president of the united states will not count)</li> <li>Do not submit the same trivia question more than once</li><li>Questions can be of any category</li><li> <a href='https://gems.org/tos.pdf' target='_blank'> Gems Terms of Service </a></li><li> <a href='https://gems.org/privacy.pdf' target='_blank'> Gems Privacy Policy </a></li></ul>"}, "validation": {"isTrue": true}}, {"name": "submit", "type": "submit", "caption": "Next"}]}
kieranoreilly commented 5 years ago

Fixed! Form had to change to:

{"modules": [{"name": "article", "type": "richText", "content": "<h1>Rules</h1>In beginning to this task you agree to the rules, terms and conditions, and privacy policy below."}, {"name": "rules", "type": "agreement", "label": "I agree", "button": "Rules", "modules": [{"name": "content", "type": "richText", "content": "<h1>Rules</h1><h2>By starting this task you agree to:</h2><ul> <li> Read and understand all task instructions </li> <li>Do not submit math questions</li><li>Each answer choice must be plausible</li><li>Do not submit riddles</li><li>All questions must be fact checked</li><li>Questions should be significantly difficult. (Questions like who is the first president of the united states will not count)</li> <li>Do not submit the same trivia question more than once</li><li>Questions can be of any category</li><li> <a href='https://gems.org/tos.pdf' target='_blank'> Gems Terms of Service </a></li><li> <a href='https://gems.org/privacy.pdf' target='_blank'> Gems Privacy Policy </a></li></ul>"}], "validation": {"isTrue": true}}, {"name": "submit", "type": "submit", "caption": "Next"}]}