{"action":"created","issue":{"url":"https://api.github.com/repos/marcusgreen/moodle-qtype_gapfill/issues/33","repository_url":"https://api.github.com/repos/marcusgreen/moodle-qtype_gapfill","labels_url":"https://api.github.com/repos/marcusgreen/moodle-qtype_gapfill/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/marcusgreen/moodle-qtype_gapfill/issues/33/comments","events_url":"https://api.github.com/repos/marcusgreen/moodle-qtype_gapfill/issues/33/events","html_url":"https://github.com/marcusgreen/moodle-qtype_gapfill/issues/33","id":295152468,"number":33,"title":"Still problems with spaces and selects","user":{"login":"thepurpleblob","id":664139,"avatar_url":"https://avatars3.githubusercontent.com/u/664139?v=4","gravatar_id":"","url":"https://api.github.com/users/thepurpleblob","html_url":"https://github.com/thepurpleblob","followers_url":"https://api.github.com/users/thepurpleblob/followers","following_url":"https://api.github.com/users/thepurpleblob/following{/other_user}","gists_url":"https://api.github.com/users/thepurpleblob/gists{/gist_id}","starred_url":"https://api.github.com/users/thepurpleblob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thepurpleblob/subscriptions","organizations_url":"https://api.github.com/users/thepurpleblob/orgs","repos_url":"https://api.github.com/users/thepurpleblob/repos","events_url":"https://api.github.com/users/thepurpleblob/events{/privacy}","received_events_url":"https://api.github.com/users/thepurpleblob/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-07T14:14:25Z","updated_at":"2018-02-07T15:17:07Z","closed_at":null,"author_association":"NONE","body":"This is not (yet anyway) a fully formed report but you might have some ideas. As happened before with wrong answers and drop-down selects (https://github.com/marcusgreen/moodle-qtype_gapfill/issues/24), the 'selected' link is missing for right answers (sometimes!) such that the answer display shows no answer in the dropdown. \r\n\r\nDumping the variables just before the answer select is displayed shows this. \r\n\r\narray(7) {\r\n  [\" COCA\"]=>\r\n  string(5) \" COCA\"\r\n  [\" Hansard\"]=>\r\n  string(8) \" Hansard\"\r\n  [\" Time\"]=>\r\n  string(5) \" Time\"\r\n  [\" GloWbE\"]=>\r\n  string(7) \" GloWbE\"\r\n  [\"NOW\"]=>\r\n  string(3) \"NOW\"\r\n  [\" SCOTS\"]=>\r\n  string(6) \" SCOTS\"\r\n  [\" EEBO\"]=>\r\n  string(6) \" EEBO\"\r\n}\r\nstring(6) \"GloWbE\"\r\n\r\nWhere the first array is $selectoptions (the possible answers) and the second string the $currentanswer. As can be seen there are extra spaces stopping a match being made in html_writer::select (in renderer.php). \r\n\r\nThe odd thing is the question definition...\r\n\r\n![screen shot 2018-02-07 at 14 12 37](https://user-images.githubusercontent.com/664139/35920868-055978e0-0c11-11e8-8edf-ca69e28c1eea.png)\r\n\r\nSo, while there are some spaces in the distractors there isn't in the question. So, how did the space end up in the select list for GloWbE. \r\n\r\nResult is therefore displayed thus...\r\n\r\n![screen shot 2018-02-07 at 14 14 54](https://user-images.githubusercontent.com/664139/35920999-5e14b77e-0c11-11e8-9d93-51aa40e856ba.png)\r\n\r\nI haven't been able to replicate this with a new question but we have a number of existing questions that display this issue. It's not a one-off. "},"comment":{"url":"https://api.github.com/repos/marcusgreen/moodle-qtype_gapfill/issues/comments/363800937","html_url":"https://github.com/marcusgreen/moodle-qtype_gapfill/issues/33#issuecomment-363800937","issue_url":"https://api.github.com/repos/marcusgreen/moodle-qtype_gapfill/issues/33","id":363800937,"user":{"login":"marcusgreen","id":732202,"avatar_url":"https://avatars3.githubusercontent.com/u/732202?v=4","gravatar_id":"","url":"https://api.github.com/users/marcusgreen","html_url":"https://github.com/marcusgreen","followers_url":"https://api.github.com/users/marcusgreen/followers","following_url":"https://api.github.com/users/marcusgreen/following{/other_user}","gists_url":"https://api.github.com/users/marcusgreen/gists{/gist_id}","starred_url":"https://api.github.com/users/marcusgreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcusgreen/subscriptions","organizations_url":"https://api.github.com/users/marcusgreen/orgs","repos_url":"https://api.github.com/users/marcusgreen/repos","events_url":"https://api.github.com/users/marcusgreen/events{/privacy}","received_events_url":"https://api.github.com/users/marcusgreen/received_events","type":"User","site_admin":false},"created_at":"2018-02-07T15:17:07Z","updated_at":"2018-02-07T15:17:07Z","author_association":"OWNER","body":"Can you create an example at \r\nhttp://vledevelop.co.uk/moodle/\r\n\r\nWith a teacher name of t1 and password of test\r\nMG"}}
{"actor":{"display_login":"marcusgreen"}}