Superscript/subscript editor

Text editor ::: editor_ousupsub
Maintained by TimTim Hunt, at the OU (Perry building)Mahmoud Kassaei
This is not a general purpose editor. Instead it is for inputting text with just superscripts and subscripts in question types.
Latest release:
122 sites
101 downloads
6 fans
Current versions available: 3
This is a simple text input widget that lets users edit one line of input with superscripts and subscripts, for use with question types like https://moodle.org/plugins/qtype_pmatch or https://moodle.org/plugins/qtype_varnumericset.

Users can type input that is plain text, with the addition of just the HTML tags <sup> and <sub>. In a particular case, either sup or sub or both may be allowed. For example in a question about for scientific notation (3x10<sup>8</sup>) only superscripts would be allowed. As well as the toolbar buttons, the up and down arrow keys are keyboard shortcuts for switching in and out of sup and sub mode.

It turns out that web browsers make a big mess out of HTML input, so lots of cleaning is applied to the student's response. For example 2<sup>1</sup><sup>6</sup> -> 2<sup>16</sup>. Also, nested superscripts and subscripts are not allowed.

Screenshots

Screenshot #0

Contributors

Tim
Tim Hunt (Lead maintainer)
at the OU (Perry building)
Mahmoud Kassaei: Developer
Chris Nelson: Product owner
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Plugins bot
    Thu, 21 Jun 2018, 11:30 PM
    Approval issue created: CONTRIB-7348
  • Lucía Velasco
    Thu, 12 Jul 2018, 3:29 AM
    I'm trying to use this with the Pattern Match QT. I've installed and enabled it but the editor it's not showing in the answer box, just a plain text area. I think I'm missing something but I can't find it in the documentation. How can I make it work?
  • Tim
    Thu, 12 Jul 2018, 3:40 AM
    When you create the question, there is are options Allow superscript and Allow subscript. You need to turn one or both of those options on.

    Oh! Sorry! I just spotted that I need to update the question type plugins to use the new editor. This bit is wrong: https://github.com/moodleou/moodle-qtype_pmatch/blob/c24fe958b8c5f7bfac767c4575483696837223ae/renderer.php#L66. I will try to do that tomorrow.
  • Tim
    Thu, 12 Jul 2018, 9:13 PM
    New verions of pmatch pushed. Should work now.
  • Tim
    Mon, 29 Jun 2020, 4:21 AM
    Latest version works with 3.9.
Please login to post comments