use of com.ichi2.libanki.sched.AbstractSched in project Anki-Android by ankidroid.
the class AbstractSchedTest method regression_7066.
@Test
public void regression_7066() {
Collection col = getCol();
DeckConfig dconf = col.getDecks().getConf(1);
dconf.getJSONObject("new").put("bury", true);
AbstractSched sched = col.getSched();
addNoteUsingBasicAndReversedModel("foo", "bar");
addNoteUsingBasicModel("plop", "foo");
col.reset();
Card card = sched.getCard();
sched.setCurrentCard(card);
sched.preloadNextCard();
sched.answerCard(card, Consts.BUTTON_THREE);
card = sched.getCard();
sched.setCurrentCard(card);
AnkiAssert.assertDoesNotThrow(sched::preloadNextCard);
}
use of com.ichi2.libanki.sched.AbstractSched in project Anki-Android by ankidroid.
the class CollectionTask method nonTaskUndo.
@VisibleForTesting
public static Card nonTaskUndo(Collection col) {
AbstractSched sched = col.getSched();
Card card = col.undo();
if (card == null) {
/* multi-card action undone, no action to take here */
Timber.d("Multi-select undo succeeded");
} else {
// cid is actually a card id.
// a review was undone,
/* card review undone, set up to review that card again */
Timber.d("Single card review undo succeeded");
card.startTimer();
col.reset();
sched.deferReset(card);
}
return card;
}
Aggregations