Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby API Wrapper for Rustici SCORM Cloud
Ruby
branch: master

This branch is 5 commits ahead, 9 commits behind aeseducation:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
features
lib
spec
.gitignore
Gemfile
Rakefile
readme.textile
scorm_cloud.gemspec

readme.textile

Rustici SCORM Cloud Ruby Client

This ruby gem is provides a ruby interface to the Rustici Scorm Cloud.

Shell CLI Interface

$ gem install ‘scorm_cloud’
$ scorm_cloud rustici.course.getCourseList —appid myappid —secret mysecret

Standard Ruby Use

require 'scorm_cloud'
sc = ScormCloud::ScormCloud.new("my_app_id","my_secret_key")
sc.course.get_course_list.each { |c| puts "#{c.id} #{c.title}"}

Ruby on Rails Use

Place the following in: Gemfile

require 'scorm_cloud', :git => 'git@github.com:aeseducation/scorm-cloud.git'

Place the following in: config/initializers/scorm_cloud.rb

# Change MyApplication to the name of your application
MyApplication::Application.configure do |config|
	config.scorm_cloud.appid = "my_app_id"
	config.scorm_cloud.secretkey = "my_secret_key"
end

Place the following in: /app/controllers.course_controller.rb

# app/controllers/course_controller.rb
class CourseController < ApplicationController
	def index
		@courses = scorm_cloud.course.get_course_list
	end
	def launch
		return_url = course_index_url
		reg = scorm_cloud.registrations.create_registration(...)
		redirect_to scorm_cloud.registrations.launch(...)
	end
end

Place the following in: /app/views/course/index.html.erb

# app/views/course/index.html.erb
<ul>
<%= @courses.each |course| >
    <li>
        <= link_to course_launch_path(course.title,course.id) >
    </li>
< end %>
</ul>

Something went wrong with that request. Please try again.