Add hint and partial scoring
This commit is contained in:
@@ -25,6 +25,13 @@
|
||||
return findQuestion(set, ref) ?? null;
|
||||
});
|
||||
|
||||
/** Раскрывал ли ведущий подсказку для текущего открытого вопроса. */
|
||||
const hintUsedForCurrent = $derived.by(() => {
|
||||
const ref = $game.current;
|
||||
if (!ref) return false;
|
||||
return $game.hintUsed.includes(ref);
|
||||
});
|
||||
|
||||
// ---- Действия ведущего ----
|
||||
|
||||
function selectSet(id: string) {
|
||||
@@ -54,6 +61,13 @@
|
||||
game.rejectQuestion(ref);
|
||||
}
|
||||
|
||||
/** Ведущий раскрыл подсказку по текущему вопросу — сохраняем в состоянии. */
|
||||
function markCurrentHintUsed() {
|
||||
const ref = $game.current;
|
||||
if (!ref) return;
|
||||
game.markHintUsed(ref);
|
||||
}
|
||||
|
||||
function randomQuestion() {
|
||||
const set = $currentSet;
|
||||
if (!set) return;
|
||||
@@ -176,6 +190,8 @@
|
||||
<QuestionModal
|
||||
category={currentQuestionData.category}
|
||||
question={currentQuestionData.question}
|
||||
hintUsed={hintUsedForCurrent}
|
||||
onMarkHintUsed={markCurrentHintUsed}
|
||||
onAward={awardQuestion}
|
||||
onReject={rejectQuestion}
|
||||
onClose={closeQuestion}
|
||||
|
||||
Reference in New Issue
Block a user