ShacharHarshuv / open-ear

105 stars 20 forks source link

Allow choice of ascending/descending/melodic intervals #24

Open exscape opened 3 years ago

exscape commented 3 years ago

Preferably in a way where the user can select between 1 and 3 of them, so that the questions use a random choice of the selected options, the same way it currently uses ascending or descending randomly.

exscape commented 3 years ago

I'm considering attempting to contribute a bit but I've never used TypeScript and have barely used JavaScript, either, so it would take a bit to get up to speed!
I do tend to learn the basics of new languages quickly though, as I've used a lot of them over the years.

ShacharHarshuv commented 3 years ago

Hey! I think the existing infra can support that so implementing it should be relatively easy. Here are a few tips:

  1. You need to add a "settings" definition to IntervalExercise. That exercise currently doesn't have any settings, so you can look at ChordsInKeyExercise#_getSettingsDescriptor and _getDefaultSettings. Looking at the example should really help you understand how to do that.
  2. The settings object will be available via the _settings property. You just need to rewrite IntervalExercise#getQuestion to take the settings into account.

Should be pretty easy if you have some programming experience, even if you don't know TypeScript. (it's very similar to C# / Java, main difference is that the types are after the method/property name.)

(If you are implementing this, please mark yourself as the assignee for this task)