Project

scorm_rte

0.0
No commit activity in last 3 years
No release in over 3 years
This is an attempt to a mountable rails engine for SCORM RTE.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

Runtime

>= 4.0
 Project Readme

SCORM RTE

This is an attempt to a mountable rails engine for SCORM RTE.

Installation

First, add the gem to your Gemfile.

gem 'scorm_rte', git: 'https://github.com/pukei/scorm_rte.git'

And, bundle.

bundle install

Then, mount the engine to your application.

# Add this line to routes.rb
mount ScormRte::Engine, at: 'scorm_rte'
# Or, any custom mount point
mount ScormRte::Engine, at: 'this_is_soo_coool'

This will provide some actions to take care of the RTE.

/scorm_rte/stores                # POST
/scorm_rte/stores/fetch          # GET
# Or
/this_is_soo_coool/stores        # POST
/this_is_soo_coool/stores/fetch  # GET

Now, copy the migrations from the engine to the application.

[bundle exec] rake scorm_rte:install:migrations
[bundle exec] rake db:migrate

Make the javascript RTE available to the application

// Add the following line to application.js
//= require scorm_rte/rte

Or, you can add this line to config/initializers/assets.rb

Rails.application.config.assets.precompile += %w( scorm_rte/rte.js )

And, make it available to the subsequent views

<%= javascript_include_tag 'scorm_rte/rte' %>

Or, better still you can copy the RTE js to the application and handle it yourself

[bundle exec] rake scorm_rte:copy_rte

Well, almost done.!!! One last thing, that is to assign a unique ID to each instance of the SCO. This will be be used to query the db to keep track of everything that's going on at each User/SCO level.

Use the controller helper assign_sco_instance_id(sco_instance_id).

# This can be achieved in some way similar to this
class LmsController < ApplicationController
  def launch_scorm_player
    assign_sco_instance_id(sco_instance_id)

    # Rest of the code follows
    ...
  end

  private

  def sco_instance_id
    "#{current_user.id}:#{current_course.id}"
  end
end

TO DO

  • Add tests
  • Handle custom mount point
  • Allow export of RTE js to the host application for customization
  • Possibly implement error and diagnostics or, switch to TinCan perhaps :)
P.S. This README is still in it's primordial state (so is the gem) and will be refined in time.

License

This project rocks and uses MIT-LICENSE.