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

Feature request #2

Open
werty77 opened this issue Apr 23, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@werty77
Copy link

commented Apr 23, 2017

New to GitHub so forgive me if this is not the place for a feature request.

Would it be possible to make the description field under personality so that you can add html code (styling, links et.)?

@nlile

This comment has been minimized.

Copy link

commented Apr 27, 2017

@werty77 I just stumbled upon this plugin and started tinkering around with it for this very reason. Haven't figured out a solution yet.

My js skills aren't too strong, but when I glanced at personalityQuiz.js and it seems to me that function appendPersonality should allow for html in the body.

$description = createIf(hasDescription, '<p>', {
        'html': personality.description
      });

So, my guess is that it is either being escaped elsewhere or I just really suck at js.

Speaking of features, it's also really too bad this isn't LRS dependent/xAPI enabled...

@werty77

This comment has been minimized.

Copy link
Author

commented Apr 27, 2017

@nlile Thanks for taking the time to write. I think you're right it's probably somewhere in the main plugin https://github.com/h5p/h5p-wordpress-plugin . I have tried to look around but I don't know much about js so i don't really know where to start looking. Thanks again for taking the time to reply.

@icc

This comment has been minimized.

Copy link

commented May 2, 2017

I believe changing the description widget to 'html' instead of 'textarea' should do the trick.

The safest way to do this is probably to implement this action in your theme or a custom plugin:
https://github.com/h5p/h5pmods-wordpress-plugin/blob/master/h5pmods.php#L44

@nlile

This comment has been minimized.

Copy link

commented May 5, 2017

@icc I tested that. It changes the backend editor to allow HTML, but the quiz output is still just text. (I also removed the maxLength because it isn't supported by HTML, but nothing changed.)

@nlile

This comment has been minimized.

Copy link

commented May 5, 2017

@werty77 Got it to work after checking some other H5P types. In addition to changing 'textarea' to 'html' (here thank you @icc), you need to append a list of HTML tags you want to access. For instance:
```
"widget": "html",
"tags": [
"strong",
"em",
"a",
"ul",
"ol",
"hr"
]

@werty77

This comment has been minimized.

Copy link
Author

commented May 9, 2017

@nlile
Awesome that you got it to work. I've removed maxlength and changed
"widget": "textarea"

to:

"widget": "html",
"tags": [
"strong",
"em",
"a",
"ul",
"ol",
"hr"
]

It still doesn't allow any of the tags and only outputs text.

Did you do anything else to get it to work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.