Editor issues

borisvmalysh's picture

First, let me thank the team! You guyes RULE!!!
But there are a couple of cuestions I'm having lately:

1 - can I change the font size and arrange the text more freely in a fill-in or drag&drop text activity?

2 - is there a way to embed code into an activity right in the editor?

Like when in moodle you have the "<>" button which opens the html editor for the text.

Again, thank you ladies and gentlemen!

thomasmars's picture

I'm glad you're enjoying H5P :)

1) You are restricted to only textual layout changes for "Fill in the Blanks" and "Drag Text". If you have some experience writing css you can modify the css yourself, have a look at the css guide. If you have more advanced needs the "Drag and Drop" may satisfy them, but be aware that its editor is quite a bit more complex.

2) It is not possible to embed code into an activity, this is mainly for security reasons, we don't want arbitrary code to be runnable when viewing an H5P

Thanks for the praise, let us know if you run into any other problems, and feel free to create a pull request for #1 issue or post it as a feature request in our other forum with a specification on how you would like for it to work.

- Thomas

borisvmalysh's picture

Happy new year everybody!!! And mery christmas (both catholic and orthodox)!
By code I meant HTML. But in the HTML code you can also build in CSS and JS. And I wanted to use this.

The idea I have is timed demonstration of words to memorize and passing the words to fill-in boxes (with variables). This requieres JS code embedded. 
Well... If the creators think of the code as a potential threat I can only be sorry. But still very thankful for the work done. Because even with limited functional H5V rules ))

thomasmars's picture

Hi, there might be merit to allowing HTML tags, or at least a subset of HTML at some point. I don't think this is a prioritation though, but you can always make a feature request for it in the forums so a developer is more likely to pick it up.

I don't think arbitrary JS will be allowed in H5Ps, since the sharable nature of H5P has too much potential to be abused. The security implications are too high. Consider a malicious author creating an H5P on his site and shares it with multiple other sites. The H5P with the malicious script can be downloaded and re-used by author sites, and thus passed around to even more sites. The malicious script is run on all clients that opens the H5P.

If you had a specific feature in mind for a content type then pull requests for the given content type is encouraged. If you want to create an addon/script just for yourself then you can use the built-in hooks for extending H5Ps. You can learn more about this in the Drupal hooks and Wordpress hooks and the developer documentation.

Happy new year,
Thomas

papi Jo's picture

By "code" I think borisvmalysh means HTML tags. It would help us understand his question if boris gave examples of which kind of HTML tags he would like to use in his texts.