Sha256: 6e65fdd48173a8cf2d2083606eb5d6135ac2e7d8fa37c7373129b0956af5689f
Contents?: true
Size: 791 Bytes
Versions: 8
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.solved? 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
8 entries across 8 versions & 2 rubygems