Prevent duplicated 'pp_work_alone' events.
* Ensure only one `pp_work_alone` event is stored. * Disable Turbolinks for Programming Groups Work Alone, so that the implement page is requested normally. Otherwise, Turbolinks would load the page first, just to notice that it needs to reload the page afterwards to include Highlight.js for the tips.
This commit is contained in:
@ -316,7 +316,7 @@ class ExercisesController < ApplicationController
|
||||
session[:pg_id] = pg.id
|
||||
@current_contributor = pg
|
||||
elsif session[:pg_id].blank? && PairProgramming23Study.participate?(current_user, @exercise) && current_user.submissions.where(study_group_id: current_user.current_study_group_id, exercise: @exercise).none?
|
||||
Event.create(category: 'pp_work_alone', user: current_user, exercise: @exercise, data: nil, file_id: nil)
|
||||
Event.find_or_create_by(category: 'pp_work_alone', user: current_user, exercise: @exercise, data: nil, file_id: nil)
|
||||
current_user.pair_programming_waiting_users&.find_by(exercise: @exercise)&.update(status: :worked_alone)
|
||||
end
|
||||
|
||||
|
@ -608,7 +608,7 @@ de:
|
||||
own_user_id: "Deine Nutzer-ID:"
|
||||
pair_programming_info: Pair Programming Info
|
||||
work_alone: "Alleine arbeiten"
|
||||
work_alone_description: "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. <br> <a href=%{path}>Klicke hier, um die Aufgabe im Einzelmodus zu starten.</a>"
|
||||
work_alone_description: "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. <br> <a href=%{path} data-turbolinks=\"false\">Klicke hier, um die Aufgabe im Einzelmodus zu starten.</a>"
|
||||
work_with_a_friend: "Mit einem/einer Freund:in zusammenarbeiten"
|
||||
implement:
|
||||
info_disconnected: Ihre Verbindung zum Server wurde unterbrochen. Bitte überprüfen Sie Ihre Internetverbindung und laden Sie die Seite erneut.
|
||||
|
@ -608,7 +608,7 @@ en:
|
||||
own_user_id: "Your user ID:"
|
||||
pair_programming_info: Pair Programming Info
|
||||
work_alone: Work Alone
|
||||
work_alone_description: "You can choose once to work on the exercise alone. Afterward, however, you will not be able to switch to work in a pair for this exercise. <br> <a href=%{path}>Click here to get to the exercise in single mode.</a>"
|
||||
work_alone_description: "You can choose once to work on the exercise alone. Afterward, however, you will not be able to switch to work in a pair for this exercise. <br> <a href=%{path} data-turbolinks=\"false\">Click here to get to the exercise in single mode.</a>"
|
||||
work_with_a_friend: "Work with a friend"
|
||||
implement:
|
||||
info_disconnected: You are disconnected from the server. Please check your internet connection and reload the page.
|
||||
|
Reference in New Issue
Block a user