Commit graph

698 commits

Author SHA1 Message Date
Damien Elmes
6627264079 delFacts() convenience method; mod schema on model add 2011-05-08 02:12:09 +09:00
Damien Elmes
0af03a6a8a only use deletion log when necessary 2011-05-07 21:45:55 +09:00
Damien Elmes
ec8c720048 make it possible to save with a given mod time, for use in syncing 2011-05-04 23:27:56 +09:00
Damien Elmes
3d370f675b restore the deletion log
the initial plan was to zero the creation time and leave the cards/facts there
until we have a chance to garbage collect them on a schema change, but such an
approach won't work with deck subscriptions
2011-05-04 19:00:38 +09:00
Damien Elmes
5856ad7545 make latex pre/postamble a model property 2011-04-28 09:24:05 +09:00
Damien Elmes
19fd581839 change default lrn timing; leechAction doesn't need an array 2011-04-28 09:24:05 +09:00
Damien Elmes
0d6064b933 rename() 2011-04-28 09:24:05 +09:00
Damien Elmes
d1deeb2b37 keep track of session reps in scheduler 2011-04-28 09:24:05 +09:00
Damien Elmes
431fd2585e when adding cards, use rand(1, maxfid)
this means that content added earlier has a higher chance of appearing, but it
makes it consistent with sortCards(), and the user can sort manually if need
be
2011-04-28 09:24:04 +09:00
Damien Elmes
1641256da4 random ids should start at 1 2011-04-28 09:24:04 +09:00
Damien Elmes
82c3119c90 update randomizing/ordering code and forgetCards()
instead of completely resetting a card like we did in resetCards() in the
past, forgetCards() just puts the card back in the new queue and leaves the
factor and revlog alone. If users want to complete reset a card, they'll need to
export it.
2011-04-28 09:24:04 +09:00
Damien Elmes
7d64036a07 drop streak, make reps log all entries
reps should now be equal to the number of entries in the revlog, and only
exists so that we can order by review count in the browser efficiently

streak is no longer necessary as we have a learn queue now
2011-04-28 09:24:04 +09:00
Damien Elmes
2243b691cc add full search to ignore formatting 2011-04-28 09:24:03 +09:00
Damien Elmes
03d00228aa support stripping context of cloze 2011-04-28 09:24:03 +09:00
Damien Elmes
aac840f375 remove redundant cardHasTag() 2011-04-28 09:24:03 +09:00
Damien Elmes
84d59e4b01 don't truncate sort field anymore, since we display it in the gui 2011-04-28 09:24:03 +09:00
Damien Elmes
8b747c3aac allow the user to choose if case should be folded 2011-04-28 09:24:03 +09:00
Damien Elmes
d51cd5a433 find & replace 2011-04-28 09:24:03 +09:00
Damien Elmes
93d80678f9 _fields -> fields 2011-04-28 09:24:02 +09:00
Damien Elmes
89673f0c0a if no tags were provided, just return 2011-04-28 09:24:02 +09:00
Damien Elmes
d611299715 make sure add/delTags() is limited to provided ids 2011-04-28 09:24:02 +09:00
Damien Elmes
e344e1a6a8 default to a useful model id on upgrade 2011-04-28 09:24:02 +09:00
Damien Elmes
13a484ea36 allow user to abort schema mod 2011-04-28 09:24:02 +09:00
Damien Elmes
2a225b1fae use the sort property set in the deck 2011-04-28 09:24:02 +09:00
Damien Elmes
d089deae5a add the ability to reverse sort order 2011-04-28 09:24:02 +09:00
Damien Elmes
efe6177c7a refactor ordering 2011-04-28 09:24:02 +09:00
Damien Elmes
a13c18cf4b start refactoring find code 2011-04-28 09:24:01 +09:00
Damien Elmes
2dfdfad6f2 update license link 2011-04-28 09:24:01 +09:00
Damien Elmes
8fcc6b3085 gpl3->agpl 2011-04-28 09:24:01 +09:00
Damien Elmes
c5e7756304 ensure model/template gid exists; mark schema modified when group deleted 2011-04-28 09:24:01 +09:00
Damien Elmes
86a7106eab when deleting a group, update cards and facts too 2011-04-28 09:24:01 +09:00
Damien Elmes
673913a2a8 fix group tree when no cards use a group 2011-04-28 09:24:01 +09:00
Damien Elmes
c682080890 make it easier to get media dir; remove tidyHTML() 2011-04-28 09:24:01 +09:00
Damien Elmes
6ed48171fc add a default group to model, add groupName() 2011-04-28 09:24:01 +09:00
Damien Elmes
c799b7c97e include model name in stdmodels; provide ability to get model outside cache 2011-04-28 09:24:01 +09:00
Damien Elmes
84d2f32685 move graph code into stats.py; remove old deck stats 2011-04-28 09:24:00 +09:00
Damien Elmes
0b92423cf7 settings->options, return bool for syncingEnabled 2011-04-28 09:24:00 +09:00
Damien Elmes
11f3de525f groupConf() takes gcid, not gid 2011-04-28 09:23:59 +09:00
Damien Elmes
692fba2ea3 use the deck's groups instead of holding on to a private copy 2011-04-28 09:23:59 +09:00
Damien Elmes
4b9c6fc822 track gcid additions too 2011-04-28 09:23:59 +09:00
Damien Elmes
f75e2af195 use a single group setting 2011-04-28 09:23:59 +09:00
Damien Elmes
2a1355eb16 make the group tree part of the scheduler instead 2011-04-28 09:23:59 +09:00
Damien Elmes
2d00163323 tree grouping; add column to groups so they can remember tags 2011-04-28 09:23:59 +09:00
Damien Elmes
e547b0586a simplify undo
The undo code was using triggers and a temporary table to write out all changed rows before making a change. This made for powerful undo/redo support, but had some problems:
- creating the tables and triggers wasn't cheap, especially on mobile devices
- likewise, every data modification required writing into two separate databases, almost doubling the amount of writes required
- it was possible to leave the DB in an inconsistent state if an undoable operation is followed by a non-undoable operation that references the undoable operation, and the user then rolls back the undoable operation.

To address these issues, we simplify undo by integrating it with the autosave changes:
- .save() can be passed a name to mark a rollback point. If the user undoes the change, any changes since the last save are lost
- autosaves happen every 5 minutes, and are pushed back on a .save(), so the maximum work a user can lose is 5 minutes.
- reviews are handled separately, so we can let the user undo multiple reviews at once
- if necessary, special cases could be added for other operations like marking

This means that if a user does two damaging operations in a row they won't be able to restore the first one, but such an event is both unlikely, and is also covered by the backups made each time a deck is opened.
2011-04-28 09:23:59 +09:00
Damien Elmes
2d6e9cc186 shorten some queue options 2011-04-28 09:23:59 +09:00
Damien Elmes
2ca9568196 initial graph code reorganization 2011-04-28 09:23:58 +09:00
Damien Elmes
4ff5b81134 return status of scheduler change 2011-04-28 09:23:57 +09:00
Damien Elmes
843e8f3b33 add routine to grab all css 2011-04-28 09:23:57 +09:00
Damien Elmes
942bf43b52 fix stats
they're running now, but need to be sanity checked to make sure they're doing the right thing
2011-04-28 09:23:57 +09:00
Damien Elmes
4477e21369 make sure we load css on model init 2011-04-28 09:23:57 +09:00