-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch moodle2 # Changes to be committed: # modified: Rakefile # new file: lib/moodle2cc/common_cartridge/course.rb # modified: test/acceptance/migrator_test.rb # renamed: lib/test/test_helper.rb -> test/test_helper.rb # renamed: lib/test/test_question_helper.rb -> test/test_question_helper.rb # renamed: lib/test/test_wiki_helper.rb -> test/test_wiki_helper.rb # modified: test/unit/canvas/assessment_test.rb # modified: test/unit/canvas/assignment_test.rb # modified: test/unit/canvas/converter_test.rb # modified: test/unit/canvas/course_test.rb # modified: test/unit/canvas/discussion_topic_test.rb # modified: test/unit/canvas/label_test.rb # modified: test/unit/canvas/question_bank_test.rb # modified: test/unit/canvas/question_group_test.rb # modified: test/unit/canvas/question_test.rb # modified: test/unit/canvas/web_content_test.rb # modified: test/unit/canvas/web_link_test.rb # modified: test/unit/canvas/wiki_test.rb # modified: test/unit/cc/assessment_test.rb # modified: test/unit/cc/assignment_test.rb # modified: test/unit/cc/cc_helper_test.rb # modified: test/unit/cc/converter_test.rb # modified: test/unit/cc/course_test.rb # modified: test/unit/cc/discussion_topic_test.rb # modified: test/unit/cc/label_test.rb # modified: test/unit/cc/question_test.rb # modified: test/unit/cc/web_content_test.rb # modified: test/unit/cc/web_link_test.rb # modified: test/unit/cc/wiki_test.rb # modified: test/unit/migrator_test.rb # modified: test/unit/moodle/backup_test.rb # modified: test/unit/moodle/course_test.rb # modified: test/unit/moodle/grade_item_test.rb # modified: test/unit/moodle/info_test.rb # modified: test/unit/moodle/mod_test.rb # modified: test/unit/moodle/question_category_test.rb # modified: test/unit/moodle/question_test.rb # modified: test/unit/moodle/section_test.rb # modified: test/unit/resource_factory_test.rb # # Changes not staged for commit: # modified: Gemfile # modified: Guardfile # modified: lib/moodle2cc.rb # modified: lib/moodle2cc/common_cartridge/course.rb # modified: test/acceptance/migrator_test.rb # # Untracked files: # test/unit/common_cartridge/ #
- Loading branch information
Showing
25 changed files
with
2,756 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
nguage: ruby | ||
language: ruby | ||
branches: | ||
only: | ||
- moodle2 | ||
rvm: | ||
- "1.9.3" | ||
- "2.0.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
class Moodle2CC::CommonCartridge::ImsManifestGenerator | ||
|
||
MANIFEST_FILE_NAME = 'imsmanifest.xml' | ||
SCHEMA = 'IMS Common Cartridge' | ||
SCHEMA_VERSION = '1.1.0' | ||
LOMIMSCC = 'lomimscc' | ||
|
||
def initialize(course) | ||
@course = course | ||
end | ||
|
||
def generate | ||
Nokogiri::XML::Builder.new do |xml| | ||
manifest(xml) do |xml| | ||
metadata(xml) | ||
organizations(xml) | ||
resources(xml) | ||
end | ||
|
||
end.to_xml | ||
end | ||
|
||
def manifest(xml) | ||
xml.manifest( | ||
"identifier" => @course.identifier, | ||
"xmlns" => "http://www.imsglobal.org/xsd/imsccv1p1/imscp_v1p1", | ||
"xmlns:lom" => "http://ltsc.ieee.org/xsd/imsccv1p1/LOM/resource", | ||
"xmlns:lomimscc" => "http://ltsc.ieee.org/xsd/imsccv1p1/LOM/manifest", | ||
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance", | ||
"xsi:schemaLocation" => "http://www.imsglobal.org/xsd/imsccv1p1/imscp_v1p1 http://www.imsglobal.org/profile/cc/ccv1p1/ccv1p1_imscp_v1p2_v1p0.xsd http://ltsc.ieee.org/xsd/imsccv1p1/LOM/resource http://www.imsglobal.org/profile/cc/ccv1p1/LOM/ccv1p1_lomresource_v1p0.xsd http://ltsc.ieee.org/xsd/imsccv1p1/LOM/manifest http://www.imsglobal.org/profile/cc/ccv1p1/LOM/ccv1p1_lommanifest_v1p0.xsd" | ||
) { | ||
yield xml | ||
} | ||
end | ||
|
||
def metadata(xml) | ||
xml.metadata { | ||
xml.schema SCHEMA | ||
xml.schemaversion SCHEMA_VERSION | ||
ns = LOMIMSCC | ||
xml[ns].lom { | ||
xml[ns].general{ | ||
xml[ns].title{ | ||
xml[ns].string @course.title | ||
} | ||
} | ||
rights(xml) | ||
} | ||
} | ||
end | ||
|
||
def rights(xml) | ||
ns = LOMIMSCC | ||
has_copyright = @course.copyright && !@course.copyright.empty? | ||
xml[ns].rights{ | ||
xml[ns].copyrightAndOtherRestrictions{ | ||
xml[ns].value has_copyright ? 'yes' : 'no' | ||
} | ||
if has_copyright | ||
xml[ns].description{ | ||
xml[ns].string @course.copyright | ||
} | ||
end | ||
} | ||
end | ||
|
||
|
||
def organizations(xml) | ||
xml.organizations | ||
end | ||
|
||
def resources(xml) | ||
xml.resources | ||
end | ||
|
||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Moodle2CC::CommonCartridge::Resources::Assignment | ||
attr_accessor :body, :meta_fields | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Moodle2CC::CommonCartridge::Resources::Course | ||
|
||
attr_accessor :format, :identifier, :title, :copyright | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Moodle2CC::CommonCartridge::Resources::DiscussionTopic | ||
attr_accessor :text | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Moodle2CC::CommonCartridge::Resources::Question | ||
|
||
attr_accessor :id, :title, :identifier | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Moodle2CC::CommonCartridge::Resources::WebContent | ||
|
||
attr_accessor :body | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Moodle2CC::CommonCartridge::Resources::WebLink | ||
|
||
attr_accessor :url, :external_link, :href | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
puts $LOAD_PATH | ||
require 'minitest/autorun' | ||
require 'test_helper' | ||
require 'moodle2cc' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<manifest identifier="icc16454176b28467d5eaeb311a7a107d" xmlns="http://www.imsglobal.org/xsd/imsccv1p1/imscp_v1p1" xmlns:lom="http://ltsc.ieee.org/xsd/imsccv1p1/LOM/resource" xmlns:lomimscc="http://ltsc.ieee.org/xsd/imsccv1p1/LOM/manifest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsccv1p1/imscp_v1p1 http://www.imsglobal.org/profile/cc/ccv1p1/ccv1p1_imscp_v1p2_v1p0.xsd http://ltsc.ieee.org/xsd/imsccv1p1/LOM/resource http://www.imsglobal.org/profile/cc/ccv1p1/LOM/ccv1p1_lomresource_v1p0.xsd http://ltsc.ieee.org/xsd/imsccv1p1/LOM/manifest http://www.imsglobal.org/profile/cc/ccv1p1/LOM/ccv1p1_lommanifest_v1p0.xsd"> | ||
<metadata> | ||
<schema>IMS Common Cartridge</schema> | ||
<schemaversion>1.1.0</schemaversion> | ||
<lomimscc:lom> | ||
<lomimscc:general> | ||
<lomimscc:title> | ||
<lomimscc:string>Sample Course</lomimscc:string> | ||
</lomimscc:title> | ||
</lomimscc:general> | ||
<lomimscc:lifeCycle> | ||
<lomimscc:contribute> | ||
<lomimscc:date> | ||
<lomimscc:dateTime>2014-02-05</lomimscc:dateTime> | ||
</lomimscc:date> | ||
</lomimscc:contribute> | ||
</lomimscc:lifeCycle> | ||
<lomimscc:rights> | ||
<lomimscc:copyrightAndOtherRestrictions> | ||
<lomimscc:value>yes</lomimscc:value> | ||
</lomimscc:copyrightAndOtherRestrictions> | ||
<lomimscc:description> | ||
<lomimscc:string>Private (Copyrighted) - http://en.wikipedia.org/wiki/Copyright</lomimscc:string> | ||
</lomimscc:description> | ||
</lomimscc:rights> | ||
</lomimscc:lom> | ||
</metadata> | ||
<organizations> | ||
<organization identifier="org_1" structure="rooted-hierarchy"> | ||
<item identifier="LearningModules"> | ||
</item> | ||
</organization> | ||
</organizations> | ||
<resources> | ||
<resource identifier="i1df71e5dc5307ca91998f80fc71275e7_syllabus" type="associatedcontent/imscc_xmlv1p1/learning-application-resource" href="course_settings/syllabus.html" intendeduse="syllabus"> | ||
<file href="course_settings/syllabus.html"/> | ||
</resource> | ||
<resource identifier="i1df71e5dc5307ca91998f80fc71275e7" type="associatedcontent/imscc_xmlv1p1/learning-application-resource" href="course_settings/canvas_export.txt"> | ||
<file href="course_settings/course_settings.xml"/> | ||
<file href="course_settings/files_meta.xml"/> | ||
<file href="course_settings/canvas_export.txt"/> | ||
</resource> | ||
</resources> | ||
</manifest> |
Oops, something went wrong.