Question types: Music Theory

Maintained by Eric BrissonEric Brisson
Question type supporting several exercises for music theory instruction.
373 sites
29 fans
Current versions available: 3
This question type is designed for music theory instruction. It currently supports the following exercises:

  1. Note writing: The respondent is asked to enter a given note on the staff.
  2. Note identification: The response is asked to identify a give note.
  3. Keyboard Input: The respondent is asked to select a given key on the piano keyboard.
  4. Key signature writing: The respondent is asked to enter a given key signature.
  5. Key signature identification: The respondent is asked to identify a given major or minor key signature.
  6. Interval writing: The respondent is asked to enter a given interval above or below a given note.
  7. Interval identification: The respondent is asked to identify the quality and size of a given interval.
  8. Scale writing: The respondent is asked to enter a given scale.
  9. Scale identification: The respondent is asked to identify a given scale.
  10. Chord quality writing: Given a chord root and quality (e.g. 'G major', 'D minor'), the respondent is asked to enter corresponding chord on the staff.
  11. Chord quality identification: The respondent is asked to identify the quality of a given chord (e.g. 'major', 'minor', etc.).
  12. Harmonic function writing: The respondent is asked to enter a given harmonic function in a given key (e.g. 'IV in D minor').
  13. Harmonic function identification: The respondent is asked to identify the harmonic function of a given chord in a given key.
When Javascript is enabled, answers are entered and displayed in an HTML5 graphical user interface, using two separate Javascript components (Music Theory GUI and Keyboard Input) packaged as YUI modules. All the exercises above are fully functional without Javascript, except for 1) Note writing, 2) Note identification and 3) Keyboard Input.

