Add right/wrong marking with steal mechanism and question stats
Adds Correct/Wrong buttons to admin panel that track question answer stats across games and implement a steal system where the next team gets one chance to answer if the first team is wrong. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -304,6 +304,43 @@ def seek_audio(game_id):
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
|
||||
@bp.route('/game/<int:game_id>/mark-correct', methods=['POST'])
|
||||
@require_auth
|
||||
def mark_correct(game_id):
|
||||
"""Mark current question as answered correctly by the current turn team"""
|
||||
game = Game.query.get_or_404(game_id)
|
||||
|
||||
try:
|
||||
team = game_service.mark_correct(game, socketio)
|
||||
if team:
|
||||
return jsonify({'message': 'Marked correct', 'team': team.to_dict()}), 200
|
||||
else:
|
||||
return jsonify({'error': 'No current question or team'}), 400
|
||||
|
||||
except Exception as e:
|
||||
db.session.rollback()
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
|
||||
@bp.route('/game/<int:game_id>/mark-wrong', methods=['POST'])
|
||||
@require_auth
|
||||
def mark_wrong(game_id):
|
||||
"""Mark current question as answered incorrectly by the current turn team"""
|
||||
game = Game.query.get_or_404(game_id)
|
||||
|
||||
try:
|
||||
result = game_service.mark_wrong(game, socketio)
|
||||
return jsonify({
|
||||
'message': 'Marked wrong',
|
||||
'steal_active': result['steal_active'],
|
||||
'both_failed': result['both_failed']
|
||||
}), 200
|
||||
|
||||
except Exception as e:
|
||||
db.session.rollback()
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
|
||||
@bp.route('/game/<int:game_id>/advance-turn', methods=['POST'])
|
||||
@require_auth
|
||||
def advance_turn(game_id):
|
||||
|
||||
Reference in New Issue
Block a user