Skip to content

evandroforks/anki

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anki

Build status

This repo contains the source code for the computer version of Anki.

About

Anki is a spaced repetition program. Please see the website to learn more.

Getting Started

Anki Betas

If you'd like to try development builds of Anki but don't feel comfortable building the code, please see Anki betas

Developing

For more information on building and developing, please see Development.

Contributing

Want to contribute to Anki? Check out the Contribution Guidelines.

Anki Contributors

CONTRIBUTORS

License

Anki's license: LICENSE

For more information on building, please see Development.

iniju, Re: Help understanding acronyms on anki database, https://groups.google.com/g/anki-android/c/pxcjf9in18I Oct 11, 2012, 6:28:58 PM to AnkiDroid, que...@fluidshopping.com Not sure about all of them, since this is port of libanki and the names were decided by Damien, but the cryptic ones:

  1. crt: created time
  2. ver: collection version
  3. scm: schema version
  4. dty: dirty flag?
  5. usn: universal serial number, used during syncs
  6. dconf: deck configuration
  7. mid: model id
  8. cid: card id
  9. nid: note id
  10. did: deck id
  11. oid: old id
  12. odid: old deck id
  13. ivl: interval
  14. reps: number of repetitions
  15. ord: ordinal?
  16. csum: checksum
  17. flds: fields
  18. odue: old due value

But all this comes from libanki of the anki project, so you're probably better off if you base your analysis on the original.

Cheers Kostas

On Tuesday, 9 October 2012 20:56:04 UTC+1, urlwolf wrote: Hi, First of all, congrats on ankiDroid 2. I've used ankiDroid since Jan 2011 and the improvements in speed are very noticeable.

I'm considering whether it'd be possible to write a webapp (unrelated to languages) that would interface with anki/ankiDroid. For that, I'm thinking the scheduler algo must be mostly the same. Is this correct?

I'm reading the code. First I want to understand the database. I guess the place to start would be:

private static void _addSchema(AnkiDb db, boolean setColConf) {
        db.execute("create table if not exists col ( " + "id              integer primary key, "
                + "crt             integer not null," + "mod             integer not null,"
                + "scm             integer not null," + "ver             integer not null,"
                + "dty             integer not null," + "usn             integer not null,"
                + "ls              integer not null," + "conf            text not null,"
                + "models          text not null," + "decks           text not null,"
                + "dconf           text not null," + "tags            text not null" + ");");
        db.execute("create table if not exists notes (" + "   id              integer primary key,"
                + "  guid            text not null," + " mid             integer not null,"
                + " mod             integer not null," + " usn             integer not null,"
                + " tags            text not null," + " flds            text not null,"
                + " sfld            integer not null," + " csum            integer not null,"
                + " flags           integer not null," + " data            text not null" + ");");
        db.execute("create table if not exists cards (" + "   id              integer primary key,"
                + "  nid             integer not null," + "  did             integer not null,"
                + "  ord             integer not null," + "  mod             integer not null,"
                + " usn             integer not null," + " type            integer not null,"
                + " queue           integer not null," + "    due             integer not null,"
                + "   ivl             integer not null," + "  factor          integer not null,"
                + " reps            integer not null," + "   lapses          integer not null,"
                + "   left            integer not null," + "   odue            integer not null,"
                + "   odid            integer not null," + "   flags           integer not null,"
                + "   data            text not null" + ");");
        db.execute("create table if not exists revlog (" + "   id              integer primary key,"
                + "   cid             integer not null," + "   usn             integer not null,"
                + "   ease            integer not null," + "   ivl             integer not null,"
                + "   lastIvl         integer not null," + "   factor          integer not null,"
                + "   time            integer not null," + "   type            integer not null" + ");");
        db.execute("create table if not exists graves (" + "    usn             integer not null,"
                + "    oid             integer not null," + "    type            integer not null" + ")");
        db.execute("INSERT OR IGNORE INTO col VALUES(1,0,0," +
                Utils.intNow(1000) + "," + Collection.SCHEMA_VERSION +
                ",0,0,0,'','{}','','','{}')");
        if (setColConf) {
            _setColVars(db);
        }
    }

But the column names don't make any sense to me. They look like acronyms. Is this documented anywhere? If no documentation (no worries!) Is there any other way I could guess the names?

Thanks!