diff --git a/Dockerfile b/Dockerfile index 5e136e4b3..73d74d591 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,8 @@ MAINTAINER Jihane Najdi # Default environment ARG RAILS_ENV='development' -ARG ODSA_BRANCH='master' ARG LTI_BRANCH='staging' +ARG ODSA_BRANCH=master ENV TZ=America/New_York RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone diff --git a/app/controllers/course_offerings_controller.rb b/app/controllers/course_offerings_controller.rb index ddcbf05f5..f17071818 100644 --- a/app/controllers/course_offerings_controller.rb +++ b/app/controllers/course_offerings_controller.rb @@ -511,4 +511,20 @@ def course_offering_params :label, :url, :self_enrollment_allowed) end + require 'csv' + + def export_events + # Example data — you will replace with real queries later + csv_data = CSV.generate(headers: true) do |csv| + csv << ["Event ID", "User ID", "Event Type", "Timestamp"] + csv << [1, 42, "viewed_lesson", Time.now] + csv << [2, 42, "completed_exercise", Time.now] + csv << [3, 99, "submitted_quiz", Time.now] + end + + send_data csv_data, + filename: "course_#{params[:id]}_events.csv", + type: 'text/csv' + end + end diff --git a/bin/annotate b/bin/annotate old mode 100755 new mode 100644 diff --git a/bin/bourbon b/bin/bourbon old mode 100755 new mode 100644 diff --git a/bin/bundle b/bin/bundle old mode 100755 new mode 100644 diff --git a/bin/bundler b/bin/bundler old mode 100755 new mode 100644 diff --git a/bin/cap b/bin/cap old mode 100755 new mode 100644 diff --git a/bin/capify b/bin/capify old mode 100755 new mode 100644 diff --git a/bin/coderay b/bin/coderay old mode 100755 new mode 100644 diff --git a/bin/console b/bin/console old mode 100755 new mode 100644 diff --git a/bin/delayed_job b/bin/delayed_job old mode 100755 new mode 100644 diff --git a/bin/dev b/bin/dev old mode 100755 new mode 100644 diff --git a/bin/dot2ruby b/bin/dot2ruby old mode 100755 new mode 100644 diff --git a/bin/erd b/bin/erd old mode 100755 new mode 100644 diff --git a/bin/erubis b/bin/erubis old mode 100755 new mode 100644 diff --git a/bin/gem2gv b/bin/gem2gv old mode 100755 new mode 100644 diff --git a/bin/haml b/bin/haml old mode 100755 new mode 100644 diff --git a/bin/htmldiff b/bin/htmldiff old mode 100755 new mode 100644 diff --git a/bin/ldiff b/bin/ldiff old mode 100755 new mode 100644 diff --git a/bin/nokogiri b/bin/nokogiri old mode 100755 new mode 100644 diff --git a/bin/oauth b/bin/oauth old mode 100755 new mode 100644 diff --git a/bin/pry b/bin/pry old mode 100755 new mode 100644 diff --git a/bin/puma b/bin/puma old mode 100755 new mode 100644 diff --git a/bin/pumactl b/bin/pumactl old mode 100755 new mode 100644 diff --git a/bin/rackup b/bin/rackup old mode 100755 new mode 100644 diff --git a/bin/rails b/bin/rails old mode 100755 new mode 100644 diff --git a/bin/rake b/bin/rake old mode 100755 new mode 100644 diff --git a/bin/rdoc b/bin/rdoc old mode 100755 new mode 100644 diff --git a/bin/redcarpet b/bin/redcarpet old mode 100755 new mode 100644 diff --git a/bin/request-log-analyzer b/bin/request-log-analyzer old mode 100755 new mode 100644 diff --git a/bin/ri b/bin/ri old mode 100755 new mode 100644 diff --git a/bin/rspec b/bin/rspec old mode 100755 new mode 100644 diff --git a/bin/ruby2gv b/bin/ruby2gv old mode 100755 new mode 100644 diff --git a/bin/sass b/bin/sass old mode 100755 new mode 100644 diff --git a/bin/sass-convert b/bin/sass-convert old mode 100755 new mode 100644 diff --git a/bin/scss b/bin/scss old mode 100755 new mode 100644 diff --git a/bin/sdoc b/bin/sdoc old mode 100755 new mode 100644 diff --git a/bin/sdoc-merge b/bin/sdoc-merge old mode 100755 new mode 100644 diff --git a/bin/sprockets b/bin/sprockets old mode 100755 new mode 100644 diff --git a/bin/thin b/bin/thin old mode 100755 new mode 100644 diff --git a/bin/thor b/bin/thor old mode 100755 new mode 100644 diff --git a/bin/tilt b/bin/tilt old mode 100755 new mode 100644 diff --git a/bin/xml2gv b/bin/xml2gv old mode 100755 new mode 100644 diff --git a/config/routes.rb b/config/routes.rb index d8cb97d47..16419f990 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -188,6 +188,11 @@ post 'generate_gradebook' => :generate_gradebook, as: :gradebook get 'add_workout' => :add_workout, as: :add_workout post 'store_workout/:id' => :store_workout, as: :store_workout + + # NEW ROUTE for Export Events CSV + member do + get :export_events + end end # All of the routes anchored at /users diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh old mode 100755 new mode 100644 diff --git a/docker-run.sh b/docker-run.sh old mode 100755 new mode 100644 diff --git a/docker-stop.sh b/docker-stop.sh old mode 100755 new mode 100644 diff --git a/runservers.sh b/runservers.sh old mode 100755 new mode 100644 diff --git a/scripts/start-prod.sh b/scripts/start-prod.sh old mode 100755 new mode 100644 diff --git a/scripts/start.sh b/scripts/start.sh old mode 100755 new mode 100644 diff --git a/usr/resources/Python/FactorialTest.py b/usr/resources/Python/FactorialTest.py old mode 100755 new mode 100644 diff --git a/usr/resources/Python/FibonacciTest.py b/usr/resources/Python/FibonacciTest.py old mode 100755 new mode 100644 diff --git a/usr/resources/Ruby/FactorialTest.rb b/usr/resources/Ruby/FactorialTest.rb old mode 100755 new mode 100644 diff --git a/usr/resources/Ruby/FibonacciTest.rb b/usr/resources/Ruby/FibonacciTest.rb old mode 100755 new mode 100644