Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move private methods #171

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d91672d
admin view
awhicks Jun 21, 2023
7f4f2f9
Merge pull request #151 from OpenDSA/LTI-13
awhicks Jun 21, 2023
ff32224
remove useless gems and pin sass-rails before swap to sassc-rails, wh…
awhicks Oct 19, 2023
58c25d6
remove links to uninstalled dependencies due to unsupported versions
awhicks Oct 19, 2023
fbc9d9d
Merge pull request #159 from OpenDSA/js-fixes
awhicks Oct 19, 2023
73fc1d9
update dockerfile
awhicks Nov 8, 2023
4b18be7
Update default generated reference configs (#161)
awhicks Nov 16, 2023
87a4345
including export controller for generating export metadata for opends…
babz007 Dec 1, 2023
b03fde2
including routes to view exported metadata, see endpoint /embed/export
babz007 Dec 1, 2023
91777ea
Splice embed (#162)
babz007 Dec 1, 2023
a4243ab
Update routes.rb
awhicks Dec 4, 2023
7f10038
Update export_controller.rb
awhicks Dec 12, 2023
c71aab4
Update export_controller.rb
awhicks Dec 12, 2023
2fbce13
Update export_controller.rb
awhicks Dec 12, 2023
e58716a
including 3 functions to extract data from avmetdata and inlineav dir…
babz007 Jan 2, 2024
14666c1
updated export controller access data like avmetadata from inst_book…
babz007 Jan 2, 2024
efc61bf
including 4 methods to access RST raw files, extract data from avembe…
babz007 Jan 9, 2024
1b2ebde
updating export controller to collect keywords data from extract
babz007 Jan 9, 2024
c84895a
Merge branch 'staging' into splice_embed
awhicks Jan 10, 2024
3d6fdef
Update export_controller.rb
awhicks Jan 10, 2024
599389e
Splice embed (#164)
awhicks Jan 10, 2024
bb1376d
merge
awhicks Feb 23, 2024
8564035
Extract keyword metadata from RSTs to Splice metadata export (#163)
babz007 Feb 23, 2024
74a3e77
updating export controller to handle keywords from RSt files with se…
babz007 Mar 1, 2024
1e76ea5
Merge branch 'staging' of https://github.com/OpenDSA/OpenDSA-LTI into…
babz007 Mar 1, 2024
b9ae6dd
Merge branch 'splice_embed' of https://github.com/OpenDSA/OpenDSA-LTI…
babz007 Mar 1, 2024
679a0e3
Merge pull request #165 from OpenDSA/splice_embed
babz007 Mar 1, 2024
d5a2ced
including helper method to mitigate nil to string issue for export co…
babz007 Mar 4, 2024
1a9f17f
including helper method to mitigate nil to string issue for export co…
babz007 Mar 4, 2024
ec41c5f
Merge pull request #166 from OpenDSA/splice_embed
babz007 Mar 4, 2024
7b61bf8
update to parsee_json_options method to safely handles nil
babz007 Mar 5, 2024
8f400a6
Merge pull request #167 from OpenDSA/splice_embed
babz007 Mar 5, 2024
10a6e8b
using arrays for keywods (#168)
babz007 Mar 22, 2024
8e426ca
Update export_controller.rb
awhicks Mar 23, 2024
2af36e9
fix references to JSAV files in lib
awhicks Jun 29, 2024
0e0d201
update references for JSAV to lib directory
awhicks Jun 29, 2024
f1e322a
moved private methods to private method section
Jul 26, 2024
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
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ RUN apt-get update -qq \
&& apt-get install -y shared-mime-info \
&& rm -rf /var/apt/lists/*

RUN printf 'Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 1001' > /etc/apt/preferences.d/nodesource \
&& curl -sL https://deb.nodesource.com/setup_18.x | bash -\
&& apt-get update -qq && apt-get install -qq --no-install-recommends \
nodejs \
&& apt-get upgrade -qq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*\
&& npm install -g yarn@1
# RUN printf 'Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 1001' > /etc/apt/preferences.d/nodesource \
# && curl -sL https://deb.nodesource.com/setup_18.x | bash -\
# && apt-get update -qq && apt-get install -qq --no-install-recommends \
# nodejs \
# && apt-get upgrade -qq \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/*\
# && npm install -g yarn@1

RUN gem install bundler -v $BUNDLER_VERSION

Expand Down
16 changes: 7 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ gem 'rabl'
gem 'oj'
# gem 'oj_mimic_json'

group :assets do
gem 'sass-rails'
gem 'uglifier', '~> 4.2'
gem 'autoprefixer-rails'
end
gem 'sass-rails', '~> 5.0.7'
gem 'uglifier', '~> 4.2'
gem 'autoprefixer-rails'

gem 'mysql2'

Expand Down Expand Up @@ -158,8 +156,8 @@ gem 'simple_oauth', '0.3.1'
# gem "libv8"
# gem 'libv8-node'
gem 'mini_racer'
gem 'ffi' # speed up sassc install
gem 'sassc', '2.1.0'
# gem 'ffi' # speed up sassc install
# gem 'sassc', '2.1.0'

# LTI 1.3
gem 'jwt', '~> 2.2', '>= 2.2.2'
Expand All @@ -168,5 +166,5 @@ gem 'json-jwt', '~> 1.13.0'
# gem 'bootstrap', '~> 4.5.0'
# gem 'bootstrap_form', '~> 4.5.0'
# gem 'selectize-rails', '~> 0.12.6'
gem "cssbundling-rails", "~> 1.2"
gem "jsbundling-rails", "~> 1.1"
# gem "cssbundling-rails", "~> 1.2"
# gem "jsbundling-rails", "~> 1.1"
74 changes: 33 additions & 41 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,15 @@ GEM
activesupport (>= 4.2)
active_record_union (1.3.0)
activerecord (>= 4.0)
activeadmin (2.7.0)
activeadmin (2.12.0)
arbre (~> 1.2, >= 1.2.1)
formtastic (~> 3.1)
formtastic (>= 3.1, < 5.0)
formtastic_i18n (~> 0.4)
inherited_resources (~> 1.7)
jquery-rails (~> 4.2)
kaminari (~> 1.0, >= 1.0.1)
railties (>= 5.2, < 6.1)
ransack (~> 2.1, >= 2.1.1)
sassc-rails (~> 2.1)
sprockets (>= 3.0, < 4.1)
kaminari (~> 1.0, >= 1.2.1)
railties (>= 6.0, < 7.1)
ransack (>= 2.1.1, < 4)
activejob (6.0.3.5)
activesupport (= 6.0.3.5)
globalid (>= 0.3.6)
Expand Down Expand Up @@ -104,8 +102,9 @@ GEM
annotate (3.1.1)
activerecord (>= 3.2, < 7.0)
rake (>= 10.4, < 14.0)
arbre (1.2.1)
arbre (1.7.0)
activesupport (>= 3.0.0)
ruby2_keywords (>= 0.0.2)
autoprefixer-rails (9.8.6.1)
execjs
awesome_print (1.8.0)
Expand All @@ -115,10 +114,6 @@ GEM
thread_safe (~> 0.3, >= 0.3.1)
bcrypt (3.1.15)
bindata (2.4.15)
bootstrap (4.5.3)
autoprefixer-rails (>= 9.1.0)
popper_js (>= 1.14.3, < 2)
sassc-rails (>= 2.0.0)
bootstrap-editable-rails (0.0.9)
railties (>= 3.1)
sass-rails
Expand All @@ -129,9 +124,6 @@ GEM
railties (>= 3.0)
bootstrap3-datetimepicker-rails (4.14.30)
momentjs-rails (>= 2.8.1)
bootstrap_form (4.5.0)
actionpack (>= 5.2)
activemodel (>= 5.2)
browser (4.2.0)
builder (3.2.4)
cancancan (3.1.0)
Expand Down Expand Up @@ -218,7 +210,7 @@ GEM
actionpack (>= 3.2.13)
formtastic-bootstrap (3.1.1)
formtastic (>= 3.0)
formtastic_i18n (0.6.0)
formtastic_i18n (0.7.0)
friendly_id (5.4.0)
activerecord (>= 4.0.0)
globalid (0.4.2)
Expand All @@ -233,9 +225,9 @@ GEM
haml (>= 4.0.6, < 6.0)
html2haml (>= 1.0.1)
railties (>= 5.1)
has_scope (0.7.2)
actionpack (>= 4.1)
activesupport (>= 4.1)
has_scope (0.8.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
hashie (4.1.0)
html2haml (2.2.0)
erubis (~> 2.7.0)
Expand All @@ -251,11 +243,11 @@ GEM
builder (>= 1.0, < 4.0)
oauth (>= 0.4.5, < 0.6)
inflecto (0.0.2)
inherited_resources (1.11.0)
actionpack (>= 5.0, < 6.1)
has_scope (~> 0.6)
railties (>= 5.0, < 6.1)
responders (>= 2, < 4)
inherited_resources (1.14.0)
actionpack (>= 6.0)
has_scope (>= 0.6)
railties (>= 6.0)
responders (>= 2)
jbuilder (2.10.0)
activesupport (>= 5.0.0)
jquery-rails (4.4.0)
Expand Down Expand Up @@ -351,7 +343,6 @@ GEM
virtus (>= 1.0.3)
polyamorous (2.3.2)
activerecord (>= 5.2.1)
popper_js (1.16.1)
power_assert (1.2.0)
progress_job (0.0.4)
delayed_job
Expand Down Expand Up @@ -404,6 +395,9 @@ GEM
activesupport (>= 5.2.1)
i18n
polyamorous (= 2.3.2)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rdoc (6.2.1)
redcarpet (3.5.0)
remotipart (1.4.4)
Expand Down Expand Up @@ -435,23 +429,26 @@ GEM
rspec-support (3.9.3)
ruby-graphviz (1.2.5)
rexml
ruby2_keywords (0.0.5)
ruby_parser (3.14.2)
sexp_processor (~> 4.9)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (5.0.8)
railties (>= 5.2.0)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sassc (2.1.0)
ffi (~> 1.9)
sassc (2.1.0-x86_64-linux)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
sdoc (1.1.0)
rdoc (>= 5.0)
selectize-rails (0.12.6)
sexp_processor (4.15.0)
simple_oauth (0.3.1)
sprockets (3.7.2)
Expand Down Expand Up @@ -499,20 +496,18 @@ PLATFORMS
DEPENDENCIES
active_record-acts_as
active_record_union
activeadmin (~> 2.7)
activeadmin (~> 2.9)
acts-as-taggable-on
acts_as_list
addressable (~> 2.3, >= 2.3.8)
andand!
annotate
autoprefixer-rails
awesome_print
bootstrap (~> 4.5.0)
bootstrap-editable-rails
bootstrap-sass (>= 3.4.1)
bootstrap-wysihtml5-rails
bootstrap3-datetimepicker-rails (~> 4.14.30)
bootstrap_form (~> 4.5.0)
browser
cancancan
clipboard-rails
Expand All @@ -528,7 +523,6 @@ DEPENDENCIES
exception_handler (~> 0.3.45)
factory_bot_rails
faker
ffi
figaro
font-awesome-rails
formtastic (~> 3.1)
Expand Down Expand Up @@ -583,10 +577,8 @@ DEPENDENCIES
request-log-analyzer
responders
rspec-rails (>= 3.4.2)
sass-rails
sassc (= 2.1.0)
sass-rails (~> 5.0.7)
sdoc
selectize-rails (~> 0.12.6)
simple_oauth (= 0.3.1)
sprockets (= 3.7.2)
sucker_punch (~> 1.0)
Expand Down
7 changes: 7 additions & 0 deletions app/admin/lms_instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
f.input :organization, collection: Organization.all.order(:name)
f.input :consumer_key
f.input :consumer_secret
f.input :client_id
f.input :private_key
f.input :public_key
f.input :keyset_url
f.input :oauth2_url
f.input :platform_oidc_auth_url
f.input :issuer
end
f.actions
end
Expand Down
7 changes: 4 additions & 3 deletions app/assets/javascripts/lti13.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
// add require popper back
// add reqire selectize back
//
//= require rails-ujs
//= require jquery3
//= require popper
//= require bootstrap-sprockets
//= require selectize

$('document').ready(function() {
$(function() {
$('.selectize_dropdown').selectize({create: false});
});
});
});
2 changes: 0 additions & 2 deletions app/assets/stylesheets/application.bootstrap.scss

This file was deleted.

22 changes: 22 additions & 0 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
* this file replaces application.bootstrap.scss
*
*= require jquery-ui
*= require bs
*= require formtastic-bootstrap
*= require bootstrap-wysihtml5
*= require font-awesome
*= require custom
*= require book
*= require bootstrap-datetimepicker
*= require jstree-default
*/
3 changes: 2 additions & 1 deletion app/assets/stylesheets/lti13.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
* add require selectize back
*
*= require lti13_core_styles
*= require selectize
*/

@import url('https://fonts.googleapis.com/css?family=Roboto');
Expand Down
4 changes: 2 additions & 2 deletions app/assets/stylesheets/lti13_core_styles.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import 'bootstrap';
@import 'font-awesome';
@import 'selectize';
@import 'selectize.bootstrap3';
// @import 'selectize';
// @import 'selectize.bootstrap3';

.row, .card {
margin-top: 1rem;
Expand Down
53 changes: 53 additions & 0 deletions app/controllers/export_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
class ExportController < ApplicationController
# GET /export
# gives an export of opendsa embeddable slideshows and exercises
# with iframe and lti urls for SPLICE catalog
def index
host_url = request.base_url
inst_book = InstBook.first
raise "InstBook instance not found" unless inst_book

av_data = inst_book.extract_av_data_from_rst
@exercises = InstExercise.all

export_data = @exercises.map do |exercise|
matching_chapter = nil
matching_avmetadata = nil

av_data.each do |chapter, data|
if data[:inlineav]&.include?(exercise.short_name) || data[:avembed]&.include?(exercise.short_name)
matching_avmetadata = data[:avmetadata]
matching_chapter = chapter
break
end
end

# using array for keywords
keywords = if matching_avmetadata && (matching_avmetadata[:satisfies] || matching_avmetadata[:topic] || matching_avmetadata[:keyword])
[matching_avmetadata[:satisfies], matching_avmetadata[:topic], matching_avmetadata[:keyword]].compact.flat_map { |k| k.split(/[,;]\s*/) }
elsif matching_chapter
[matching_chapter] # Use the chapter name if there are no specific keywords
else
[exercise.name] # Fallback to using the exercise's name as the keyword, if there are no specific keywords
end

{
"catalog_type": "SLCItemCatalog",
"platform_name": "OpenDSA",
"url": exercise.embed_url(host_url),
"lti_instructions_url": "https://opendsa-server.cs.vt.edu/guides/opendsa-canvas",
"exercise_type": exercise.ex_type,
"license": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)",
"description": exercise.description,
"author": "Cliff Shaffer",
"institution": "Virginia Tech",
"keywords": keywords,
"exercise_name": exercise.name,
"iframe_url": exercise.embed_url(host_url),
"lti_url": "#{host_url}/lti/launch?custom_ex_short_name=#{exercise.short_name}&custom_ex_settings=%7B%7D"
}
end.compact

render json: export_data
end
end
Loading