How do we input an answer in a short answer question which permits any number between a range - eg any number between 1000-1400. We have [1000-1400] and if you type say 1125, it marks it as incorrect.
Thanks in advance.
Hi Sue, I would use this for 5 through 12: ^([5-9]|1[0-2])$
Regular expressions find matches based on each individual digit, so [5-9] can only search for 5 through 9, then the pipe symbol | means or, while 1[0-2] searches for 10 through 12. The ^ and $ symbols are just to denote the beginning and end of the line. Without them, any of those numbers within a larger number (such as the 5 in 15 or 150) would technically be a match.
Hi @Sue.S.4,
May I suggest trying the following regular expression in the answer field: ^(1[0-2]|[5-9])$ This may help ensure that only valid responses between 5 and 12 are accepted.
^(1[0-2]|[5-9])$
For context, here's how it works:
^
$
1[0-2]
[5-9]
This expression will successfully match any number from 5 to 12, while excluding anything outside that range.
Thanks,
Rusha
@Sue.S.4 Hi Sue, when creating/editing the question, click abc to open the drop-down menu and choose Regular Expression. Then paste this into the answer blank: ^(1,?[0-3][0-9][0-9]|1,?400)$
You can remove both ,? if you don't want to allow for commas in the answer.
Thank you Jennifer, I"ll try it out.
Hi Jennifer, As long as I click regular expression, and the response is anywhere between 5 and 12, would this be suitable in a short answer box as a possible answer [5-12].
Sorry I'm not a programmer - I'm an academic helping other academics…
Thank you so much Jennifer. That is such a helpful response :)
Thank you Rusha
This is very helpful, especially the explanation.
Regards, Sue
Hi everyone, this is still a little unclear to me. Can someone provide an example of using the expression for any answer that ranges between 1020 - 1200? Student's answers may be decimal points as well, such as 1020.50.
Thank you!
@Cherese.K.9099 If you're not allowing any commas, try this:
^1(02[0-9]|0[3-9][0-9]|1[0-9][0-9]|200)(.\d+)?$
If you want to allow an optional comma, try this:
^1,?(02[0-9]|0[3-9][0-9]|1[0-9][0-9]|200)(.\d+)?$
The d+ allows for any digits 0-9 and an unlimited length for the decimal (+ means one or more). You can test out these expressions at regex101.com
Connect with our Known and Fixed Issue information to learn about improvements made to Brightspace.
Connect with leaders in pedagogy, accessibility, learning experience design and more
The Accessibility category serves as a single point of access to three avenues in Brightspace Community leading to the Accessibility Academy, Accessibility Library and Accessibility Discussions. These avenues offer courses and articles about accessibility to enhance accessibility knowledge and a group of accessibility enthusiasts to stay connected with.
Have questions about how to use Community? Stay tuned with updates, feedback opportunities and more for the Community here!
Connect with and ask questions on how to best use the Brightspace Product to transform the way your users learn!
Connect with product experts to learn more about tools frequently used by Brightspace Developers such as APIs and integrations!
Want to learn more about Brightspace Partners and Integrations? This is the place to be!
Stay up to date with product updates and announcements in this category.
Connect with our release information to learn about monthly improvements and updates to Brightspace.
Learn more about all the upskilling opportunities with courses and resources offered via the Brightspace Learning Center, Brightspace Guided Training and other training opportunities!