Sha256: b872d0a33a679f4c1c57998c2cd8022918d48050bcd8205ca1b2cd3ee460ed08
Contents?: true
Size: 975 Bytes
Versions: 66
Compression:
Stored size: 975 Bytes
Contents
module Solvable def submit_solution!(user, submission_attributes={}) assignment, _ = find_assignment_and_submit! user, solution_for(submission_attributes) try_solve_discussions!(user) if assignment.solved? assignment end def run_tests!(params) language.run_tests!(params.merge(locale: locale, expectations: expectations, custom_expectations: custom_expectations)) end def solution_for(submission_attributes) submission_attributes[:content] .to_mumuki_solution(language) .with_client_result(submission_attributes[:client_result]) end end class NilClass def to_mumuki_solution(language) Mumuki::Domain::Submission::Solution.new end end class String def to_mumuki_solution(language) Mumuki::Domain::Submission::Solution.new content: normalize_whitespaces end end class Hash def to_mumuki_solution(language) language .directives_sections .join(self) .to_mumuki_solution(language) end end
Version data entries
66 entries across 66 versions & 2 rubygems