Skip to content

Commit

Permalink
Remove PairProgrammingExerciseFeedback
Browse files Browse the repository at this point in the history
* Remove view, controller, routes & policy for PairProgrammingExerciseFeedback
* Keep model & database table
  • Loading branch information
kiragrammel committed Oct 13, 2023
1 parent c232a41 commit 4840c5e
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 186 deletions.
16 changes: 0 additions & 16 deletions app/controllers/concerns/redirect_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ module RedirectBehavior
def redirect_after_submit
Rails.logger.debug { "Redirecting user with score:s #{@submission.normalized_score}" }

# TEMPORARY: For the pythonjunior2023 course, we want to have a lot of feedback!
if @submission.redirect_to_survey?
redirect_to_pair_programming_survey
return
end

if @submission.normalized_score.to_d == BigDecimal('1.0')
if redirect_to_community_solution?
redirect_to_community_solution
Expand Down Expand Up @@ -105,16 +99,6 @@ def redirect_to_community_solution?
@community_solution_lock.user == current_user
end

# TEMPORARY: For the pythonjunior2023 course, we introduced a pair programming survey
def redirect_to_pair_programming_survey
url = new_pair_programming_exercise_feedback_path(pair_programming_exercise_feedback: {exercise_id: @exercise.id, submission_id: @submission.id})

respond_to do |format|
format.html { redirect_to(url) }
format.json { render(json: {redirect: url}) }
end
end

def redirect_to_user_feedback
uef = UserExerciseFeedback.find_by(exercise: @exercise, user: current_user)
url = if uef
Expand Down
107 changes: 0 additions & 107 deletions app/controllers/pair_programming_exercise_feedbacks_controller.rb

This file was deleted.

2 changes: 0 additions & 2 deletions app/models/exercise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,6 @@ def valid_submission_deadlines?
private :valid_submission_deadlines?

def needs_more_feedback?(submission)
return false if PairProgramming23Study.experiment_course?(submission.study_group_id)

if submission.normalized_score.to_d == BigDecimal('1.0')
user_exercise_feedbacks.final.size <= MAX_GROUP_EXERCISE_FEEDBACKS
else
Expand Down
26 changes: 26 additions & 0 deletions app/models/pair_programming_exercise_feedback.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,32 @@ class PairProgrammingExerciseFeedback < ApplicationRecord
scope :intermediate, -> { where.not(normalized_score: 1.00) }
scope :final, -> { where(normalized_score: 1.00) }

enum comment: {
difficulty_easy: 0,
difficulty_some_what_easy: 1,
difficulty_ok: 2,
difficulty_some_what_difficult: 3,
difficult_too_difficult: 4,
}, _prefix: true

enum time: {
estimated_time_less_5: 0,

Check warning on line 24 in app/models/pair_programming_exercise_feedback.rb

View workflow job for this annotation

GitHub Actions / lint

[rubocop] reported by reviewdog 🐶 Use normalcase for symbol numbers. Raw Output: app/models/pair_programming_exercise_feedback.rb:24:5: C: Naming/VariableNumber: Use normalcase for symbol numbers.
estimated_time_5_to_10: 1,

Check warning on line 25 in app/models/pair_programming_exercise_feedback.rb

View workflow job for this annotation

GitHub Actions / lint

[rubocop] reported by reviewdog 🐶 Use normalcase for symbol numbers. Raw Output: app/models/pair_programming_exercise_feedback.rb:25:5: C: Naming/VariableNumber: Use normalcase for symbol numbers.
estimated_time_10_to_20: 2,

Check warning on line 26 in app/models/pair_programming_exercise_feedback.rb

View workflow job for this annotation

GitHub Actions / lint

[rubocop] reported by reviewdog 🐶 Use normalcase for symbol numbers. Raw Output: app/models/pair_programming_exercise_feedback.rb:26:5: C: Naming/VariableNumber: Use normalcase for symbol numbers.
estimated_time_20_to_30: 3,

Check warning on line 27 in app/models/pair_programming_exercise_feedback.rb

View workflow job for this annotation

GitHub Actions / lint

[rubocop] reported by reviewdog 🐶 Use normalcase for symbol numbers. Raw Output: app/models/pair_programming_exercise_feedback.rb:27:5: C: Naming/VariableNumber: Use normalcase for symbol numbers.
estimated_time_more_30: 4,

Check warning on line 28 in app/models/pair_programming_exercise_feedback.rb

View workflow job for this annotation

GitHub Actions / lint

[rubocop] reported by reviewdog 🐶 Use normalcase for symbol numbers. Raw Output: app/models/pair_programming_exercise_feedback.rb:28:5: C: Naming/VariableNumber: Use normalcase for symbol numbers.
}, _prefix: true

