Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
01c387e
Update Rails dependency to 8.0.2
Splines Jun 11, 2025
b02547d
Perform update via `bin/rails app:update` & manually review
Splines Jun 11, 2025
ebe0bc5
Fix load defaults version
Splines Jun 11, 2025
5dfcdb6
Upgrade schema file
Splines Jun 11, 2025
9665c60
Remove cache control header for test environment
Splines Jun 11, 2025
cb7d6a9
Fix RuboCop errors (mainly new `params.expect()` unsafe autocorrects)
Splines Jun 11, 2025
128f0f9
Patch Devise for Rails 8
Splines Jun 15, 2025
895e4bd
Fix incorrect array syntax in params
Splines Jun 15, 2025
26c1a7d
Don't require an array for quizzes
Splines Jun 15, 2025
a7064ce
Remove array for question_attributes in vignettes
Splines Jun 15, 2025
b89605b
Use permit for structure_params & remove unused comment_params
Splines Jun 15, 2025
ffc0247
Expect lecture updates to fail (due to params being stricter)
Splines Jun 15, 2025
96d80f0
Fix invalid syntax for course controller
Splines Jun 15, 2025
0db5337
Merge branch 'next' into deps/rails-8
Splines Jul 5, 2025
2eb35c5
Fix vignette @answers=nil error during preview
Splines Jul 5, 2025
1a34ed2
Fix missing `basics.division` translation
Splines Jul 5, 2025
4daa184
Permit `ValidationContext` class in `YAML.safe_load()`
Splines Jul 5, 2025
47cfb6c
Remove duplicate config line
Splines Jul 5, 2025
76f728c
Remove webpacker and sass-rails & add basic vite_rails config
Splines Jul 6, 2025
d8579d2
Move vite_client_tag to global _head file
Splines Jul 6, 2025
95df0b5
Init basic bootstrap setup
Splines Jul 6, 2025
410c124
Remove webpack-dev-server
Splines Jul 6, 2025
2756918
Merge branch 'next' into deps/vite
Splines Jul 6, 2025
dde73cc
Use jquery with Vite (remove Ruby gem)
Splines Jul 6, 2025
c8567a5
Remove Sprockets (first migration step)
Splines Jul 6, 2025
9ec1c8d
Delete webpacker configuration 🥳
Splines Jul 6, 2025
4a0f633
Revert "Remove Sprockets (first migration step)"
Splines Jul 7, 2025
8636b90
Remove empty API assets (legacy)
Splines Jul 7, 2025
77206fb
Move stylesheets from `app/assets/stylesheets` to `app/frontend/entry…
Splines Jul 7, 2025
57f0902
Remove jquery-ui (not to confuse with jQuery itself)
Splines Jul 7, 2025
c102fdf
Use Vite tag helpers
Splines Jul 7, 2025
5ac088f
Remove old `app/javascript` folder (and move code to `application.js`)
Splines Jul 7, 2025
41da60a
Fix Bootstrap SCSS imports
Splines Jul 7, 2025
00f5a70
Add back in bootstrap_form gem
Splines Jul 7, 2025
d6bdcdf
Move stylesheets to subfolder
Splines Jul 7, 2025
f438fdc
Fix no default import of `friendly-challenge`
Splines Jul 7, 2025
de82e35
Update vite_stylesheet_tag subfolder & use explicit file endings
Splines Jul 7, 2025
6d91ee4
Place javascript files in frontend folder
Splines Jul 7, 2025
726ceea
Add back in rails-sass only for sprockets pipeline
Splines Jul 7, 2025
9934458
Correct vite_javascript_tag paths for subfolder usage
Splines Jul 7, 2025
4da0215
Use vite_image_tag instead of image_tag & correct paths
Splines Jul 7, 2025
5579760
Convert sprocket requires to js imports
Splines Jul 7, 2025
8792076
Use "~/" instead of "@/"
Splines Jul 7, 2025
2e94bb6
Add coffeescript Vite plugin & fix js imports
Splines Jul 7, 2025
260f587
Use image_tag for urls & add missing .scss file extension
Splines Jul 7, 2025
10f7d6f
Include all bootstrap stylesheets
Splines Jul 7, 2025
7f387eb
Fix CSS url path
Splines Jul 7, 2025
3a09b21
Fix fonts path
Splines Jul 7, 2025
f5412ca
Remove console.log
Splines Jul 7, 2025
e0e9d28
Configure Vite in Docker Compose
Splines Jul 7, 2025
891dba5
Load coffee plugin first to then inject JQuery
Splines Jul 7, 2025
09c7738
Use turbolinks npm package instead of gem
Splines Jul 7, 2025
ee14c5a
Init fixing JS reference errors by using new ES6 import syntax
Splines Jul 7, 2025
e7ac3a7
Fix masonry & bootstrap/jquery issues
Splines Jul 7, 2025
e0d50b7
Rework einstein tiles p5 code for modern JS
Splines Jul 7, 2025
81d421b
Bring back public assets to respective folder
Splines Jul 7, 2025
f354bad
Rework Thyme-related JS files
Splines Jul 7, 2025
4b97edc
Globally define `initBootstrapPopovers`
Splines Jul 7, 2025
1b16b72
Remove coffeescript Rails gem
Splines Jul 7, 2025
f82ab3e
Also initialize bootstrap popovers on page load
Splines Jul 7, 2025
46359cc
Import bootstrap Toast for feedback JS
Splines Jul 7, 2025
f779bbe
Ignore SASS legacy API warnings
Splines Jul 7, 2025
12f3722
Add back in missing p5 dependency
Splines Jul 7, 2025
8361787
Setup js_routes for use with Vite
Splines Jul 7, 2025
ac1c946
Remove webpack-related npm packages
Splines Jul 7, 2025
d348c3c
Remove core-js dependency
Splines Jul 7, 2025
e3e5a5a
Remove regenerator-runtime
Splines Jul 7, 2025
aaf3dbc
Remove coffeescript dependency
Splines Jul 7, 2025
e20ba8a
Remove console.logs()
Splines Jul 7, 2025
837c7db
Use production rails env for CI_CD asset bundling
Splines Jul 7, 2025
1bd7536
Don't import Thyme-related components everywhere
Splines Jul 7, 2025
eedd106
Add back in coffee-rails
Splines Jul 7, 2025
49f082e
Add in Rails UJS (before migration to Turbo)
Splines Jul 7, 2025
ba74207
Use window-scope for reloadUrl helper function
Splines Jul 7, 2025
acefcc4
Fix bootstrap stylesheet import in emails
Splines Jul 7, 2025
1982a56
Add just command to simulate Vite production build
Splines Jul 7, 2025
e2a0b04
Remove accidentally commited mampf_routes
Splines Jul 7, 2025
da20b2f
Use Sprocket pipeline for Commontator & Thredded assets
Splines Jul 8, 2025
2181b1f
Add back in devise-bootstrap-views
Splines Jul 8, 2025
acab846
Lint vite config & add back in Node globals to ESLint
Splines Jul 8, 2025
9026bc4
Merge branch 'next' into deps/vite
Splines Jul 16, 2025
c044478
Remove sass-loader dependency
Splines Jul 16, 2025
aa5317f
Remove clicker sprocket syntax
Splines Jul 16, 2025
7dece48
Fix geogebra assets inclusion
Splines Jul 16, 2025
0e807fb
Fix missing Category import
Splines Jul 16, 2025
4361f1c
Fix line too long
Splines Jul 16, 2025
1a9d5b4
Fix talks.coffee -> talke.js & group according to JS/coffee
Splines Jul 16, 2025
21a93d3
Configure vite for tests
Splines Jul 17, 2025
d6c97ea
Align test with dev Ruby environment
Splines Jul 17, 2025
897d068
Remove premailer rails
Splines Jul 17, 2025
6a47af5
Fix vite ruby host
Splines Jul 17, 2025
2f4c267
Fix js-routes issues due to multiple recompiling
Splines Jul 17, 2025
b954c67
Merge branch 'next' into deps/vite
Splines Jul 17, 2025
52d09b4
Only recompile js-routes once at container start
Splines Jul 17, 2025
d77d8ba
Fix lectures people select spec
Splines Jul 17, 2025
0497b48
Use Turbolinks as Ruby Gem again
Splines Jul 18, 2025
76a6e51
Fix setSelectedRange on undefined bug
Splines Jul 18, 2025
7095828
Fix new lecture specs
Splines Jul 18, 2025
85b3a3e
Fix annotations overview tests
Splines Jul 18, 2025
ada607b
Fix commontator JS calling
Splines Jul 18, 2025
2aba38e
Don't manually set NODE_ENV in entrypoint script
Splines Jul 18, 2025
b892016
Add missing backslash to Dockerfile
Splines Jul 18, 2025
2a32df1
Print node env
Splines Jul 18, 2025
52c4dfe
Avoid test failure by not using ampersand HTML entity
Splines Jul 18, 2025
e960d97
Fix mixed JS/coffeescript (Erdbeere)
Splines Jul 18, 2025
8965c33
Build assets in CI/CD using test env
Splines Jul 18, 2025
e81f456
Don't explicitly specify NODE_ENV
Splines Jul 18, 2025
79314a9
Try to also set database url to empty string
Splines Jul 18, 2025
1f5a6ca
Try to not init Rails app during asset precompilation
Splines Jul 18, 2025
d625f7a
Unify database adapter env variables
Splines Jul 18, 2025
bf9b4bd
Use new env variable in all places
Splines Jul 18, 2025
95c8b13
Don't use vite_image_tag for email attachment urls
Splines Jul 18, 2025
39bd7a3
Use autobuild for tests such that RSpec tests work
Splines Jul 18, 2025
9e08eaf
Use Vite Dev Server also for local tests
Splines Jul 18, 2025
f343251
Don't use anonymous volume for public folder in tests
Splines Jul 18, 2025
58b53a0
Remove webpacker env variable
Splines Jul 18, 2025
c988051
Fix rspec mampf container start (watch for exception)
Splines Jul 18, 2025
44eed7c
Don't use any extra volume for public folder
Splines Jul 18, 2025
f405715
Try again to create an anonymous volume for `public/`
Splines Jul 18, 2025
3eb57bf
Refactor interactions: remove export_interactions functionality and r…
fosterfarrell9 Jul 20, 2025
7d32e55
Remove interactions functionality and related code
fosterfarrell9 Jul 20, 2025
556126b
Remove study participant references from quizzes and related views
fosterfarrell9 Jul 20, 2025
0c28aae
Remove interactions table and related columns from probes and users
fosterfarrell9 Jul 20, 2025
33e2681
Remove commented-out remark_details method and related code from Quiz…
fosterfarrell9 Jul 20, 2025
6adb0d8
Rename session_id to attempt_token across models, views, and factories
fosterfarrell9 Jul 20, 2025
ac37cdc
Fix typo
fosterfarrell9 Jul 20, 2025
be99862
Merge branch 'next' into features/remove-interactions
Splines Jul 24, 2025
61c8365
Remove PR-unrelated space
Splines Jul 24, 2025
d72ddb7
Rework migration timestamps
Splines Aug 3, 2025
c52c572
Apply change from next branch
Splines Aug 3, 2025
72987f9
Remove unnecessary top-level comment
Splines Aug 3, 2025
aeeb0f9
Initialize attempt_token with a unique identifier in progress_counter…
fosterfarrell9 Aug 3, 2025
174be9c
Add index on attempt_token and correct columns in probes table
fosterfarrell9 Aug 3, 2025
d6b465e
Refactor probe success calculation to use a transaction and prevent r…
fosterfarrell9 Aug 3, 2025
2b37afb
Revert "Refactor probe success calculation to use a transaction and p…
fosterfarrell9 Aug 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions app/abilities/interaction_ability.rb

This file was deleted.

22 changes: 0 additions & 22 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class ApplicationController < ActionController::Base
before_action :configure_permitted_parameters, if: :devise_controller?
before_action :authenticate_user!
before_action :set_locale
after_action :store_interaction, if: :user_signed_in?
before_action :set_current_user

etag { current_user.try(:id) }
Expand Down Expand Up @@ -100,27 +99,6 @@ def set_locale
cookies[:locale] = I18n.locale
end

def store_interaction
return if controller_name.in?(["sessions", "administration", "users",
"events", "interactions", "profile",
"registrations"])
return if controller_name == "main" && action_name == "home"
return if controller_name == "tags" && action_name.in?(["fill_tag_select",
"fill_course_tags"])

study_participant = current_user.anonymized_id if current_user.study_participant
# as of Rack 2.0.8, the session_id is wrapped in a class of its own
# it is not a string anymore
# see https://github.com/rack/rack/issues/1433

return if request.session_options[:id].nil?

InteractionSaver.perform_async(request.session_options[:id].public_id,
request.original_fullpath,
request.referer,
study_participant)
end

def locale_param
return unless params[:locale].in?(available_locales)

Expand Down
44 changes: 0 additions & 44 deletions app/controllers/interactions_controller.rb

This file was deleted.

3 changes: 0 additions & 3 deletions app/controllers/quizzes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ def init_values
else
params
end
if user_signed_in? && current_user.study_participant
quiz_round_params[:study_participant] = current_user.anonymized_id
end

quiz_round_params[:save_probe] =
if user_signed_in?
Expand Down
20 changes: 0 additions & 20 deletions app/models/interaction.rb

This file was deleted.

19 changes: 0 additions & 19 deletions app/models/probe.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
require "csv"

class Probe < InteractionsRecord
scope :created_between, lambda { |start_date, end_date|
where(created_at: start_date.beginning_of_day..end_date.end_of_day)
}

def self.finished_quizzes(quiz)
Probe.where(quiz_id: quiz.id, progress: -1).count
end
Expand Down Expand Up @@ -45,17 +39,4 @@ def self.local_success_in_quiz(quiz)
end
results
end

def self.to_csv
attributes = ["id", "session_id", "created_at", "quiz_id", "question_id", "remark_id",
"correct", "progress", "success", "study_participant", "input"]

CSV.generate(headers: true) do |csv|
csv << attributes

all.each do |probe|
csv << attributes.map { |attr| probe.send(attr) }
end
end
end
end
32 changes: 6 additions & 26 deletions app/models/quiz_round.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# QuizRound class
# service model for quizzes_controller
class QuizRound
include ActiveModel::Validations
attr_reader :quiz, :counter, :progress, :crosses, :vertex, :is_question,
:answer_scheme, :progress_old, :counter_old, :round_id_old,
:input, :correct, :hide_solution, :vertex_old, :question_id,
:answer_shuffle, :answer_shuffle_old, :solution_input, :result,
:session_id, :study_participant, :is_remark, :remark_id,
:input_text, :certificate, :save_probe
:attempt_token, :certificate, :save_probe

def initialize(params)
@quiz = Quiz.find(params[:id])
Expand All @@ -21,19 +19,16 @@ def initialize(params)
@vertex = @quiz.vertices[@progress]
@vertex_old = @vertex
question_details(params) if @vertex.present? && @vertex[:type] == "Question"
remark_details(params) if @vertex.present? && @vertex[:type] == "Remark"
@answer_scheme ||= {}
@answer_shuffle ||= []
@answer_shuffle_old = []
@study_participant = params[:study_participant]
@save_probe = params[:save_probe]
end

def update
@input = @quiz.crosses_to_input(@progress, @crosses)
@correct = (@input == @answer_scheme)
create_question_probe if @is_question
create_remark_probe if @is_remark && @study_participant
@progress = @quiz.next_vertex(@progress, @input)
create_certificate_final_probe if @progress == -1 && @quiz.sort == "Quiz"
@counter += 1
Expand Down Expand Up @@ -84,11 +79,11 @@ def progress_counter(params)
if params[:quiz].present?
@counter = params[:quiz][:counter].to_i
@progress = params[:quiz][:progress].to_i
@session_id = params[:quiz][:session_id]
@attempt_token = params[:quiz][:attempt_token]
end
@progress ||= @quiz.root
@counter ||= 0
@session_id ||= SecureRandom.uuid.first(13).remove("-")
@attempt_token ||= SecureRandom.uuid.first(13).remove("-")
@progress_old = @progress
@counter_old = @counter
@round_id_old = round_id
Expand All @@ -105,11 +100,6 @@ def question_details(params)
end
end

def remark_details(_params)
@is_remark = true
@remark_id = @vertex[:id]
end

def update_answer_shuffle
@answer_shuffle = Question.find_by(id: @vertex[:id])&.answers&.map(&:id)
&.shuffle
Expand All @@ -119,24 +109,14 @@ def create_question_probe
return unless @save_probe

quiz_id = @quiz.id unless @quiz.sort == "RandomQuiz"
input = @solution_input || @input.to_s if @study_participant
ProbeSaver.perform_async(quiz_id, @question_id, nil, @correct, @progress,
@session_id, @study_participant, input)
end

def create_remark_probe
return unless @save_probe

quiz_id = @quiz.id unless @quiz.sort == "RandomQuiz"
ProbeSaver.perform_async(quiz_id, nil, @remark_id, nil, @progress,
@session_id, @study_participant, @input_text)
ProbeSaver.perform_async(quiz_id, @question_id, @correct, @progress,
@attempt_token)
end

def create_certificate_final_probe
return unless @save_probe

@certificate = QuizCertificate.create(quiz: @quiz)
ProbeSaver.perform_async(@quiz.id, nil, nil, nil, -1, @session_id,
@study_participant, nil)
ProbeSaver.perform_async(@quiz.id, nil, nil, -1, @attempt_token)
end
end
4 changes: 0 additions & 4 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,6 @@ def nonsubscribed_lectures
Lecture.where.not(id: lectures.pluck(:id))
end

def anonymized_id
Digest::SHA2.hexdigest(id.to_s + created_at.to_s).first(20)
end

def subscribe_lecture!(lecture)
return false unless lecture.is_a?(Lecture)
return false if lecture.in?(lectures)
Expand Down
6 changes: 0 additions & 6 deletions app/views/administration/_navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@
title: t('admin.navbar.stats'),
target: :_blank %>
</li>
<li>
<%= link_to '', interactions_path,
class: 'nav-link bi-cloud-arrow-down-fill ' + get_class_for_path(interactions_path()),
data: { 'bs-toggle': 'tooltip' },
title: t('admin.navbar.export_stats') %>
</li>
<% end %>
</ul>

Expand Down
46 changes: 0 additions & 46 deletions app/views/interactions/index.html.erb

This file was deleted.

1 change: 0 additions & 1 deletion app/views/mathi_mailer/data_provide_email.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
email_for_teachable: @user.email_for_teachable,
email_for_news: @user.email_for_news,
unread_comments: @user.unread_comments,
study_participant: @user.study_participant,
email_for_submission_upload: @user.email_for_submission_upload,
email_for_submission_removal: @user.email_for_submission_removal,
email_for_submission_join: @user.email_for_submission_join,
Expand Down
2 changes: 1 addition & 1 deletion app/views/quizzes/_free_question_open.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
id: 'quiz_question_crosses' %>
<%= quiz_fields.hidden_field :solution_input, id: 'question_quiz_solution_input' %>
<%= quiz_fields.hidden_field :result, id: 'question_quiz_result' %>
<%= quiz_fields.hidden_field :session_id, value: quiz_round.session_id %>
<%= quiz_fields.hidden_field :attempt_token, value: quiz_round.attempt_token %>
<% end %>

<%= f.hidden_field :id, value: quiz_round.quiz.id %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/quizzes/_mc_question_open.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
value: quiz_round.counter %>
<%= f.hidden_field :answer_shuffle,
value: quiz_round.answer_shuffle.to_json %>
<%= f.hidden_field :session_id,
value: quiz_round.session_id %>
<%= f.hidden_field :attempt_token,
value: quiz_round.attempt_token %>
<div class="text-center">
<%= f.submit t('buttons.submit'),
class: "send-it btn btn-secondary mt-2" %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/quizzes/_remark.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
value: @quiz_round.progress %>
<%= f.hidden_field :counter,
value: @quiz_round.counter %>
<%= f.hidden_field :session_id,
value: @quiz_round.session_id %>
<%= f.hidden_field :attempt_token,
value: @quiz_round.attempt_token %>
</div>
<% if remark.video || remark.manuscript || remark.geogebra %>
<div class="col-12 text-center my-2 remark-infotainment-text">
Expand Down
14 changes: 0 additions & 14 deletions app/workers/interaction_saver.rb

This file was deleted.

12 changes: 3 additions & 9 deletions app/workers/probe_saver.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
class ProbeSaver
include Sidekiq::Worker

# rubocop:todo Metrics/ParameterLists
def perform(quiz_id, question_id, remark_id, correct, progress, session_id,
study_participant, input)
# rubocop:enable Metrics/ParameterLists
def perform(quiz_id, question_id, correct, progress, attempt_token)
probe = Probe.create(quiz_id: quiz_id,
question_id: question_id,
remark_id: remark_id,
correct: correct,
progress: progress,
session_id: session_id,
study_participant: study_participant,
input: input)
attempt_token: attempt_token)
return unless progress == -1

success = Probe.where(session_id: session_id, correct: true).count
success = Probe.where(attempt_token: attempt_token, correct: true).count
probe.update(success: success)
end
end
Loading