View Source Memorex.Cards (Memorex v0.2.2)

Functions for interacting with Memorex.Domain.Cards.

Link to this section Summary

Link to this section Functions

Link to this function

cards_for_deck(deck_id, opts \\ [])

View Source
@spec cards_for_deck(Memorex.Ecto.Schema.id(), Keyword.t()) :: Ecto.Query.t()
Link to this function

convert_new_card_to_learn_card(card_before, config, time_now)

View Source
@spec convert_new_card_to_learn_card(
  Memorex.Domain.Card.t(),
  Memorex.Scheduler.Config.t(),
  DateTime.t()
) :: Memorex.Domain.Card.t()

Converts a Memorex.Domain.Card from a :new card to a :learn card (and in the process creates a Memorex.Domain.CardLog entry).

@spec create_from_note(Memorex.Domain.Note.t()) :: Ecto.Schema.t()
Link to this function

due_count(deck_id, time_now)

View Source
Link to this function

get_interval_choices(card, config, time_now)

View Source
Link to this function

get_one_random_due_card(deck_id, time_now)

View Source
@spec get_one_random_due_card(Memorex.Ecto.Schema.id(), DateTime.t()) ::
  Memorex.Domain.Card.t() | nil
Link to this function

set_new_cards_in_deck_to_learn_cards(deck_id, config, time_now, opts \\ [])

View Source
@spec set_new_cards_in_deck_to_learn_cards(
  Memorex.Ecto.Schema.id(),
  Memorex.Scheduler.Config.t(),
  DateTime.t(),
  Keyword.t()
) :: :ok
Link to this function

update(card, card_params)

View Source
@spec update(Memorex.Domain.Card.t(), map()) ::
  {:ok, Memorex.Domain.Card.t()} | {:error, Ecto.Changeset.t()}
Link to this function

update_card_when_reviewing!(card, changes, time)

View Source
@spec update_card_when_reviewing!(Memorex.Domain.Card.t(), map(), DateTime.t()) ::
  Memorex.Domain.Card.t()

Updates a card, and in the process sets the :due field, and also increments the rep count

Link to this function

where_due(query, time_now)

View Source
@spec where_due(Ecto.Query.t(), DateTime.t()) :: Ecto.Query.t()