From 92d4a0832ab381ecbeb1c249b17bce0d972f060b Mon Sep 17 00:00:00 2001 From: Bart Mesuere Date: Wed, 17 Aug 2016 16:00:40 +0900 Subject: [PATCH 1/5] correctly set submission language. fixes #146 --- app/runner/pythia_submission_runner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/runner/pythia_submission_runner.rb b/app/runner/pythia_submission_runner.rb index 5ad02473db..8b1c984f89 100644 --- a/app/runner/pythia_submission_runner.rb +++ b/app/runner/pythia_submission_runner.rb @@ -95,7 +95,7 @@ def compose_config submission['programming_language'] = @submission.exercise.programming_language # set natural language of submission - submission['natural_language'] = I18n.locale.to_s + submission['natural_language'] = @submission.user.lang # set links to resources in docker container needed for processing submission submission['home'] = File.join(@hidden_path, 'resources', 'judge') From a1009a2c6b2567d723de2116cb61308b1445afa1 Mon Sep 17 00:00:00 2001 From: Bart Mesuere Date: Wed, 17 Aug 2016 16:46:18 +0900 Subject: [PATCH 2/5] fix users page of exercise. Closes #145 --- app/views/exercises/users.html.erb | 16 ++++++++-------- config/locales/views/exercises/en.yml | 5 +++++ config/locales/views/exercises/nl.yml | 5 +++++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/app/views/exercises/users.html.erb b/app/views/exercises/users.html.erb index 6553a80f89..5bb8243216 100644 --- a/app/views/exercises/users.html.erb +++ b/app/views/exercises/users.html.erb @@ -2,17 +2,17 @@
-

Overzicht <%= @exercise.name.titleize %>

+

<%= t ".overview" %> <%= @exercise.name %>

- - - - - + + + + + @@ -24,9 +24,9 @@ <% if :correct == @exercise.status_for(user) %> <%= link_to "correct", @exercise.last_correct_submission(user) %> <% elsif :wrong == @exercise.status_for(user) %> - <%= link_to @exercise.last_submission(user).result, @exercise.last_submission(user) %> + <%= link_to @exercise.last_submission(user).summary, @exercise.last_submission(user) %> <% else %> - niet opgelost + <%= t ".not_solved" %> <% end %> diff --git a/config/locales/views/exercises/en.yml b/config/locales/views/exercises/en.yml index 0cc94e5b50..c359aa13b6 100644 --- a/config/locales/views/exercises/en.yml +++ b/config/locales/views/exercises/en.yml @@ -26,3 +26,8 @@ en: not_found: Sorry, we can't find this exercise. not_accessible: This exercise isn't accessible for students. not_visible: This exercise isn't visible for students. + users: + overview: Overview + solutions: Solutions + speed: Solving speed + not_solved: not solved diff --git a/config/locales/views/exercises/nl.yml b/config/locales/views/exercises/nl.yml index deb2e75c51..18fa16fbb4 100644 --- a/config/locales/views/exercises/nl.yml +++ b/config/locales/views/exercises/nl.yml @@ -27,3 +27,8 @@ nl: not_found: Sorry, we kunnen deze oefening niet vinden. not_accessible: Deze oefening is niet toegankelijk voor studenten. not_visible: Deze oefening is niet zichtbaar voor studenten. + users: + overview: Overzicht + solutions: Oplossingen + speed: Snelheid + not_solved: niet opgelost From a12e7c1a72c31c48a4bde7cc0c03a252d0f12e8e Mon Sep 17 00:00:00 2001 From: Bart Mesuere Date: Wed, 17 Aug 2016 16:48:55 +0900 Subject: [PATCH 3/5] use consistend submission edit icon --- app/views/exercises/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/exercises/show.html.erb b/app/views/exercises/show.html.erb index bd266702d6..5a8524deda 100644 --- a/app/views/exercises/show.html.erb +++ b/app/views/exercises/show.html.erb @@ -11,7 +11,7 @@ <% if policy(@exercise).edit? %>
<%= link_to edit_exercise_path(@exercise), class: "btn btn-primary btn-fab" do %> - + <% end %>
<% end %> From d977ba513ed6e11149b04f799f5c86e8294ec142 Mon Sep 17 00:00:00 2001 From: Bart Mesuere Date: Wed, 17 Aug 2016 16:58:27 +0900 Subject: [PATCH 4/5] better feedback table layout --- app/helpers/renderers/feedback_table_renderer.rb | 6 ++++-- app/views/exercises/show.html.erb | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/helpers/renderers/feedback_table_renderer.rb b/app/helpers/renderers/feedback_table_renderer.rb index 18a578901d..df724e98eb 100644 --- a/app/helpers/renderers/feedback_table_renderer.rb +++ b/app/helpers/renderers/feedback_table_renderer.rb @@ -82,7 +82,7 @@ def group(g) end def testcase(tc) - @builder.div(class: "testcase #{tc[:accepted ? 'correct' : 'wrong']}") do + @builder.div(class: "testcase #{tc[:accepted] ? 'correct' : 'wrong'}") do @builder.div(class: 'col-xs-12 description') do @builder.div(class: 'indicator') do tc[:accepted] ? icon_correct : icon_wrong @@ -112,7 +112,9 @@ def messages(msgs) return if msgs.nil? @builder.div(class: 'col-xs-12 messages') do msgs.each do |msg| - message(msg) + @builder.p(class: 'message') do + message(msg) + end end end end diff --git a/app/views/exercises/show.html.erb b/app/views/exercises/show.html.erb index 5a8524deda..e93c2fcfbc 100644 --- a/app/views/exercises/show.html.erb +++ b/app/views/exercises/show.html.erb @@ -11,7 +11,7 @@ <% if policy(@exercise).edit? %>
<%= link_to edit_exercise_path(@exercise), class: "btn btn-primary btn-fab" do %> - + <% end %>
<% end %> @@ -33,7 +33,7 @@ - + <% end %> From dfdedfab52697c72d0ce4b10f6c49e1a51911154 Mon Sep 17 00:00:00 2001 From: Bart Mesuere Date: Wed, 17 Aug 2016 17:06:01 +0900 Subject: [PATCH 5/5] bump version --- app/views/layouts/application.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index a0b5f64be6..8a8fe75b7f 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -117,7 +117,7 @@
GebruikersnaamNaamStatusOplossingenTijd<%= User.human_attribute_name("username") %><%= User.human_attribute_name("name") %><%= Submission.human_attribute_name("status") %><%= t ".solutions" %><%= t ".speed" %>
<%= @exercise.number_of_submissions_for(user) %>