Copyright | (c) Michael Mounteney, 2015 |
---|---|
License | BSD 3 clause |
Maintainer | the project name, all lower case, at landcroft dot com |
Stability | experimental |
Portability | undefined |
Safe Haskell | None |
Language | Haskell2010 |
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.
- dueItem :: UserId -> UTCTime -> [Key View] -> OneLearnPersist
- newItem :: UserId -> [Key View] -> OneLearnPersist
- updateLearnDatum :: forall m. MonadIO m => Key LearnDatum -> UTCTime -> Double -> ReaderT SqlBackend m ()
- deleteItems :: forall m. MonadIO m => [Text] -> ReaderT (PersistEntityBackend DataRow) m [()]
- allSourceKeys :: Key DataSource -> PersistResult [Text]
- mkLearnDatum :: ViewId -> Key DataRow -> UserId -> Int8 -> Int8 -> Double -> UTCTime -> LearnDatum
- viewsOnDataSource :: Key DataSource -> PersistResult [Key View]
- lastHistory :: PersistQueryRead SqlBackend => Int -> Key LearnDatum -> PersistResult [History]
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