Each of the exercises above (except for #3, Keyboard Input) can also be configured so that a specific question is randomly generated upon starting an activity. The randomization can be based on a set of parameters configured when the question is created or edited. For example, it is possible to configure an interval writing question so that it asks for a perfect fifth above a randomly chosen given note. This randomization process, configured during question creation, alleviates the need to create very large question banks, and can be particularly useful for interval and chord/harmonic function questions, given that the number of possible questions for these exercises is very large.

I made a choice to create a framework where the correctness of a given question is automatically computed, without having to enter individual answers during question creation. A framework for adding various grading strategies for each exercise is also in place, and is currently used for the scale writing exercise (currently allowing either an "all-or-nothing" grading strategy, or a "partial grade" approach where each correct note is given partial credit).

This plugin was developed with the hope of creating a music question type that would support a wide range of music theory exercises, using a single graphical user interface that is flexible enough to support such exercises. It is hoped that it will facilitate further development and Moodle server maintenance.

Special thanks to Jay Huber for his very significant contributions to the existing standalone Moodle music question types (Music Key Signature, Music Interval and Music Scale), and for inspiring me to develop this new question type.

Many thanks to Ken Graetz, Scott Schradle and colleagues in Winona State University's TLT and IT departments for their support of my Moodle development efforts through the maintenance of our institution's Moodle server.


Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3


Eric Brisson
Eric Brisson (Lead maintainer): Question type author
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Jerry Lau
    Sat, Oct 6, 2018, 7:26 AM
    I ran a check for foreign violation keys and your table came up as a violation .. it says

    "Foreign key questionid on table qtype_musictheory points to a non-existent table questions." There is no query presented like the others.

    Running Moodle 3.4.7+ on Redhat 7.1 enterprise 64-bit, php 7.1.8 with MySQL 5.7.21-community

    Any thoughts on how to fix this?

  • Eric Brisson
    Mon, Nov 26, 2018, 7:30 AM
    Hi Jerry,

    I'm sorry for my late reply to your question.

    This error is happening because the xml file used to create the database table for the plugin has an incorrect foreign key reference to a non-existent table "questions" (plural) - the reference should refer to the table "question" instead (singular).

    Since referential integrity isn't currently enforced at the database level in Moodle, this error shouldn't have any effect on the plugin's behavior, but if you still want to fix it on your Moodle instance (to avoid the error in the xmldb editor), you could edit the following line in /question/type/musictheory/db/install.xml ( ):

    On line 31: replace REFTABLE="questions" with REFTABLE="question"

    This fix should allow you to check for foreign key violations in the xmldb editor.

    I am planning to release a new version in the near future (hopefully, over winter break) that will fix this issue, as well as other minor issues. The new version will automatically fix this issue.

    Please let me know if you have any other questions.

  • Eric Brisson
    Tue, Jul 16, 2019, 9:10 PM
    I just released version 1.4.2 for Moodle 3.5+ [2019071600].

    This version includes:

    - GDPR compatibility (the plugin does not store any personal data)
    - A minor bug fix (
    - A fix for the xmldb editor foreign key violation check ("Foreign key questionid on table qtype_musictheory points to a non-existent table questions.")
    - A number of code format adjustments to ensure additional compatibility with Moodle's code checker. I will work on the remaining code prechecks in a future version.

    Many thanks, again, to all translation contributors!

  • Picture of Jeff M
    Mon, Aug 5, 2019, 6:36 AM
    Hello, Eric! Your music theory plugin looks amazing. I installed it in my Moodle 3.7.1 site, and got all the correct success messages... but when I go to "add an activity or resourse" in a course, there's no option in the list for any new question types. sad Do you have any idea what I'm doing wrong?
  • Eric Brisson
    Tue, Aug 6, 2019, 5:39 AM
    Hi Jeff,

    From what you described, it seems like the question type installed successfully. To test it, you would first need to create a quiz in "Add an activity or resource", and then add a question on the quiz editing page. When creating a new question for the quiz, you should see the "Music theory" question type as a possible option (along with the standard Moodle question types such as short answer, true/false, etc.). This link may be helpful for information on building quizzes in Moodle: . I hope this is helpful - don't hesitate to let me know if you have any other questions.

  • Picture of Daniel Liang
    Thu, Oct 10, 2019, 10:45 AM
    Hi Eric,
    I really like your plugin. It helps me a lot. I wonder if you can add one more flexible question type for music dictation or theory. It will not limit the answer to be certain chords or scales. It allow the teacher manually input the answer in the staff or from a series drop down menus. For example, the teacher can select three notes from a drop down menu, select "chord", and type in C, F, A as the answer. The teacher can manually type in the question text. With that flexible question type, teachers can easily add seventh chords, inversions and uncommon scales. Please also add an option to show the first note. This option is very useful for questions like "enter a chord above a given note." as you did in Interval writing.
  • Picture of Juliane Braunstein
    Wed, Oct 23, 2019, 9:14 PM
    Hi Eric,
    this plugin looks amazing smile
    Is it possible to translate it into German? The English-skills of my 10-14 year old students are not good enough yet to manage these questions in a foreign language wink
  • Eric Brisson
    Thu, Oct 24, 2019, 8:25 PM
    Hi Daniel,

    Adding a more generic question subtype as you described is something that I have considered several times and that I am still contemplating. I do think that it could provide a useful feature for the purpose of asking less conventional questions. I will continue to keep it in my plans - I may have some time next summer to design a first draft. I'm glad to hear that the plugin is useful for you!

  • Eric Brisson
    Thu, Oct 24, 2019, 8:44 PM
    Hi Juliane,

    Translating the plugin into German is certainly possible. Translated strings can be contributed by Moodle users using AMOS ( - once submitted and approved, the translated strings automatically become available within the plugin itself (for Moodle servers that use one of the German language packs).

    This plugin has already been translated into a few languages (, and it would be wonderful to have a German translation as well!

    I hope that this is helpful - please let me know if you have any other questions.

  • Picture of Fernando Gonçalves
    Fri, Dec 13, 2019, 7:24 AM
    Hi, I have one question about translating this plugin:

    "Enter a comma-separated list of notes,
    without spaces, using the following syntax:

    [Uppercase letter name][Accidental
    ("n" = natural, "#" = sharp, "b" = flat, "x" = double-sharp, "bb" = double-flat)]4, ...

    Random example: answer=>Cn4,​En4,​G#4"

    Should I translate the random example (Cn4) with pt-br Brazilian note names? Does the plug-in checks for an absolute syntax or is it relative to the current localization (ie, it expects Dón4 instead of Cn4) ?
  • Eric Brisson
    Fri, Dec 13, 2019, 8:00 AM
    Hi Fernando,

    The plugin needs an absolute syntax for this portion of the instructions - please use "Cn4,​En4,​G#4" in the translation. Please let me know if you have any other questions, and many thanks for your translations!

  • Picture of Fernando Gonçalves
    Tue, Jan 21, 2020, 8:21 PM
    Thanks Eric,

    I have finished the pt-br translation, hope it gets approved soon! Thanks for your work on this plugin.

    Best regards,
    Fernando Rauber
  • Eric Brisson
    Tue, Jan 21, 2020, 9:52 PM
    Hi Fernando,

    Great to hear - again, many thanks for your translations!

  • Picture of Fernando Gonçalves
    Wed, Jan 29, 2020, 2:36 AM
    A few requests and suggestions:

    1) Construction and identification of modes in different keys
    2) Controlling which keys are used for random roman numeral analysis. I find it upsetting when it randomly generates problems in very difficult keys (ie, Eb minor) instead of the more usual keys I wanna my students to really master. Ideally, I wanna control also which parts of the random test are easier and which ones should be more difficult in regards to keys.
  • Picture of Volkan Yılmaz
    Tue, Feb 25, 2020, 5:41 PM
    Thank you for sharing this article, I also love mp3 music and used it and set it as a ringtone on my phone. You can also learn more and download phone ringtones at: TelefonZilSesleri
1 2 3 4
Please login to post comments