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

Fix: Text input schema needs top level answers (fixes #114) #154

Closed
wants to merge 9 commits into from

Conversation

lemmyadams
Copy link
Contributor

Addresses #114

Fix

  • Adds top level _answers property to the schema.

This is particularly important as one of the latest PRs now unconditionally checks for this. [See screenshot]. This now fails because there's no _answers array to retrieve, and you can't perform a slice() method on something undefined

Screenshot 2024-10-29 at 13 24 10

@oliverfoster
Copy link
Member

oliverfoster commented Oct 29, 2024

"_answers" is an array of arrays of strings - an array of strings is considered an answer with its aliases and can only be used once in any text input.

Yours:

[
      "Asia",
      "Africa",
      "North America"
]

Configuration:

[
      ["Asia"],
      ["Africa"],
      ["North America","N America", "N. America"],
      ["South America","S America", "S. America"],
      ["Europe"],
      ["Antarctica"],
      ["Australia"]
]

@lemmyadams
Copy link
Contributor Author

@oliverfoster I've updated it to be an array of strings. I'm unsure on what it should exactly be so let me know if there's anything further needed to change

@oliverfoster
Copy link
Member

This needs testing in an AAT now. I was quite sure the it wasn't possible to specify a schema that does this. As per #114 (comment)

@swashbuck swashbuck changed the title Fix: Text input schema needs top level answers (Issue/114) Fix: Text input schema needs top level answers (fixes #114) Dec 11, 2024
@swashbuck
Copy link
Contributor

@oliverfoster I've updated it to be an array of strings. I'm unsure on what it should exactly be so let me know if there's anything further needed to change

@lemmyadams Does this still allow for aliases / alternate spellings? For instance, if the question is "List the names of seven continents", we would not want users to get two correct answers if they enter both "North America" and "N. America" since they are the same continent.

@cahirodoherty-learningpool
Copy link
Contributor

Hi Lemmy, I believe this can be closed off now

@lemmyadams lemmyadams closed this Dec 17, 2024
@lemmyadams lemmyadams deleted the issue/114 branch December 17, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants