ignore punctuation and case

  • teacherjonny
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 7 months ago #7826 by teacherjonny
ignore punctuation and case was created by teacherjonny
Hello All,
I am using interaction >dialog where I have a prompt and the student is asked to type in a response. Is there a way to ask xerte to ignore any punctuation in the student's response and to change any upper case letters to lower case? Is there a way to learn the name of the variable that contains the student response and then use java script to do the above?
Thanks!

Please Log in or Create an account to join the conversation.

More
4 years 7 months ago #7830 by Fay
Replied by Fay on topic ignore punctuation and case
The dialogue page is not case sensitive by default so when it checks the student answer against the correct answer it will change both to lowercase (you can add the case sensitive optional property to force the case to be checked too). There's no built in easy way to remove punctuation from the student's answer though. If you want to add custom code to the page to deal with this then it's likely to be a bit fiddly - start by looking at the model for the page so you can see what's currently happening. The submit button code that checks correct answers is around line 143 in this file: Dialogue model file
The following user(s) said Thank You: teacherjonny

Please Log in or Create an account to join the conversation.

  • teacherjonny
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 7 months ago #7838 by teacherjonny
Replied by teacherjonny on topic ignore punctuation and case
Thank you very much. I appreciate the response and I'll try to write something. I didn't realize that I had access to the model files. How can I learn the location of other files? I would like to learn if it's possible to test one of my corrections in an exercise, for example in item 8 without having to go through all of the items until I reach 8. Can't I "run from 8" for example.

Please Log in or Create an account to join the conversation.

More
4 years 7 months ago #7839 by tom
Replied by tom on topic ignore punctuation and case
If with "item" you mean page, yes you can. Just press the Shift key when pushing the preview/play button.
The following user(s) said Thank You: teacherjonny

Please Log in or Create an account to join the conversation.

  • teacherjonny
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 7 months ago #7859 by teacherjonny
Replied by teacherjonny on topic ignore punctuation and case
OK I can write code in Javascript to remove punctuation and space between words. But how do I find the code for the "interactivity, dialog" to modify it on my server? What is the name of that 'module" In other words, where is the code on my server that you directed me to on github? While the present xerte code that converts both the correct answer and the student input to lower case is welcome, the students are upset when they have their answers declared wrong because of a discrepancy involving a comma, or another punctuation mark, or an inadvertent extra space. I'd like to fix this.
Thanks.

Please Log in or Create an account to join the conversation.

More
4 years 7 months ago - 4 years 7 months ago #7861 by Fay
Replied by Fay on topic ignore punctuation and case
The files for all the page types are in this folder: modules/xerte/parent_templates/Nottingham/models_html5
If you edit any of the core Xerte files you need to remember that your changes will be lost if you later upgrade. We generally don't recommend editing them for this reason
Last edit: 4 years 7 months ago by Fay.
The following user(s) said Thank You: teacherjonny

Please Log in or Create an account to join the conversation.

Moderators: ronmalimcn
Time to create page: 0.160 seconds
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo