{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/sensei/issues/1931","repository_url":"https://api.github.com/repos/Automattic/sensei","labels_url":"https://api.github.com/repos/Automattic/sensei/issues/1931/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/sensei/issues/1931/comments","events_url":"https://api.github.com/repos/Automattic/sensei/issues/1931/events","html_url":"https://github.com/Automattic/sensei/pull/1931","id":263210969,"number":1931,"title":"Add warning on empty quiz response","user":{"login":"alexsanford","id":842193,"avatar_url":"https://avatars2.githubusercontent.com/u/842193?v=4","gravatar_id":"","url":"https://api.github.com/users/alexsanford","html_url":"https://github.com/alexsanford","followers_url":"https://api.github.com/users/alexsanford/followers","following_url":"https://api.github.com/users/alexsanford/following{/other_user}","gists_url":"https://api.github.com/users/alexsanford/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsanford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsanford/subscriptions","organizations_url":"https://api.github.com/users/alexsanford/orgs","repos_url":"https://api.github.com/users/alexsanford/repos","events_url":"https://api.github.com/users/alexsanford/events{/privacy}","received_events_url":"https://api.github.com/users/alexsanford/received_events","type":"User","site_admin":false},"labels":[{"id":310745125,"url":"https://api.github.com/repos/Automattic/sensei/labels/[Status]%20Needs%20Design%20Review","name":"[Status] Needs Design Review","color":"009800","default":false},{"id":242787783,"url":"https://api.github.com/repos/Automattic/sensei/labels/[Status]%20Needs%20Dev%20Review","name":"[Status] Needs Dev Review","color":"eb6420","default":false},{"id":24411079,"url":"https://api.github.com/repos/Automattic/sensei/labels/[Type]%20Enhancement","name":"[Type] Enhancement","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":{"login":"alexsanford","id":842193,"avatar_url":"https://avatars2.githubusercontent.com/u/842193?v=4","gravatar_id":"","url":"https://api.github.com/users/alexsanford","html_url":"https://github.com/alexsanford","followers_url":"https://api.github.com/users/alexsanford/followers","following_url":"https://api.github.com/users/alexsanford/following{/other_user}","gists_url":"https://api.github.com/users/alexsanford/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsanford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsanford/subscriptions","organizations_url":"https://api.github.com/users/alexsanford/orgs","repos_url":"https://api.github.com/users/alexsanford/repos","events_url":"https://api.github.com/users/alexsanford/events{/privacy}","received_events_url":"https://api.github.com/users/alexsanford/received_events","type":"User","site_admin":false},"assignees":[{"login":"alexsanford","id":842193,"avatar_url":"https://avatars2.githubusercontent.com/u/842193?v=4","gravatar_id":"","url":"https://api.github.com/users/alexsanford","html_url":"https://github.com/alexsanford","followers_url":"https://api.github.com/users/alexsanford/followers","following_url":"https://api.github.com/users/alexsanford/following{/other_user}","gists_url":"https://api.github.com/users/alexsanford/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsanford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsanford/subscriptions","organizations_url":"https://api.github.com/users/alexsanford/orgs","repos_url":"https://api.github.com/users/alexsanford/repos","events_url":"https://api.github.com/users/alexsanford/events{/privacy}","received_events_url":"https://api.github.com/users/alexsanford/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2017-10-05T17:48:41Z","updated_at":"2017-10-06T13:18:16Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/Automattic/sensei/pulls/1931","html_url":"https://github.com/Automattic/sensei/pull/1931","diff_url":"https://github.com/Automattic/sensei/pull/1931.diff","patch_url":"https://github.com/Automattic/sensei/pull/1931.patch"},"body":"Fixes #1718 \r\n\r\nAdds a new option to quizzes. When this option is enabled, users taking the quiz will see a warning if they have left any responses blank. They may still opt to submit the form with the blank responses.\r\n\r\n## Testing\r\n\r\n- Create a lesson with a quiz.\r\n- Check the box \"Warn user on empty response\".\r\n- Take the quiz. Leave some questions blank and ensure that the alert appears.\r\n- Ensure that \"Ok\" and \"Cancel\" in the alert behave as expected.\r\n- Test with all different question types (multi-line and file upload were particularly tricky, please test those on various browsers).\r\n- Turn the option off. Ensure that you can submit empty responses without seeing the alert.\r\n\r\n## Notes\r\n\r\n- This iteration will only warn the user. There is no option to actually prevent the user from submitting if there are empty responses.\r\n\r\n- We're just using a JS dialog here. I'm not sure that's what we want from a design perspective. Are there any modal dialogs that we use elsewhere on the frontend in Sensei? Alternatively I could just display a message right in the html. But I think the alert works for now.\r\n\r\n- I had to do a couple of hacky things in JS (no surprise there...) but I tried to make the code as clean as possible. Please feel free to call me out on anything nasty, and I can clean it up.\r\n\r\n- There are no tests for the JS functionality. @pgk I couldn't find any obvious existing JS tests. I'm assuming we don't have anything set up yet?\r\n\r\n- I set up gulp to do more JS minification, and updated the minified files across the board\r\n\r\n- The function `sensei_quiz_action_on_empty_response` is set up so that we could add other actions later (e.g. `error`)"},"comment":{"url":"https://api.github.com/repos/Automattic/sensei/issues/comments/334752013","html_url":"https://github.com/Automattic/sensei/pull/1931#issuecomment-334752013","issue_url":"https://api.github.com/repos/Automattic/sensei/issues/1931","id":334752013,"user":{"login":"donnapep","id":1190420,"avatar_url":"https://avatars2.githubusercontent.com/u/1190420?v=4","gravatar_id":"","url":"https://api.github.com/users/donnapep","html_url":"https://github.com/donnapep","followers_url":"https://api.github.com/users/donnapep/followers","following_url":"https://api.github.com/users/donnapep/following{/other_user}","gists_url":"https://api.github.com/users/donnapep/gists{/gist_id}","starred_url":"https://api.github.com/users/donnapep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donnapep/subscriptions","organizations_url":"https://api.github.com/users/donnapep/orgs","repos_url":"https://api.github.com/users/donnapep/repos","events_url":"https://api.github.com/users/donnapep/events{/privacy}","received_events_url":"https://api.github.com/users/donnapep/received_events","type":"User","site_admin":false},"created_at":"2017-10-06T13:18:16Z","updated_at":"2017-10-06T13:18:16Z","author_association":"CONTRIBUTOR","body":"> @donnapep http://cld.wthms.co/7zZVde\r\n\r\nThanks! Was looking for it at the question level. \r\n\r\n> We're just using a JS dialog here. I'm not sure that's what we want from a design perspective. Are there any modal dialogs that we use elsewhere on the frontend in Sensei? Alternatively I could just display a message right in the html. But I think the alert works for now.\r\n\r\nI agree. This is not very good UX. 😄 Ideally we would use a modal here. There are actually a fair number of places in Sensei that would benefit from having one. Given that would be a fairly large endeavour though, for the purposes of this change, showing an inline message sounds like an acceptable alternative. You could model it after this type of message that Sensei already has:\r\n\r\n![confirmation-message](https://user-images.githubusercontent.com/1190420/31279480-390651e6-aa77-11e7-932d-a3a97689cc80.jpg)"}}
{"actor":{"display_login":"donnapep"}}