• Resolved duckeroo

    (@duckeroo)


    Hi there,

    I’m trying to make a quiz containing equations. For this purpose, I use the plugin Katex. Unfortunately, the Shortcodes are not recognized by HD Quiz. Could you please tell me how to make it work?

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Harmonic Design

    (@harmonic_design)

    Hi duckeroo,
    if you need to use shortcodes inside of the answers, I’m afraid that this is not possible and will likely never be possible with the default HD Quiz for security reasons. Shortcodes have the power to execute any code, so if I allowed for this it would create a big security hole in the way HD Quiz saves and loads data.

    However, one of the following options *might* work for you.

    First, although you cannot use shortcodes inside of the answers, I do allow for most basic HTML tags such as strong to bold, em for italics, and in your case, sup for superscript and sub for subscripts. You can take a look at this for an example. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup

    If the above does not give you enough control, then another option would be is to use the Multiple Choice: Image question type. This allows you to add an image for each answer. Using this you can create 400x400px images and add your equations to those images (if you do not have photoshop or equivalent, I can wholeheartedly recommend photopea.com – a free web-based Photoshop-like image editor. I’m not affiliated with them in any way – just a fan haha).

    Thread Starter duckeroo

    (@duckeroo)

    Hi @harmonic_design,

    thank you for getting back to me this quickly. Unfortunately, both ideas you offer are no viable solutions. This is why the issue can’t by no means be marked as “Resolved”. This would give others with similar issues the wrong idea.

    Now to why your ideas are no viable solutions:

    1. I need to be able to write complex equations. That’s why I’m writing them in LaTeX and not HTML ??
    2. Using pictures of equations instead of equations is not scalable. Every Quiz will contain about 30 equations, there will be around 15 quizzes. That makes around 450 images to make and to insert. Let’s assume making the image and saving it takes a minute and inserting it into the quiz another 30 seconds, that would equate to 11.25 hours of additional work. That’s insane! I type LaTeX as fast as other type plain text, so no, taking pictures of the equations won’t work for me ??

    I do like HD Quiz very much, because it’s plain yet beautiful. But I’m afraid I’ll have to switch to Learndash if I cannot insert shortcodes as answers in HD Quiz.

    Plugin Author Harmonic Design

    (@harmonic_design)

    It was marked as resolved because your question was answered (that you cannot use shortcodes in answers as well as *why* you cannot use shortcodes in answers) and the possible solutions were provided. If this forum allowed me to mark a question as “answered” instead of “resolved” I would choose that option instead – otherwise this thread would stay open forever ??

    If being able to use shortcodes inside of answers is a deal breaker for you then I’m afraid that HD Quiz will not work for you. Just note that LearnDash also does not allow for LaTex unless you modify your site – more info here: https://www.learndash.com/using-latex-in-learndash/

    Thread Starter duckeroo

    (@duckeroo)

    Thanks for the link, read that already hours ago ??
    What I like most about Open Source is that I can edit the code whenever I choose to.

    Thread Starter duckeroo

    (@duckeroo)

    You know, leaving a topic open instead of marking it as “Resolved” gives others the opportunity to contribute to the discussion or present their ideas. I think this is part of the Open Source spirit, too. It’s sad you’re not considering this option.

    Plugin Author Harmonic Design

    (@harmonic_design)

    I think we disagree on what “resolved” means.

    In this context, resolved does not mean that you are 100% fully satisfied with the answer. It means that your question was answered, in full, to my best capacity.

    The thread is not closed. Anyone can still comment and respond without issue. If anyone has the same or similar problem, they can still see this thread and take a look at the offered solutions. They can still respond with any follow-up questions or suggestions.

    This isn’t github where threads are closed and can’t be responded to. This is an open forum!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Katex Shortcodes don’t work in questions’ is closed to new replies.