Merge remote-tracking branch 'origin/master' into error-info
# Conflicts: # app/controllers/concerns/submission_scoring.rb # app/views/application/_navigation.html.slim # config/locales/de.yml # config/locales/en.yml # db/schema.rb
This commit is contained in:
@@ -42,12 +42,12 @@ module Lti
|
||||
private :external_user_email
|
||||
|
||||
def external_user_name(provider)
|
||||
# save person_name_full if supplied. this is the display_name, if it is set.
|
||||
# else only save the firstname, we don't want lastnames (family names)
|
||||
if provider.lis_person_name_full
|
||||
provider.lis_person_name_full
|
||||
elsif provider.lis_person_name_given && provider.lis_person_name_family
|
||||
"#{provider.lis_person_name_given} #{provider.lis_person_name_family}"
|
||||
else
|
||||
provider.lis_person_name_given || provider.lis_person_name_family
|
||||
provider.lis_person_name_given
|
||||
end
|
||||
end
|
||||
private :external_user_name
|
||||
@@ -104,7 +104,7 @@ module Lti
|
||||
private :return_to_consumer
|
||||
|
||||
def send_score(exercise_id, score, user_id)
|
||||
::NewRelic::Agent.add_custom_parameters({ score: score, session: session })
|
||||
::NewRelic::Agent.add_custom_attributes({ score: score, session: session })
|
||||
fail(Error, "Score #{score} must be between 0 and #{MAXIMUM_SCORE}!") unless (0..MAXIMUM_SCORE).include?(score)
|
||||
|
||||
if session[:consumer_id]
|
||||
|
@@ -8,7 +8,7 @@ module SubmissionScoring
|
||||
output = execute_test_file(file, submission)
|
||||
assessment = assessor.assess(output)
|
||||
passed = ((assessment[:passed] == assessment[:count]) and (assessment[:score] > 0))
|
||||
testrun_output = passed ? nil : output[:stderr]
|
||||
testrun_output = passed ? nil : 'message: ' + output[:message].to_s + "\n stdout: " + output[:stdout].to_s + "\n stderr: " + output[:stderr].to_s
|
||||
if !testrun_output.blank?
|
||||
submission.exercise.execution_environment.error_templates.each do |template|
|
||||
pattern = Regexp.new(template.signature).freeze
|
||||
@@ -17,7 +17,7 @@ module SubmissionScoring
|
||||
end
|
||||
end
|
||||
end
|
||||
Testrun.new(submission: submission, file: file, passed: passed, output: testrun_output).save
|
||||
Testrun.new(submission: submission, cause: 'assess', file: file, passed: passed, output: testrun_output).save
|
||||
output.merge!(assessment)
|
||||
output.merge!(filename: file.name_with_extension, message: feedback_message(file, output[:score]), weight: file.weight)
|
||||
end
|
||||
|
Reference in New Issue
Block a user