Add disable timer setting and fix per-question time limits
Add a 'Question Timer' toggle to game settings that lets the host disable the countdown timer. When disabled, questions show ∞ instead of a countdown, the host gets an 'End Question' button to manually advance, and all correct answers receive maximum points. Also fix a bug where per-question time limits were ignored — the timer and scoring always used the hardcoded 20-second default instead of each question's individual timeLimit.
This commit is contained in:
parent
bce534486c
commit
d1f82440a1
9 changed files with 94 additions and 31 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useState } from 'react';
|
||||
import { Shuffle, Eye, Flame, TrendingUp, MinusCircle, Award, Info, ChevronDown, ChevronUp, Dices, Users } from 'lucide-react';
|
||||
import { Shuffle, Eye, Flame, TrendingUp, MinusCircle, Award, Info, ChevronDown, ChevronUp, Dices, Users, Timer } from 'lucide-react';
|
||||
import type { GameConfig } from '../types';
|
||||
|
||||
interface GameConfigPanelProps {
|
||||
|
|
@ -263,6 +263,17 @@ export const GameConfigPanel: React.FC<GameConfigPanelProps> = ({
|
|||
</div>
|
||||
</ValueRow>
|
||||
|
||||
|
||||
<ToggleRow
|
||||
icon={<Timer size={20} />}
|
||||
iconActive={config.timerEnabled}
|
||||
label="Question Timer"
|
||||
description="Countdown timer for each question"
|
||||
checked={config.timerEnabled}
|
||||
onChange={(v) => update({ timerEnabled: v })}
|
||||
tooltip="When disabled, questions have no time limit. The host must manually end each question. All correct answers receive maximum points."
|
||||
/>
|
||||
|
||||
<ToggleRow
|
||||
icon={<Shuffle size={20} />}
|
||||
iconActive={config.shuffleQuestions}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue