diff --git a/app/assets/javascripts/editor.js.erb b/app/assets/javascripts/editor.js.erb index 4164eb80..2e171bf5 100644 --- a/app/assets/javascripts/editor.js.erb +++ b/app/assets/javascripts/editor.js.erb @@ -703,7 +703,8 @@ $(function() { panel.find('.row .col-sm-9').eq(1).find('.number').eq(0).text((result.score * result.weight).toFixed(2)); panel.find('.row .col-sm-9').eq(1).find('.number').eq(1).text(result.weight); panel.find('.row .col-sm-9').eq(2).text(result.message); - panel.find('.row .col-sm-9').eq(3).find('a').attr('href', '#output-' + index); + panel.find('.row .col-sm-9').eq(3).text(result.error_messages.join(', ')); + panel.find('.row .col-sm-9').eq(4).find('a').attr('href', '#output-' + index); }; var chunkBuffer = [{streamedResponse: true}]; diff --git a/app/views/exercises/implement.html.slim b/app/views/exercises/implement.html.slim index 6ede6d68..728492b6 100644 --- a/app/views/exercises/implement.html.slim +++ b/app/views/exercises/implement.html.slim @@ -66,6 +66,7 @@ = row(label: '.passed_tests', value: t('shared.out_of', maximum_value: 0, value: 0).html_safe) = row(label: 'activerecord.attributes.submission.score', value: t('shared.out_of', maximum_value: 0, value: 0).html_safe) = row(label: '.feedback') + = row(label: '.error_messages') = row(label: '.output', value: link_to(t('shared.show'), '#')) #score data-maximum-score=@exercise.maximum_score data-score=@submission.try(:score) h4 diff --git a/config/locales/de.yml b/config/locales/de.yml index a6ab22c8..f35a5442 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -222,6 +222,7 @@ de: text: 'Ihr Browser unterstützt nicht alle Funktionalitäten, die %{application_name} benötigt. Bitte nutzen Sie einen modernen Browser, um %{application_name} zu besuchen.' title: Ihr Browser wird nicht unterstützt! default_feedback: Sehr gut. Alle Tests waren erfolgreich. + error_messages: Fehlermeldungen feedback: Feedback file: 'Test-Datei %{number} (%{filename})' hint: Tipp diff --git a/config/locales/en.yml b/config/locales/en.yml index b9f7ca80..399e6c66 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -222,6 +222,7 @@ en: text: 'Your browser does not support features required for using %{application_name}. Please access %{application_name} using a modern browser.' title: Your browser is not supported! default_feedback: Well done. All tests have been passed. + error_messages: Error Messages feedback: Feedback file: 'Test File %{number} (%{filename})' hint: Hint diff --git a/lib/py_unit_adapter.rb b/lib/py_unit_adapter.rb index 0e80c593..68cdd200 100644 --- a/lib/py_unit_adapter.rb +++ b/lib/py_unit_adapter.rb @@ -1,6 +1,7 @@ class PyUnitAdapter < TestingFrameworkAdapter COUNT_REGEXP = /Ran (\d+) test/ FAILURES_REGEXP = /FAILED \(failures=(\d+)\)/ + ASSERTION_ERROR_REGEXP = /AssertionError:\s(.*)/ def self.framework_name 'PyUnit' @@ -10,6 +11,7 @@ class PyUnitAdapter < TestingFrameworkAdapter count = COUNT_REGEXP.match(output[:stderr]).captures.first.to_i matches = FAILURES_REGEXP.match(output[:stderr]) failed = matches ? matches.captures.try(:first).to_i : 0 - {count: count, failed: failed} + error_matches = ASSERTION_ERROR_REGEXP.match(output[:stderr]).captures + {count: count, failed: failed, error_messages: error_matches} end end