JackRose-0.8: Spaced repetition web server

Copyright(c) Michael Mounteney, 2015
LicenseBSD 3 clause
Maintainerthe project name, all lower case, at landcroft dot com
Stabilityexperimental
Portabilityundefined
Safe HaskellNone
LanguageHaskell2010

LearningData

Description

DataSource: reference to some database table or flat file. DataRow: in Anki parlance, a note; one table row. View: card: display information * data row LearnDatum: card * datarow * user. History: record of item scores.

Synopsis

Documentation

dueItem :: UserId -> UTCTime -> [Key View] -> OneLearnPersist Source #

Return the next item for review, if there be one.

newItem :: UserId -> [Key View] -> OneLearnPersist Source #

Return the first new item for review, if there be one.

updateLearnDatum :: forall m. MonadIO m => Key LearnDatum -> UTCTime -> Double -> ReaderT SqlBackend m () Source #

Replace the next-review time-stamp on a learn datum.

deleteItems :: forall m. MonadIO m => [Text] -> ReaderT (PersistEntityBackend DataRow) m [()] Source #

Delete items that have been removed from the external data source, and all subordinate data.

allSourceKeys :: Key DataSource -> PersistResult [Text] Source #

All data rows referring to the given external data source.

mkLearnDatum :: ViewId -> Key DataRow -> UserId -> Int8 -> Int8 -> Double -> UTCTime -> LearnDatum Source #

Wrap non-exportable LearnDatum.

viewsOnDataSource :: Key DataSource -> PersistResult [Key View] Source #

return list of views that refer to the given data source

lastHistory :: PersistQueryRead SqlBackend => Int -> Key LearnDatum -> PersistResult [History] Source #

Most recent history for the given learn datum