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

Wildcard and regular expressions only work with letters, not numbers. #31

Closed
zahrahnabdul opened this issue Apr 30, 2018 · 22 comments
Closed

Comments

@zahrahnabdul
Copy link

When attempting to use a serial number with random numbers at the end of a fixed string as a keyword, neither the wildcard * or regex / are compatible with numbers preceding or following a search term. For example, if I attempted to use MM71.098.B as a term, the value MM71.098.BCD would be valid, but MM71.098.B99 would not.

@otacke
Copy link
Owner

otacke commented Apr 30, 2018

Hi!

The wildcard is supposed to only mark substitutes for characters (https://github.com/otacke/h5p-essay/blob/master/scripts/essay.js#L567) as stated in the editor's input field description. Essays are made of words ;-)

However, since that might be restricting for some use cases, I included the regexp option, and I cannot reproduce your issue. Have you checked your regular expression? Just for testing your example, I used

/MM71\.098\.B[0-9]*/

and it works as intended.

@zahrahnabdul
Copy link
Author

Thank you for your response! I tried the regex that you used exactly, but I still had no luck. I'm not really sure what's wrong - I included screenshots.
br2
br3

@otacke
Copy link
Owner

otacke commented May 1, 2018

Could you please check the development console for error messages (F12)?

My assumption is that you'll see something there, because you've not updated to the latest version of the text-utilities library that's needed by Essay, thus leading to a crash. I may not yet have updated the dependencies in these development versions.

@zahrahnabdul
Copy link
Author

This is what I see in the development console:
br4

@otacke
Copy link
Owner

otacke commented May 1, 2018

So far, so good! Some messages might pop up in the lower right box as you browse the web, just keep it open. Does anything appear when you click the check button of your Essay content?

@zahrahnabdul
Copy link
Author

This is what I see when I click the check button:
br6

@otacke
Copy link
Owner

otacke commented May 1, 2018

Okay, no error messages.

Are you using the latest development version here from github (that's what I assumed) or did you use the latest official version that's provided by the H5P hub? The latter doesn't have the regexp feature yet.

@zahrahnabdul
Copy link
Author

That explains the issue - thank you for your help! I was using the version available through the hub. Now I have an additional question - when attempting to upload and use version 1.1.2 I get these error messages:
validatingh5pfailed

What should I do to resolve them and use the newer version?

@otacke
Copy link
Owner

otacke commented May 1, 2018

If you're trying to upload libraries, you'll have to do that on the library page of H5P, not in the content type hub (which is for content). However, since you're using WordPress, it's a little more tedious to use development versions.

The easiest and future-update-friendliest way probably is to replace the files in wp-content/uploads/h5p/libraries/h5p-essay with their counterparts in the archive that you downloaded and then delete the files in wp-content/uploads/h5p/cachedassets. You might need to do the same with h5p-text-utilities, and you might need to refresh your browser's cache (shift+F5).

In any case: You should not do this on a productive system if you're not sure what you're doing. Be sure to make a backup first.

Alternatively, just wait until one of my colleagues has finished the peer-review. There should be an official update shortly that you can download normally using the H5P content hub.

@zahrahnabdul
Copy link
Author

Thank you for your help! One more question - would it be possible to keep the keywords from being shown to the user in the feedback tab? I'd like to hide the regex and just show the feedback if possible.
untitled

@zahrahnabdul
Copy link
Author

Also, regex flags like /MM71.098.B[0-9]*/i for case insensitivity aren't working on my end - is there special syntax that I should use?

@otacke
Copy link
Owner

otacke commented May 1, 2018

Yes, in the latest version you can set the visibility to "keyword" / "alternative found" / "answer given" / "none" for each keyword group.

What are you actually using Essay for? That doesn't look like an educational scenario.

@otacke
Copy link
Owner

otacke commented May 1, 2018

There's no support for regexp flags.

@zahrahnabdul
Copy link
Author

zahrahnabdul commented May 1, 2018

I'm using it to check the compatibility of boot rom numbers for different years of Mac laptops with solid state drives that I engineer - it probably seems very random, but your tool was the only one that I could find that had all of the functionality that I need. Thanks again for answering my barrage of questions - I just subscribed to your Patreon! I really appreciate the help.

@zahrahnabdul
Copy link
Author

Sorry to bother you again, but where is the option to change the visibility? I can't find it in 1.1.3.

@otacke
Copy link
Owner

otacke commented May 1, 2018

Sorry for not being clear: with latest version I meant the latest version here on github which should be out soon. I just created a special version for you that should bring an Essay version 1.1.4 to your system if you upload it via H5P's library page. Old contents will have to be updated via the library page as usual, too, if they should get the new features. Since the next official version of H5P Essay will be 1.2.0, this will not become a problem with version numbers when you want to get the official version again. Let me know if everything works.

h5p_essay_fluffyparakeet.zip

And thanks for becoming a patron!!! $5 is huge!

Also, thanks a lot for sharing your use case! It's always very interesting to see what others use your programs for -- even if you designed them for something completely different :-D

@zahrahnabdul
Copy link
Author

This works perfectly, thank you so much!!!

@otacke
Copy link
Owner

otacke commented May 1, 2018

Great! I'll close this issue then, but feel free to get in touch if you have more questions or suggestions -- the forum at h5p.org is probably a good place, because it's kind of the central hub for Q&As and others could join the conversation more easily, too.

@otacke otacke closed this as completed May 1, 2018
@zahrahnabdul
Copy link
Author

Is there a way to prevent the check button from showing after the initial submission? When the second check button is pressed, another results box shows up above the main results box and is blank. bootromversion2
bootromversion1

@otacke
Copy link
Owner

otacke commented May 1, 2018

There is no first and second check button, just one. There's just one, and it has a checkmark in front of the label.

Did you relabel the "Show solution" button to "Check"? That's the one with the eye. It should not show up however if the sample solution text is empty (that's the second box you're seeing).

I am a little puzzled what went wrong here unless you have "Result" as the introduction text of the sample solution and at least a blank in the sample solution text field.

@zahrahnabdul
Copy link
Author

After clearing out the show solution field and making sure there weren't any blank spaces, everything is working as intended. Thanks again!

@otacke
Copy link
Owner

otacke commented May 1, 2018

You're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants