mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
./check
This commit is contained in:
parent
a365369562
commit
6c540c89f1
5 changed files with 18 additions and 12 deletions
|
@ -10,7 +10,7 @@ from collections.abc import Callable, Generator, Sequence
|
|||
from dataclasses import dataclass
|
||||
from enum import Enum, auto
|
||||
from functools import partial
|
||||
from typing import Any, Literal, Match, Union, cast
|
||||
from typing import Any, Literal, Match, cast
|
||||
|
||||
import aqt
|
||||
import aqt.browser
|
||||
|
|
|
@ -3,13 +3,15 @@
|
|||
import { writable } from "svelte/store";
|
||||
import { bridgeCommand } from "@tslib/bridgecommand";
|
||||
import ReviewerBottom from "./ReviewerBottom.svelte";
|
||||
import type {AnswerButtonInfo} from "./types"
|
||||
import "./index.scss"
|
||||
|
||||
let answerButtons = writable<AnswerButtonInfo[]>([])
|
||||
let remaining = writable<[number, number, number]>([0, 0, 0])
|
||||
let remainingIndex = writable<number>(-1)
|
||||
const answerButtons = writable<AnswerButtonInfo[]>([])
|
||||
const remaining = writable<[number, number, number]>([0, 0, 0])
|
||||
const remainingIndex = writable<number>(-1)
|
||||
|
||||
onMount(() => {
|
||||
/*
|
||||
let timerStopped = false;
|
||||
|
||||
let maxTime = 0;
|
||||
|
@ -31,33 +33,34 @@
|
|||
} else {
|
||||
timeNode.textContent = timeString;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
let intervalId: number | undefined;
|
||||
|
||||
|
||||
function _showQuestion(txt: string, maxTime_: number): void {
|
||||
function _showQuestion(_txt: string, _maxTime_: number): void {
|
||||
_showAnswer([]);
|
||||
globalThis.time = 0;
|
||||
maxTime = maxTime_;
|
||||
// maxTime = maxTime_;
|
||||
// updateTime();
|
||||
|
||||
if (intervalId !== undefined) {
|
||||
clearInterval(intervalId);
|
||||
}
|
||||
|
||||
/*
|
||||
intervalId = setInterval(function() {
|
||||
if (!timerStopped) {
|
||||
globalThis.time += 1;
|
||||
//updateTime();
|
||||
}
|
||||
}, 1000);
|
||||
}, 1000);*/
|
||||
}
|
||||
|
||||
function _showAnswer(info: AnswerButtonInfo[], stopTimer = false): void {
|
||||
function _showAnswer(info: AnswerButtonInfo[], _stopTimer = false): void {
|
||||
console.log(info)
|
||||
answerButtons.set(info);
|
||||
timerStopped = stopTimer;
|
||||
// timerStopped = stopTimer;
|
||||
}
|
||||
|
||||
function _updateRemaining(counts: [number, number, number], idx: number) {
|
||||
|
@ -69,6 +72,7 @@
|
|||
globalThis._showAnswer = _showAnswer;
|
||||
globalThis._updateRemaining = _updateRemaining;
|
||||
|
||||
/*
|
||||
function selectedAnswerButton(): string | undefined {
|
||||
const node = document.activeElement as HTMLElement;
|
||||
if (!node) {
|
||||
|
@ -76,7 +80,7 @@
|
|||
}
|
||||
return node.dataset.ease;
|
||||
}
|
||||
|
||||
*/
|
||||
bridgeCommand("bottomReady");
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<script lang="ts">
|
||||
import { bridgeCommand } from "@tslib/bridgecommand";
|
||||
import type { AnswerButtonInfo } from "./types";
|
||||
|
||||
export let info: AnswerButtonInfo
|
||||
</script>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
import { bridgeCommand } from "@tslib/bridgecommand";
|
||||
import * as tr from "@generated/ftl";
|
||||
import RemainingNumber from "./RemainingNumber.svelte";
|
||||
import type { AnswerButtonInfo } from "./types";
|
||||
|
||||
export let answerButtons: Writable<AnswerButtonInfo[]>
|
||||
export let remaining: Writable<number[]>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
interface AnswerButtonInfo {
|
||||
export interface AnswerButtonInfo {
|
||||
"extra": string,
|
||||
"key": string,
|
||||
"i": number,
|
||||
|
|
Loading…
Reference in a new issue