canvas_cc 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +29 -0
  6. data/Rakefile +1 -0
  7. data/canvas_cc.gemspec +37 -0
  8. data/lib/canvas_cc/canvas/assessment.rb +124 -0
  9. data/lib/canvas_cc/canvas/assignment.rb +98 -0
  10. data/lib/canvas_cc/canvas/converter.rb +30 -0
  11. data/lib/canvas_cc/canvas/course.rb +143 -0
  12. data/lib/canvas_cc/canvas/discussion_topic.rb +64 -0
  13. data/lib/canvas_cc/canvas/label.rb +8 -0
  14. data/lib/canvas_cc/canvas/question.rb +492 -0
  15. data/lib/canvas_cc/canvas/question_bank.rb +57 -0
  16. data/lib/canvas_cc/canvas/question_group.rb +35 -0
  17. data/lib/canvas_cc/canvas/resource.rb +16 -0
  18. data/lib/canvas_cc/canvas/templates/assignment.html.erb +9 -0
  19. data/lib/canvas_cc/canvas/templates/syllabus.html.erb +9 -0
  20. data/lib/canvas_cc/canvas/templates/wiki_content.html.erb +10 -0
  21. data/lib/canvas_cc/canvas/web_content.rb +15 -0
  22. data/lib/canvas_cc/canvas/web_link.rb +16 -0
  23. data/lib/canvas_cc/canvas/wiki.rb +26 -0
  24. data/lib/canvas_cc/canvas_cc/assessment_writer.rb +82 -0
  25. data/lib/canvas_cc/canvas_cc/assignment_group_writer.rb +48 -0
  26. data/lib/canvas_cc/canvas_cc/assignment_writer.rb +68 -0
  27. data/lib/canvas_cc/canvas_cc/calculated_question_writer.rb +72 -0
  28. data/lib/canvas_cc/canvas_cc/canvas_export_writer.rb +18 -0
  29. data/lib/canvas_cc/canvas_cc/cartridge_creator.rb +60 -0
  30. data/lib/canvas_cc/canvas_cc/course_setting_writer.rb +35 -0
  31. data/lib/canvas_cc/canvas_cc/discussion_writer.rb +52 -0
  32. data/lib/canvas_cc/canvas_cc/essay_question_writer.rb +19 -0
  33. data/lib/canvas_cc/canvas_cc/file_meta_writer.rb +38 -0
  34. data/lib/canvas_cc/canvas_cc/ims_manifest_generator.rb +123 -0
  35. data/lib/canvas_cc/canvas_cc/matching_question_writer.rb +43 -0
  36. data/lib/canvas_cc/canvas_cc/models/answer.rb +12 -0
  37. data/lib/canvas_cc/canvas_cc/models/assessment.rb +102 -0
  38. data/lib/canvas_cc/canvas_cc/models/assignment.rb +30 -0
  39. data/lib/canvas_cc/canvas_cc/models/assignment_group.rb +9 -0
  40. data/lib/canvas_cc/canvas_cc/models/calculated_question.rb +19 -0
  41. data/lib/canvas_cc/canvas_cc/models/canvas_file.rb +22 -0
  42. data/lib/canvas_cc/canvas_cc/models/canvas_module.rb +10 -0
  43. data/lib/canvas_cc/canvas_cc/models/course.rb +53 -0
  44. data/lib/canvas_cc/canvas_cc/models/discussion.rb +36 -0
  45. data/lib/canvas_cc/canvas_cc/models/discussion_topic.rb +5 -0
  46. data/lib/canvas_cc/canvas_cc/models/matching_question.rb +7 -0
  47. data/lib/canvas_cc/canvas_cc/models/module_item.rb +16 -0
  48. data/lib/canvas_cc/canvas_cc/models/multiple_dropdowns_question.rb +7 -0
  49. data/lib/canvas_cc/canvas_cc/models/numerical_question.rb +7 -0
  50. data/lib/canvas_cc/canvas_cc/models/page.rb +41 -0
  51. data/lib/canvas_cc/canvas_cc/models/question.rb +37 -0
  52. data/lib/canvas_cc/canvas_cc/models/question_bank.rb +42 -0
  53. data/lib/canvas_cc/canvas_cc/models/question_group.rb +10 -0
  54. data/lib/canvas_cc/canvas_cc/models/resource.rb +23 -0
  55. data/lib/canvas_cc/canvas_cc/models/web_content.rb +7 -0
  56. data/lib/canvas_cc/canvas_cc/models/web_link.rb +7 -0
  57. data/lib/canvas_cc/canvas_cc/models/workflow_state.rb +6 -0
  58. data/lib/canvas_cc/canvas_cc/module_meta_writer.rb +52 -0
  59. data/lib/canvas_cc/canvas_cc/multiple_answers_question_writer.rb +41 -0
  60. data/lib/canvas_cc/canvas_cc/multiple_blanks_question_writer.rb +51 -0
  61. data/lib/canvas_cc/canvas_cc/multiple_choice_question_writer.rb +48 -0
  62. data/lib/canvas_cc/canvas_cc/multiple_dropdowns_question_writer.rb +30 -0
  63. data/lib/canvas_cc/canvas_cc/numerical_question_writer.rb +40 -0
  64. data/lib/canvas_cc/canvas_cc/page_writer.rb +38 -0
  65. data/lib/canvas_cc/canvas_cc/question_bank_writer.rb +44 -0
  66. data/lib/canvas_cc/canvas_cc/question_group_writer.rb +23 -0
  67. data/lib/canvas_cc/canvas_cc/question_writer.rb +129 -0
  68. data/lib/canvas_cc/canvas_cc/short_answer_question_writer.rb +42 -0
  69. data/lib/canvas_cc/canvas_cc/text_only_question_writer.rb +19 -0
  70. data/lib/canvas_cc/canvas_cc/true_false_question_writer.rb +38 -0
  71. data/lib/canvas_cc/cc/assessment.rb +25 -0
  72. data/lib/canvas_cc/cc/assignment.rb +61 -0
  73. data/lib/canvas_cc/cc/cc_helper.rb +285 -0
  74. data/lib/canvas_cc/cc/converter.rb +137 -0
  75. data/lib/canvas_cc/cc/course.rb +16 -0
  76. data/lib/canvas_cc/cc/discussion_topic.rb +53 -0
  77. data/lib/canvas_cc/cc/label.rb +6 -0
  78. data/lib/canvas_cc/cc/question.rb +23 -0
  79. data/lib/canvas_cc/cc/resource.rb +30 -0
  80. data/lib/canvas_cc/cc/templates/assignment.html.erb +13 -0
  81. data/lib/canvas_cc/cc/templates/syllabus.html.erb +9 -0
  82. data/lib/canvas_cc/cc/templates/wiki_content.html.erb +10 -0
  83. data/lib/canvas_cc/cc/web_content.rb +48 -0
  84. data/lib/canvas_cc/cc/web_link.rb +75 -0
  85. data/lib/canvas_cc/cc/wiki.rb +73 -0
  86. data/lib/canvas_cc/version.rb +3 -0
  87. data/lib/canvas_cc.rb +94 -0
  88. data/spec/moodle2cc/canvas_cc/assessment_writer_spec.rb +95 -0
  89. data/spec/moodle2cc/canvas_cc/assignment_group_writer_spec.rb +51 -0
  90. data/spec/moodle2cc/canvas_cc/assignment_writer_spec.rb +74 -0
  91. data/spec/moodle2cc/canvas_cc/calculated_question_writer_spec.rb +88 -0
  92. data/spec/moodle2cc/canvas_cc/canvas_export_writer_spec.rb +26 -0
  93. data/spec/moodle2cc/canvas_cc/cartridge_creator_spec.rb +50 -0
  94. data/spec/moodle2cc/canvas_cc/course_setting_writer_spec.rb +47 -0
  95. data/spec/moodle2cc/canvas_cc/discussion_writer_spec.rb +38 -0
  96. data/spec/moodle2cc/canvas_cc/essay_question_writer_spec.rb +31 -0
  97. data/spec/moodle2cc/canvas_cc/file_meta_writer_spec.rb +57 -0
  98. data/spec/moodle2cc/canvas_cc/ims_manifest_generator_spec.rb +141 -0
  99. data/spec/moodle2cc/canvas_cc/matching_question_writer_spec.rb +51 -0
  100. data/spec/moodle2cc/canvas_cc/models/assessment_spec.rb +131 -0
  101. data/spec/moodle2cc/canvas_cc/models/assignment_group_spec.rb +9 -0
  102. data/spec/moodle2cc/canvas_cc/models/assignment_spec.rb +45 -0
  103. data/spec/moodle2cc/canvas_cc/models/calculated_question_spec.rb +25 -0
  104. data/spec/moodle2cc/canvas_cc/models/canvas_file_spec.rb +23 -0
  105. data/spec/moodle2cc/canvas_cc/models/canvas_module_spec.rb +16 -0
  106. data/spec/moodle2cc/canvas_cc/models/course_spec.rb +43 -0
  107. data/spec/moodle2cc/canvas_cc/models/discussion_spec.rb +47 -0
  108. data/spec/moodle2cc/canvas_cc/models/discussion_topic_spec.rb +7 -0
  109. data/spec/moodle2cc/canvas_cc/models/module_item_spec.rb +15 -0
  110. data/spec/moodle2cc/canvas_cc/models/page_spec.rb +34 -0
  111. data/spec/moodle2cc/canvas_cc/models/question_spec.rb +8 -0
  112. data/spec/moodle2cc/canvas_cc/models/resource_spec.rb +17 -0
  113. data/spec/moodle2cc/canvas_cc/models/web_content_spec.rb +7 -0
  114. data/spec/moodle2cc/canvas_cc/models/web_link_spec.rb +9 -0
  115. data/spec/moodle2cc/canvas_cc/module_meta_writer_spec.rb +118 -0
  116. data/spec/moodle2cc/canvas_cc/multiple_answers_question_writer_spec.rb +50 -0
  117. data/spec/moodle2cc/canvas_cc/multiple_blanks_question_writer_spec.rb +77 -0
  118. data/spec/moodle2cc/canvas_cc/multiple_choice_question_writer_spec.rb +69 -0
  119. data/spec/moodle2cc/canvas_cc/multiple_dropdowns_question_writer_spec.rb +46 -0
  120. data/spec/moodle2cc/canvas_cc/numerical_question_writer_spec.rb +69 -0
  121. data/spec/moodle2cc/canvas_cc/page_writer_spec.rb +29 -0
  122. data/spec/moodle2cc/canvas_cc/question_bank_writer_spec.rb +43 -0
  123. data/spec/moodle2cc/canvas_cc/question_writer_spec.rb +129 -0
  124. data/spec/moodle2cc/canvas_cc/short_answer_question_writer_spec.rb +50 -0
  125. data/spec/moodle2cc/canvas_cc/text_only_question_writer_spec.rb +23 -0
  126. data/spec/moodle2cc/canvas_cc/true_false_question_writer_spec.rb +62 -0
  127. data/spec/spec_helper.rb +12 -0
  128. data/spec/support/shared_examples_for_models.rb +26 -0
  129. data/test/acceptance/migrator_test.rb +24 -0
  130. data/test/fixtures/cc.imscc +0 -0
  131. data/test/fixtures/common_cartridge/ims_manifest_simple.xml +45 -0
  132. data/test/fixtures/common_cartridge/schema/cccv1p0.xsd +563 -0
  133. data/test/fixtures/common_cartridge/schema/ccv1p1_imsccauth_v1p1.xsd +203 -0
  134. data/test/fixtures/common_cartridge/schema/ccv1p1_imscp_v1p2_v1p0.xsd +827 -0
  135. data/test/fixtures/common_cartridge/schema/ccv1p1_lommanifest_v1p0.xsd +822 -0
  136. data/test/fixtures/common_cartridge/schema/ccv1p1_lomresource_v1p0.xsd +273 -0
  137. data/test/fixtures/common_cartridge/schema/xml.xsd +286 -0
  138. data/test/test_helper.rb +71 -0
  139. data/test/test_question_helper.rb +122 -0
  140. data/test/test_wiki_helper.rb +21 -0
  141. data/test/unit/canvas/assessment_test.rb +261 -0
  142. data/test/unit/canvas/assignment_test.rb +220 -0
  143. data/test/unit/canvas/converter_test.rb +171 -0
  144. data/test/unit/canvas/course_test.rb +176 -0
  145. data/test/unit/canvas/discussion_topic_test.rb +129 -0
  146. data/test/unit/canvas/label_test.rb +32 -0
  147. data/test/unit/canvas/question_bank_test.rb +92 -0
  148. data/test/unit/canvas/question_group_test.rb +90 -0
  149. data/test/unit/canvas/question_test.rb +876 -0
  150. data/test/unit/canvas/web_content_test.rb +46 -0
  151. data/test/unit/canvas/web_link_test.rb +48 -0
  152. data/test/unit/canvas/wiki_test.rb +74 -0
  153. data/test/unit/cc/assessment_test.rb +48 -0
  154. data/test/unit/cc/assignment_test.rb +72 -0
  155. data/test/unit/cc/cc_helper_test.rb +19 -0
  156. data/test/unit/cc/converter_test.rb +173 -0
  157. data/test/unit/cc/course_test.rb +36 -0
  158. data/test/unit/cc/discussion_topic_test.rb +83 -0
  159. data/test/unit/cc/label_test.rb +29 -0
  160. data/test/unit/cc/question_test.rb +54 -0
  161. data/test/unit/cc/web_content_test.rb +76 -0
  162. data/test/unit/cc/web_link_test.rb +159 -0
  163. data/test/unit/cc/wiki_test.rb +139 -0
  164. data/test/unit/logger_test.rb +33 -0
  165. data/test/unit/migrator_test.rb +67 -0
  166. data/test/unit/resource_factory_test.rb +216 -0
  167. metadata +499 -0
