Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • First, you need to add these code to function.php

    /* Describe what the code snippet does so you can remember later on */
    add_action('wp_head', 'enable_tiny_mce_wiris');
    
    function enable_tiny_mce_wiris()
    {
    ?>
      <script src="<?php echo get_option('home'); ?>/wp-includes/js/tinymce/plugins/tiny_mce_wiris/integration/WIRISplugins.js?viewer=image" type="text / javascript"> </script>
    <?php
    };
    
    ?>

    Then add this line in PHP for the quizz page. I use shortcode for my part.

    wp_enqueue_editor();

    Finaly add js to initialize the editor.

    /* This is your custom Javascript */
    
    (function ($) {
        $(window).load(function () {
            wp.editor.getDefaultSettings;
            var settings = {
                tinymce: {
                    selector: 'textarea',
                    plugins: 'tiny_mce_wiris',
                    toolbar1: 'bold,italic,strikethrough,bullist,numlist,blockquote,hr,alignleft,aligncenter,alignright,image,wp_more,tiny_mce_wiris_formulaEditor,fullscreen,',
                    setup: function (editor) {
                        editor.on('change', function () {
                            editor.save();
                        });
                    },
                },
            };
            $("textarea.wpProQuiz_questionEssay").each(function (index, element) {
                wp.editor.initialize($(element).attr("id"), settings);
            });         
        });
    
    })(jQuery);

    Best regards

    Hi egymido,

    I did it by using Wiris MathType for WordPress.

    https://docs.wiris.com/en/mathtype/mathtype_web/apps/wordpress

    You also need to initialise wp.editor on answer pages. Using png file instead of svg.

    https://codex.wordpress.org/Javascript_Reference/wp.editor

Viewing 2 replies - 1 through 2 (of 2 total)