enum reasons: {
reason_no_partner: 0,
reason_to_difficult_to_find_partner: 1,
reason_faster_alone: 2,
reason_not_working_with_strangers: 3,
reason_want_to_work_alone: 4,
reason_accidentally_alone: 5,
reason_other: 6,
}, _prefix: true

def to_s
'Pair Programming Exercise Feedback'
end
Expand Down
6 changes: 0 additions & 6 deletions app/models/submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,12 @@ def after_late_deadline?
end

def redirect_to_feedback?
return false if PairProgramming23Study.experiment_course?(study_group_id)

# Redirect 10% of users to the exercise feedback page. Ensure, that always the same
# users get redirected per exercise and different users for different exercises. If
# desired, the number of feedbacks can be limited with exercise.needs_more_feedback?(submission)
(contributor_id + exercise.created_at.to_i) % 10 == 1
end

def redirect_to_survey?
cause == 'submit' && pair_programming_exercise_feedback.blank? && PairProgramming23Study.experiment_course?(study_group_id)
end

def own_unsolved_rfc(user)
Pundit.policy_scope(user, RequestForComment).joins(:submission).where(submission: {contributor:}).unsolved.find_by(exercise:)
end
Expand Down
11 changes: 0 additions & 11 deletions app/policies/pair_programming_exercise_feedback_policy.rb

This file was deleted.

31 changes: 0 additions & 31 deletions app/views/pair_programming_exercise_feedbacks/_form.html.slim

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -994,23 +994,18 @@ de:
difficulty_ok: "Die Aufgabenschwierigkeit war genau richtig."
difficulty_some_what_difficult: "Die Aufgabe war etwas zu schwierig."
difficult_too_difficult: "Die Aufgabe war viel zu schwierig."
difficulty: "Schwierigkeit der Aufgabe:"
description: "Vielen Dank für Deine Abgabe! Bevor du die Aufgabe beendest, würden wir uns freuen, wenn Du uns hier Feedback zur Aufgabe gibst."
estimated_time_less_5: "weniger als 5 Minuten"
estimated_time_5_to_10: "zwischen 5 und 10 Minuten"
estimated_time_10_to_20: "zwischen 10 und 20 Minuten"
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 <i>fremden</i> Personen zusammenarbeiten.
reason_want_to_work_alone: Ich arbeite lieber alleine.
reason_accidentally_alone: Ich habe versehentlich alleine an dieser Aufgabe gearbeitet.
reason_other: <i>Sonstiges</i>
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"
difficulty_some_what_easy: "Die Aufgabe war etwas zu einfach"
Expand Down
5 changes: 0 additions & 5 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -994,23 +994,18 @@ en:
difficulty_ok: "The exercise difficulty was just right."
difficulty_some_what_difficult: "The exercise was a bit too difficult."
difficult_too_difficult: "The exercise was far too difficult."
difficulty: "Difficulty of the exercise:"
description: "Thank you for your submission! Before you finish the task, we kindly ask you for feedback for this exercise."
estimated_time_less_5: "less than 5 minutes"
estimated_time_5_to_10: "between 5 and 10 minutes"
estimated_time_10_to_20: "between 10 and 20 minutes"
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 <i>strangers</i>.
reason_want_to_work_alone: I prefer to work alone.
reason_accidentally_alone: I accidentally worked alone on this exercise.
reason_other: <i>Other</i>
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"
difficulty_some_what_easy: "the exercise was somewhat easy"
Expand Down
2 changes: 0 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@

resources :user_exercise_feedbacks, except: %i[show index]

resources :pair_programming_exercise_feedbacks, only: %i[new create]

resources :external_users, only: %i[index show], concerns: :statistics do
resources :exercises do
get :statistics, to: 'exercises#external_user_statistics', on: :member
Expand Down

0 comments on commit 4840c5e

Please sign in to comment.