From 930d532fb629a1d2e8ddbe59b56a7c2e11416286 Mon Sep 17 00:00:00 2001 From: kiragrammel Date: Wed, 6 Sep 2023 14:54:12 +0200 Subject: [PATCH] Add third question in pp exercise feedback --- .../pair_programming_exercise_feedbacks_controller.rb | 11 +++++++++++ .../_form.html.slim | 8 ++++++++ config/locales/de.yml | 10 +++++++++- config/locales/en.yml | 8 ++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/app/controllers/pair_programming_exercise_feedbacks_controller.rb b/app/controllers/pair_programming_exercise_feedbacks_controller.rb index 7c069525..db74bcbd 100644 --- a/app/controllers/pair_programming_exercise_feedbacks_controller.rb +++ b/app/controllers/pair_programming_exercise_feedbacks_controller.rb @@ -22,6 +22,16 @@ class PairProgrammingExerciseFeedbacksController < ApplicationController [4, t('pair_programming_exercise_feedback.estimated_time_more_30')]] end + def reasons_presets + [[0, t('pair_programming_exercise_feedback.reason_no_partner')], + [1, t('pair_programming_exercise_feedback.reason_to_difficult_to_find_partner')], + [2, t('pair_programming_exercise_feedback.reason_faster_alone')], + [3, t('pair_programming_exercise_feedback.reason_not_working_with_strangers')], + [4, t('pair_programming_exercise_feedback.reason_want_to_work_alone')], + [5, t('pair_programming_exercise_feedback.reason_accidentally_alone')], + [6, t('pair_programming_exercise_feedback.reason_other')]] + end + def new exercise_id = if params[:pair_programming_exercise_feedback].nil? params[:exercise_id] @@ -64,6 +74,7 @@ class PairProgrammingExerciseFeedbacksController < ApplicationController def set_presets @texts = comment_presets.to_a @times = time_presets.to_a + @reasons = reasons_presets.to_a end def uef_params diff --git a/app/views/pair_programming_exercise_feedbacks/_form.html.slim b/app/views/pair_programming_exercise_feedbacks/_form.html.slim index 41c2d217..da6373f3 100644 --- a/app/views/pair_programming_exercise_feedbacks/_form.html.slim +++ b/app/views/pair_programming_exercise_feedbacks/_form.html.slim @@ -18,6 +18,14 @@ label.form-check-label = b.radio_button(class: 'form-check-input') = b.text + - if PairProgramming23Study.participate?(current_user, @exercise) && !current_contributor.programming_group? + h5.mt-4 = t('pair_programming_exercise_feedback.reason_work_alone') + = f.collection_radio_buttons :reason_work_alone, @reasons, :first, :last do |b| + .form-check + label.form-check-label + = b.radio_button(class: 'form-check-input') + == b.text + = f.hidden_field(:exercise_id, :value => @exercise.id) = f.hidden_field(:submission_id, :value => @submission.id) .actions = render('shared/submit_button', f: f, object: @uef) diff --git a/config/locales/de.yml b/config/locales/de.yml index fd566648..6a8d5bb2 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -602,7 +602,7 @@ de: find_partner_title: "Finde eine:n Programmierpartner:in für die Aufgabe" find_partner_description: "Kopiere eine andere Nutzer-ID aus der Liste unten und lösche sie anschließend. Wenn noch keine Nutzer-IDs in der Liste vorhanden sind, füge deine Nutzer-ID hinzu und warte, bis ein andere:r Nutzer:in ein Programmierpaar mit dir erstellt. Dies kannst du mit dem Knopf 'Einladung prüfen' testen. Wenn du allein arbeiten möchtest, lösche bitte deine Nutzer-ID aus der Liste, falls du sie hinzugefügt hast." own_user_id: "Deine Nutzer-ID:" - work_alone: "Du kannst dich einmalig dafür entscheiden, die Aufgabe alleine zu bearbeiten. Anschließend kannst du jedoch nicht mehr in die Partnerarbeit für diese Aufgabe wechseln. Klicke hier, um die Aufgabe im Einzelmodus zu starten." + work_alone: "Du kannst dich einmalig dafür entscheiden, die Aufgabe alleine zu bearbeiten. Anschließend kannst du jedoch nicht mehr in die Partnerarbeit für diese Aufgabe wechseln. Klicke hier, um die Aufgabe im Einzelmodus zu starten." external_users: statistics: title: Statistiken für Externe Benutzer @@ -992,6 +992,14 @@ de: estimated_time_20_to_30: "zwischen 20 und 30 Minuten" estimated_time_more_30: "mehr als 30 Minuten" working_time: "Geschätze Bearbeitungszeit für diese Aufgabe:" + reason_no_partner: Ich habe keine:n Team-Partner:in gefunden. + reason_to_difficult_to_find_partner: Es war zu schwierig/aufwändig, eine:n Team Partner:in zu finden. + reason_faster_alone: Es ging schneller alleine zu arbeiten. + reason_not_working_with_strangers: Ich möchte nicht mit fremden Personen zusammenarbeiten. + reason_want_to_work_alone: Ich arbeite lieber alleine. + reason_accidentally_alone: Ich habe versehentlich alleine an dieser Aufgabe gearbeitet. + reason_other: Sonstiges + reason_work_alone: Warum hast Du Dich dafür entschieden die Aufgabe alleine zu lösen? no_feedback: "Es wurde noch kein Feedback zu dieser Aufgabe gegeben." user_exercise_feedback: difficulty_easy: "Die Aufgabe war zu einfach" diff --git a/config/locales/en.yml b/config/locales/en.yml index ff2987c8..d3469ced 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -992,6 +992,14 @@ en: estimated_time_20_to_30: "between 20 and 30 minutes" estimated_time_more_30: "more than 30 minutes" working_time: "Estimated time working on this exercise:" + reason_no_partner: I have not found a team partner. + reason_to_difficult_to_find_partner: It was too difficult to find a team partner. + reason_faster_alone: It was faster to work alone. + reason_not_working_with_strangers: I do not want to work with strangers. + reason_want_to_work_alone: I prefer to work alone. + reason_accidentally_alone: I accidentally worked alone on this exercise. + reason_other: Other + reason_work_alone: Why did you decide to solve this exercise alone? no_feedback: "There is no feedback for this exercise yet." user_exercise_feedback: difficulty_easy: "the exercise was too easy"