h5p / h5p-drag-text

MIT License
7 stars 71 forks source link

Allow for custom number of Lines to be selected #156

Closed JoeMcNiff closed 3 months ago

JoeMcNiff commented 3 months ago

This small patch to the Drag Text content type allows users to select a custom number of paragraphs to be used each time the quiz is taken. It incorporates logic similar to that of the numCardsToUse parameter in the memory game content type. This is very useful for users who have a large block of text they want to convert to drag-text quizzes but who don't want to have to make numerous amounts of quizzes. One thing to note. I noticed that the javascript logic for this content type seems to be taken from "dist/h5p-drag-text.js" rather than "scripts/h5p-drag-text.js", I have a similar patch for "dist/h5p-drag-text.js" as well but I can't figure out where that fits in this repository.

JoeMcNiff commented 3 months ago

Thank you for taking the time to go through this Oliver, I realize it might be a bit of a stretch to get this merged. How would one go about making this into its own content type with a fork?

otacke commented 3 months ago

Thank you for taking the time to go through this Oliver, I realize it might be a bit of a stretch to get this merged. How would one go about making this into its own content type with a fork?

Assumimg you're using the H5P CLI Tool, you'd copy the folder of the content type and replace all of the occurrences of the machineName in library.json and in the code. If you want to, you can also change CSS class names, depends on the usage scenario. Then you'd rename the folder following the H5P.machineName-majorVersion-minorVersion pattern. And then you'd need to make the new version known to H5P CLI by using its use command (see https://github.com/h5p/h5p-cli/blob/master/assets/docs/setup.md#setup-a-local-library). The latter step will not be required in a future version of the H5P CLI tool.

JoeMcNiff commented 3 months ago

I previously tried all that and the editor for my new content type worked but when I viewed the content nothing showed up

otacke commented 3 months ago

Then please ask H5P Group for support. I merely wanted to hint to obvious issues with your pull request that they would hint to anyway if they looked at it.

JoeMcNiff commented 3 months ago

Will do thanks for your help. Also, your youTube tutorials have been very useful