Logo Search packages:      
Sourcecode: pauker version File versions  Download package

void pauker::program::gui::swing::PaukerFrame::pushCurrentCard (  )  [inline, private]

while repeating cards the user acknowledged that the card was remembered correctly, we have to move the current card one batch further

Definition at line 4169 of file PaukerFrame.java.

References pauker::program::LongTermBatch::addCard(), pauker::program::Lesson::addLongTermBatch(), pauker::program::Lesson::getLongTermBatch(), pauker::program::Card::getLongTermBatchNumber(), pauker::program::Lesson::getNumberOfLongTermBatches(), pauker::program::Lesson::getShortTermList(), pauker::program::Lesson::getUltraShortTermList(), pauker::program::LongTermBatch::removeCard(), pauker::program::Card::setLearned(), somethingHasChanged(), and pauker::program::Card::updateLernedTimeStamp().

                                   {
        switch (Pauker.getLearningPhase()) {
            case REPEATING_USTM:
                currentLesson.getUltraShortTermList().remove(currentCard);
                currentLesson.getShortTermList().add(currentCard);
                break;

            case REPEATING_STM:
                currentLesson.getShortTermList().remove(currentCard);
                if (currentLesson.getNumberOfLongTermBatches() == 0) {
                    currentLesson.addLongTermBatch();
                }
                LongTermBatch longTermBatch = currentLesson.getLongTermBatch(0);
                longTermBatch.addCard(currentCard);
                currentCard.setLearned(true);
                break;

            case REPEATING_LTM:
                // remove card from current long term memory batch
                int longTermBatchNumber = currentCard.getLongTermBatchNumber();
                int nextLongTermBatchNumber = longTermBatchNumber + 1;
                longTermBatch =
                        currentLesson.getLongTermBatch(longTermBatchNumber);
                longTermBatch.removeCard(currentCard);
                // add card to next long term batch
                if (currentLesson.getNumberOfLongTermBatches() ==
                        nextLongTermBatchNumber) {
                    currentLesson.addLongTermBatch();
                }
                LongTermBatch nextLongTermBatch =
                        currentLesson.getLongTermBatch(nextLongTermBatchNumber);
                nextLongTermBatch.addCard(currentCard);
                currentCard.updateLernedTimeStamp();
                break;

            default:
                throw new RuntimeException("unsupported learning phase \"" +
                        Pauker.getLearningPhase() +
                        "\" -> can't find batch of card!");
        }

        // update statistics
        statisticPanel.setLesson(currentLesson);

        if (Pauker.getLearningPhase() != Pauker.LearningPhase.REPEATING_USTM) {
            somethingHasChanged();
        }

        repeatedCardMoved();
    }


Generated by  Doxygen 1.6.0   Back to index