@@ -0,0 +1,203 @@
1
+ <?xml version = "1.0" encoding = "UTF-8"?>
2
+ <xs:schema xmlns="http://www.imsglobal.org/xsd/imsccv1p1/imsccauth_v1p1"
3
+ targetNamespace="http://www.imsglobal.org/xsd/imsccv1p1/imsccauth_v1p1"
4
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
5
+ version="IMS CC AUTHZ 1.1"
6
+ elementFormDefault="qualified"
7
+ attributeFormDefault="unqualified">
8
+ <xs:annotation>
9
+ <xs:documentation>
10
+ XSD Data File Information
11
+ -------------------------
12
+ Author: Colin Smythe
13
+ Date: 31st August, 2010
14
+ Version: 1.1
15
+ Status: Final
16
+ Description: This is the IMS GLC Authorization Data Model for the Common Cartridge.
17
+
18
+ History: Version 1.0 - the first release of this data model;
19
+ Version 1.1 - updates made to the namespace.
20
+
21
+ License: IPR, License and Distribution Notices
22
+
23
+ This machine readable file is derived from IMS Global Learning Consortium (GLC) specification IMS [spec name] Version [x.x]
24
+ found at http://www.imsglobal.org/[xxx] and the original IMS GLC schema binding or code base
25
+ http://www.imsglobal.org/[binding document].
26
+
27
+ Recipients of this document are requested to submit, with their comments, notification of any
28
+ relevant patent claims or other intellectual property rights of which they may be aware that might be
29
+ infringed by the schema binding contained in this document.
30
+
31
+ IMS GLC takes no position regarding the validity or scope of any intellectual property or other
32
+ rights that might be claimed to pertain to the implementation or use of the technology described in this
33
+ document or the extent to which any license under such rights might or might not be available; neither
34
+ does it represent that it has made any effort to identify any such rights. Information on IMS GLCs
35
+ procedures with respect to rights in IMS GLC specifications can be found at the IMS GLC Intellectual Property
36
+ Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf.
37
+
38
+ Copyright © IMS Global Learning Consortium 1999-2010. All Rights Reserved.
39
+
40
+ License Notice for Users
41
+
42
+ Users of products or services that include this document are hereby granted a worldwide, royalty-free,
43
+ non-exclusive license to use this document.
44
+
45
+ Distribution Notice for Developers
46
+
47
+ Developers of products or services that are not original incorporators of this document and
48
+ have not changed this document, that is, are distributing a software product that incorporates this
49
+ document as is from a third-party source other than IMS, are hereby granted permission to copy,
50
+ display and distribute the contents of this document in any medium for any purpose without fee or
51
+ royalty provided that you include this IPR, License and Distribution notice in its entirety on ALL
52
+ copies, or portions thereof.
53
+
54
+ Developers of products or services that are original incorporators of this document and wish
55
+ to provide distribution of this document as is or with modifications and developers of products and
56
+ services that are not original incorporators of this document and have changed this document, are
57
+ required to register with the IMS GLC community on the IMS GLC website as described in the following two
58
+ paragraphs:-
59
+
60
+ * If you wish to distribute this document as is, with no modifications, you are hereby granted
61
+ permission to copy, display and distribute the contents of this document in any medium for any
62
+ purpose without fee or royalty provided that you include this IPR, License and Distribution notice in
63
+ its entirety on ALL copies, or portions thereof, that you make and you complete a valid license
64
+ registration with IMS and receive an email from IMS granting the license. To register, follow the
65
+ instructions on the IMS website: http://www.imsglobal.org/specificationdownload.cfm. Once
66
+ registered you are granted permission to transfer unlimited distribution rights of this document for the
67
+ purposes of third-party or other distribution of your product or service that incorporates this
68
+ document as long as this IPR, License and Distribution notice remains in place in its entirety;
69
+
70
+ * If you wish to create and distribute a derived work from this document, you are hereby
71
+ granted permission to copy, display and distribute the contents of the derived work in any medium for
72
+ any purpose without fee or royalty provided that you include this IPR, License and Distribution
73
+ notice in its entirety on ALL copies, or portions thereof, that you make and you complete a valid
74
+ profile registration with IMS GLC and receive an email from IMS GLC granting the license. To register, follow
75
+ the instructions on the IMS GLC website: http://www.imsglobal.org/profile/. Once registered you are
76
+ granted permission to transfer unlimited distribution rights of the derived work for the purposes of
77
+ third-party or other distribution of your product or service that incorporates the derived work as long
78
+ as this IPR, License and Distribution notice remains in place in its entirety.
79
+
80
+ The limited permissions granted above are perpetual and will not be revoked by IMS GLC or its
81
+ successors or assigns.
82
+
83
+ THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NONINFRINGEMENT IS
84
+ EXPRESSLY DISCLAIMED. ANY USE OF THIS SPECIFICATION SHALL BE MADE ENTIRELY AT THE IMPLEMENTERS OWN RISK, AND NEITHER THE CONSORTIUM
85
+ NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF
86
+ ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SPECIFICATION.
87
+
88
+ Source UML File Information
89
+ ---------------------------
90
+ The source file information must be supplied as an XMI file (without diagram layout information).
91
+ The supported UML authoring tools are:
92
+ (a) Poseidon – v6 (and later)
93
+
94
+ Source XSLT File Information
95
+ ----------------------------
96
+ XSL Generator: UMLtoXSDTransformv0p9.xsl
97
+ XSLT Processor: Xalan
98
+ Release: 1.0 Beta 3
99
+ Date: 31st May, 2009
100
+
101
+ IMS GLC Auto-generation Binding Tool-kit (I-BAT)
102
+ ------------------------------------------------
103
+ This file was auto-generated using the IMS GLC Binding Auto-generation Tool-kit (I-BAT). While every
104
+ attempt has been made to ensure that this tool auto-generates the files correctly, users should be aware
105
+ that this is an experimental tool. Permission is given to make use of this tool. IMS GLC makes no
106
+ claim on the materials created by third party users of this tool. Details on how to use this tool
107
+ are contained in the IMS GLC "I-BAT" Documentation available at the IMS GLC web-site.
108
+
109
+ Tool Copyright: 2005-2010 (c) IMS Global Learning Consortium Inc. All Rights Reserved.
110
+ </xs:documentation>
111
+ </xs:annotation>
112
+
113
+ <!-- Generate Global Attributes *********************************************************************** -->
114
+
115
+ <xs:attribute name="protected" type="xs:boolean"/>
116
+
117
+ <!-- ================================================================================================== -->
118
+
119
+ <!-- Generate Namespaced extension Group ************************************************************* -->
120
+
121
+ <xs:group name="grpStrict.any">
122
+ <xs:annotation>
123
+ <xs:documentation>
124
+ Any namespaced element from any namespace may be included within an "any" element.
125
+ The namespace for the imported element must be defined in the instance, and the schema must be imported.
126
+ The extension has a definition of "strict" i.e. they must have their own namespace.
127
+ </xs:documentation>
128
+ </xs:annotation>
129
+ <xs:sequence>
130
+ <xs:any namespace = "##other" processContents = "strict" minOccurs = "0" maxOccurs = "unbounded"/>
131
+ </xs:sequence>
132
+ </xs:group>
133
+
134
+ <!-- ================================================================================================== -->
135
+
136
+ <!-- Generate Special DataTypes ********************************************************************** -->
137
+
138
+ <!-- ================================================================================================== -->
139
+
140
+ <!-- Generate the enumerated simpleType declarations ************************************************** -->
141
+
142
+ <!-- ================================================================================================== -->
143
+
144
+ <!-- Generate the simpleType elements based IMS data-types ******************************************* -->
145
+
146
+ <!-- ================================================================================================== -->
147
+
148
+ <!-- Generate the derived data-type elements based upon simpleType ************************************ -->
149
+
150
+ <!-- ================================================================================================== -->
151
+
152
+ <!-- Generate the derived data-type elements based upon derived simpleType **************************** -->
153
+
154
+ <!-- ================================================================================================== -->
155
+
156
+ <!-- Generate the data-type ComplexTypes ************************************************************** -->
157
+
158
+ <xs:complexType name="Authorizations.Type">
159
+ <xs:annotation>
160
+ <xs:documentation source="umldocumentation">
161
+ The set of authorizations for the associated object.
162
+ </xs:documentation>
163
+ </xs:annotation>
164
+ <xs:sequence>
165
+ <xs:element name="authorization" type="Authorization.Type" minOccurs = "1" maxOccurs = "1"/>
166
+ <xs:group ref="grpStrict.any"/>
167
+ </xs:sequence>
168
+ <xs:attribute name="access" use="required">
169
+ <xs:simpleType>
170
+ <xs:restriction base="xs:string">
171
+ <xs:enumeration value="cartridge"/>
172
+ <xs:enumeration value="resource"/>
173
+ </xs:restriction>
174
+ </xs:simpleType>
175
+ </xs:attribute>
176
+ <xs:attribute name="import" use="optional" default="false" type="xs:boolean"/>
177
+ </xs:complexType>
178
+
179
+ <xs:complexType name="Authorization.Type">
180
+ <xs:annotation>
181
+ <xs:documentation source="umldocumentation">
182
+ The authorization detail for the cartridge in terms of the web service.
183
+ </xs:documentation>
184
+ </xs:annotation>
185
+ <xs:sequence>
186
+ <xs:element name="cartridgeId" type="xs:normalizedString" minOccurs = "1" maxOccurs = "1"/>
187
+ <xs:element name="webservice" type="xs:normalizedString" minOccurs = "0" maxOccurs = "1"/>
188
+ </xs:sequence>
189
+ </xs:complexType>
190
+
191
+ <!-- ================================================================================================== -->
192
+
193
+ <!-- Declaration of the elements ********************************************************************** -->
194
+
195
+ <!-- ================================================================================================== -->
196
+
197
+ <!-- Declaration of the root element(s) *************************************************************** -->
198
+
199
+ <xs:element name="authorizations" type="Authorizations.Type"/>
200
+
201
+ <!-- ================================================================================================== -->
202
+
203
+ </xs:schema>