mirror of
https://github.com/ankitects/anki.git
synced 2025-11-07 13:17:12 -05:00
./check
This commit is contained in:
parent
b6459ced18
commit
8bf232ed79
3 changed files with 15 additions and 8 deletions
|
|
@ -10,9 +10,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
export let info: NextCardDataResponse_AnswerButton;
|
||||
export let state: ReviewerState;
|
||||
|
||||
const labels = [tr.studyingAgain(), tr.studyingHard(), tr.studyingGood(), tr.studyingEasy()]
|
||||
const labels = [
|
||||
tr.studyingAgain(),
|
||||
tr.studyingHard(),
|
||||
tr.studyingGood(),
|
||||
tr.studyingEasy(),
|
||||
];
|
||||
$: label = labels[info.rating];
|
||||
|
||||
</script>
|
||||
|
||||
<span>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
const remainingIndex = writable(0);
|
||||
|
||||
$: button_count = $answerShown ? $answerButtons.length : 1;
|
||||
|
||||
</script>
|
||||
|
||||
<div id="outer" class="fancy">
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
// Copyright: Ankitects Pty Ltd and contributors
|
||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
import { CardAnswer, NextCardDataResponse_AnswerButton, type NextCardDataResponse_NextCardData } from "@generated/anki/scheduler_pb";
|
||||
import {
|
||||
CardAnswer,
|
||||
type NextCardDataResponse_AnswerButton,
|
||||
type NextCardDataResponse_NextCardData,
|
||||
} from "@generated/anki/scheduler_pb";
|
||||
import { nextCardData } from "@generated/backend";
|
||||
import { writable } from "svelte/store";
|
||||
|
||||
|
|
@ -10,7 +14,7 @@ export class ReviewerState {
|
|||
beginAnsweringMs = Date.now();
|
||||
readonly cardClass = writable("");
|
||||
readonly answerButtons = writable<NextCardDataResponse_AnswerButton[]>([]);
|
||||
readonly answerShown = writable(false)
|
||||
readonly answerShown = writable(false);
|
||||
|
||||
iframe: HTMLIFrameElement | undefined = undefined;
|
||||
|
||||
|
|
@ -38,7 +42,7 @@ export class ReviewerState {
|
|||
const question = resp.nextCard?.front || "";
|
||||
this.answerShown.set(false);
|
||||
this.updateHtml(question);
|
||||
this.beginAnsweringMs = Date.now()
|
||||
this.beginAnsweringMs = Date.now();
|
||||
}
|
||||
|
||||
public showAnswer() {
|
||||
|
|
@ -49,12 +53,12 @@ export class ReviewerState {
|
|||
public easeButtonPressed(rating: number) {
|
||||
const states = this.cardData!.states!;
|
||||
|
||||
const newState = ([
|
||||
const newState = [
|
||||
states.again!,
|
||||
states.hard!,
|
||||
states.good!,
|
||||
states.easy!,
|
||||
])[rating]!;
|
||||
][rating]!;
|
||||
|
||||
this.showQuestion(
|
||||
new CardAnswer({
|
||||
|
|
|
|||
Loading…
Reference in a new issue