Class: Coursemology::Evaluator::Models::ProgrammingEvaluation
- Inherits:
-
Base
- Object
- Flexirest::Base
- Base
- Coursemology::Evaluator::Models::ProgrammingEvaluation
- Extended by:
- ActiveSupport::Autoload
- Defined in:
- lib/coursemology/evaluator/models/programming_evaluation.rb
Defined Under Namespace
Classes: Package
Instance Method Summary collapse
-
#evaluate ⇒ Object
Evaluates the package, and stores the result in this record.
-
#language ⇒ nil, Coursemology::Polyglot::Language
Gets the language for the programming evaluation.
-
#language=(language) ⇒ Object
Sets the language for the programming evaluation.
-
#package ⇒ Coursemology::Evaluator::Models::ProgrammingEvaluation::Package
Obtains the package.
Methods inherited from Base
Instance Method Details
#evaluate ⇒ Object
Evaluates the package, and stores the result in this record.
Call #save to save the record to the server.
47 48 49 50 51 52 53 54 |
# File 'lib/coursemology/evaluator/models/programming_evaluation.rb', line 47 def evaluate result = Coursemology::Evaluator::Services::EvaluateProgrammingPackageService. execute(self) self.stdout = result.stdout self.stderr = result.stderr self.test_report = result.test_report self.exit_code = result.exit_code end |
#language ⇒ nil, Coursemology::Polyglot::Language
Gets the language for the programming evaluation.
17 18 19 |
# File 'lib/coursemology/evaluator/models/programming_evaluation.rb', line 17 def language Coursemology::Polyglot::Language.find_by(type: super) end |
#language=(language) ⇒ Object
Sets the language for the programming evaluation.
25 26 27 28 29 30 |
# File 'lib/coursemology/evaluator/models/programming_evaluation.rb', line 25 def language=(language) return super(language) if language.nil? || language.is_a?(String) fail ArgumentError unless language.is_a?(Coursemology::Polyglot::Language) super(language.class.name) end |
#package ⇒ Coursemology::Evaluator::Models::ProgrammingEvaluation::Package
Obtains the package.
35 36 37 38 39 40 41 |
# File 'lib/coursemology/evaluator/models/programming_evaluation.rb', line 35 def package @package ||= begin body = self.class._plain_request('courses/assessment/programming_evaluations/:id/package', :get, id: id) Package.new(Coursemology::Evaluator::StringIO.new(body)) end end |