Beispiel #1
0
  private void resetAfterReviewEarly() {
    Cursor cursor = null;
    long[] ids = null;
    try {
      cursor = AnkiDb.database.rawQuery("SELECT id " + "FROM cards " + "WHERE priority = -1", null);
      if (cursor.moveToFirst()) {
        int count = cursor.getCount();
        ids = new long[count];
        for (int i = 0; i < count; i++) {
          ids[i] = cursor.getLong(0);
          cursor.moveToNext();
        }
      }
    } finally {
      if (cursor != null) cursor.close();
    }

    if (ids != null) {
      updatePriorities(ids);
      flushMod();
    }
    if (reviewEarly || newEarly) {
      reviewEarly = false;
      newEarly = false;
      checkDue();
    }
  }
Beispiel #2
0
 public void unsuspendCards(long[] ids) {
   AnkiDb.database.execSQL(
       "UPDATE cards SET "
           + "priority = 0, "
           + "modified = "
           + String.format(ENGLISH_LOCALE, "%f", (double) (System.currentTimeMillis() / 1000.0))
           + " WHERE id IN "
           + ids2str(ids));
   updatePriorities(ids);
   rebuildCounts(false);
   flushMod();
 }
Beispiel #3
0
 public void setSessionTimeLimit(long num) {
   if (num >= 0) {
     sessionTimeLimit = num;
     flushMod();
   }
 }
Beispiel #4
0
 public void setNewCardsPerDay(int num) {
   if (num >= 0) {
     newCardsPerDay = num;
     flushMod();
   }
 }
Beispiel #5
0
 public void setNewCardOrder(int num) {
   if (num >= 0) {
     newCardOrder = num;
     flushMod();
   }
 }
Beispiel #6
0
 public void setNewCardSpacing(int num) {
   if (num >= 0) {
     newCardSpacing = num;
     flushMod();
   }
 }
Beispiel #7
0
 public void setRevCardOrder(int num) {
   if (num >= 0) {
     revCardOrder = num;
     flushMod();
   }
 }