Add deck options to SchedulingContext for custom scheduler

Currently, the SchedulingContext has deck_name and seed

message SchedulingContext {
  string deck_name = 1;
  uint64 seed = 2;

I think it would be useful to also have the card’s deck options as well in the SchedulingContext (or SchedulingState if that makes more sense) when using the custom scheduler. In particular, the StateContext has the following information

pub(crate) struct StateContext<'a> {
    /// In range `0.0..1.0`. Used to pick the final interval from the fuzz
    /// range.
    pub fuzz_factor: Option<f32>,
    pub fsrs_next_states: Option<NextStates>,

    // learning
    pub steps: LearningSteps<'a>,
    pub graduating_interval_good: u32,
    pub graduating_interval_easy: u32,
    pub initial_ease_factor: f32,

    // reviewing
    pub hard_multiplier: f32,
    pub easy_multiplier: f32,
    pub interval_multiplier: f32,
    pub maximum_review_interval: u32,
    pub leech_threshold: u32,

    // relearning
    pub relearn_steps: LearningSteps<'a>,
    pub lapse_multiplier: f32,
    pub minimum_lapse_interval: u32,

    // filtered
    pub in_filtered_deck: bool,
    pub preview_step: u32

For my custom scheduling algorithm, I need at least

  1. hard_multiplier
  2. easy_multiplier
  3. maximum_review_interval

Is this possible to add?

Note, I do not need to modify these options, I just want to read the value

As a workaround, I can just add some JS code and create a deckParams object and read the deck_name like FSRS, but it would be nice to not have to do this and avoid any potential user error

Sorry, I’m not really keen on exposing all the deck options, as that’s a bunch of extra data that has to be moved into the webview on each answer, even though the vast majority of people won’t use it. I’d recommend you either encode the params into your .js file (and optionally vary them based on deck name), or put them in each card’s customData if they need to vary for every card.