proof.rb revision 54f2fe542bbb8735c8c4aa653e01f72f9cc88122
970N/A# The Proof class is not supposed to be stored in the database. Its purpose is 970N/A# to allow for an easy way to create proving commands in the RESTful manner. 970N/A# It is called Proof to comply with the ProofsController which in turn gets 970N/A# called on */proofs routes. 1072N/A# This class prepares the proving procedure and creates the models which are 970N/A# presented in the UI (ProofAttempt). 970N/A # This is needed for the validations to run. 970N/A # HACK: Remove the empty string from params. 1105N/A # Rails 4.2 introduces the html form option :include_hidden for this task. 1105N/A def build_axiom_selection(opts) 970N/A send("build_#{axiom_selection_method}", opts) if AxiomSelection::METHODS.include?(axiom_selection_method) 970N/A def build_manual_axiom_selection(opts) 970N/A axiom_ids = normalize_check_box_ids(opts[:proof][:axioms]) 970N/A @specific_axiom_selection = ManualAxiomSelection.new 970N/A specific_axiom_selection.axioms = 970N/A axiom_ids.map { |id| Axiom.unscoped.find(id) } 1105N/A @axiom_selection = @specific_axiom_selection.axiom_selection 970N/A def build_sine_axiom_selection(opts) 970N/A SineAxiomSelection.new(opts[:proof][:sine_axiom_selection]) 970N/A proof_attempts.each do |proof_attempt| 970N/A if prove_asynchronously 970N/A ProofExecutionWorker.perform_async(proof_attempt.id) 970N/A ProofExecutionWorker.new.perform(proof_attempt.id)