Offline participation form: ask for missing/remaining pieces
All checks were successful
CI / scan_ruby (push) Successful in 18s
CI / scan_js (push) Successful in 14s
CI / lint (push) Successful in 15s
CI / test (push) Successful in 30s

This commit is contained in:
sto
2025-11-08 09:55:56 +01:00
parent 69a82f4d3f
commit d1df551a0c
12 changed files with 118 additions and 35 deletions

View File

@@ -147,6 +147,8 @@ class ContestsController < ApplicationController
@offline.completed = true
@offline.end_time = Time.now()
@offline.images.attach(params[:offline][:end_image])
@offline.missing_pieces = params[:offline][:missing_pieces]
@offline.remaining_pieces = params[:offline][:remaining_pieces]
if @offline.save
if @contest.puzzles.length > 0
dp = display_time(@offline.end_time.to_i - @offline.start_time.to_i)
@@ -209,6 +211,6 @@ class ContestsController < ApplicationController
end
def offline_end_params
params.expect(offline: [ :completed, :end_image ])
params.expect(offline: [ :completed, :end_image, :remaining_pieces, :missing_pieces ])
end
end