Sha256: 1f5d5e3d0eeb2e7a5e689ea3110e6aa9009f97bdfdc157dd85789f7bfb3f6b99
Contents?: true
Size: 791 Bytes
Versions: 17
Compression:
Stored size: 791 Bytes
Contents
module Solvable def submit_solution!(user, attributes={}) assignment, _ = find_assignment_and_submit! user, attributes[:content].to_mumuki_solution(language) try_solve_discussions(user) if assignment.passed? assignment end def run_tests!(params) language.run_tests!(params.merge(locale: locale, expectations: expectations, custom_expectations: custom_expectations)) 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
17 entries across 17 versions & 2 rubygems