/*
	ICUS_SCORM_Data_Definition

	10/09/2003 - Created by Timothee Groleau
	(c) 2003 - ICUS Pte Ltd - All rights reserved.

	Create a browsable object structure of the SCORM 1.2 RTE Data model
	This structure will be used as a reference by the ICUS SCORM API implementation
	
	All leafs in the tree may contain the following attribute:
		* dataType
		* defaultValue
		* vocabulary
		* range
		* accessibility
		* mandatory
		
	the attributes mandatory, vocabulary and range are optional and are defaulted as follow if not found:
		* mandatory -> true
		* vocabulary -> null
		* range -> null
	
	Additionally, any item in the tree (leaf or branch) may contain the attribute
		* suported
	If "supported" is not present it will be assumed true
*/

data_definition = {
	cmi: {
		core: {
			student_id: {
				dataType: ["ICUSStudentID"],
				defaultValue: "icus_student_id",
				accessibility: "ro"
			},
			student_name: {
				dataType: ["CMIString255"],
				defaultValue: "",
				accessibility: "ro"
			},
			lesson_location: {
				dataType: ["CMIString255"],
				defaultValue: "",
				accessibility: "rw"
			},
			credit: {
				dataType: ["CMIVocabulary"],
				defaultValue: "no-credit",
				vocabulary: ["credit", "no-credit"],
				accessibility: "ro"
			},
			lesson_status: {
				dataType: ["CMIVocabulary"],
				defaultValue: "not attempted",
				vocabulary: ["passed", "completed", "failed", "incomplete", "browsed", "not attempted"],
				accessibility: "rw"
			},
			entry: {
				dataType: ["CMIVocabulary"],
				defaultValue: "ab-initio",
				vocabulary: ["ab-initio", "resume", ""],
				accessibility: "ro"
			},
			score: {
				raw: {
					dataType: ["CMIDecimal", "CMIBlank"],
					range: [0, 100],
					defaultValue: "",
					accessibility: "rw"
				},
				min: {
					dataType: ["CMIDecimal", "CMIBlank"],
					range: [0, 100],
					defaultValue: "",
					accessibility: "rw",
					mandatory: false
				},
				max: {
					dataType: ["CMIDecimal", "CMIBlank"],
					range: [0, 100],
					defaultValue: "",
					accessibility: "rw",
					mandatory: false
				}
			},
			total_time: {
				dataType: ["CMITimespan"],
				defaultValue: "0000:00:00.00",
				accessibility: "ro"
			},
			lesson_mode: {
				dataType: ["CMIVocabulary"],
				defaultValue: "normal",
				vocabulary: ["browse", "normal", "review"],
				accessibility: "ro",
				mandatory: false
			},
			exit: {
				dataType: ["CMIVocabulary"],
				defaultValue: "",
				vocabulary: ["time-out", "suspend", "logout", ""],
				accessibility: "wo"
			},
			session_time: {
				dataType: ["CMITimespan"],
				defaultValue: "0000:00:00.00",
				accessibility: "wo"
			}
		},
		suspend_data: {
			dataType: ["CMIString4096"],
			defaultValue: "",
			accessibility: "rw"
		},
		launch_data: {
			dataType: ["CMIString4096"],
			defaultValue: "",
			accessibility: "ro"
		},
		comments: {
			dataType: ["CMIString4096"],
			defaultValue: "",
			accessibility: "rw",
			mandatory: false
		},
		comments_from_lms: {
			dataType: ["CMIString4096"],
			defaultValue: "",
			accessibility: "ro",
			mandatory: false
		},
		objectives: {
			n: {
				id: {
					dataType: ["CMIIdentifier"],
					defaultValue: "",
					accessibility: "rw",
					mandatory: false
				},
				score: {
					raw: {
						dataType: ["CMIDecimal", "CMIBlank"],
						range: [0, 100],
						defaultValue: "",
						accessibility: "rw",
						mandatory: false
					},
					min: {
						dataType: ["CMIDecimal", "CMIBlank"],
						range: [0, 100],
						defaultValue: "",
						accessibility: "rw",
						mandatory: false
					},
					max: {
						dataType: ["CMIDecimal", "CMIBlank"],
						range: [0, 100],
						defaultValue: "",
						accessibility: "rw",
						mandatory: false
					}
				},
				status: {
					dataType: ["CMIVocabulary"],
					defaultValue: "not attempted",
					vocabulary: ["passed", "completed", "failed", "incomplete", "browsed", "not attempted"],
					accessibility: "rw",
					mandatory: false
				}
			}
		},
		student_data: {
			mastery_score: {
				dataType: ["CMIDecimal", "CMIBlank"],
				range: [0, 100],
				defaultValue: "",
				accessibility: "ro",
				mandatory: false
			},
			max_time_allowed: {
				dataType: ["CMITimespan", "CMIBlank"],
				defaultValue: "",
				accessibility: "ro",
				mandatory: false
			},
			time_limit_action: {
				dataType: ["CMIVocabulary"],
				defaultValue: "continue,no message",
				vocabulary: ["exit,message", "exit,no message", "continue,message", "continue,no message"],
				accessibility: "ro",
				mandatory: false
			}
		},
		student_preference: {
			audio: {
				dataType: ["CMISInteger"],
				range:[-1, 100],
				defaultValue: "0",
				accessibility: "rw",
				mandatory: false
			},
			language: {
				dataType: ["CMIString255"],
				defaultValue: "",
				accessibility: "rw",
				mandatory: false
			},
			speed: {
				dataType: ["CMISInteger"],
				range:[-100, 100],
				defaultValue: "0",
				accessibility: "rw",
				mandatory: false
			},
			text: {
				dataType: ["CMIVocabulary"],
				defaultValue: "0",
				vocabulary: ["-1", "0", "1"],
				accessibility: "rw",
				mandatory: false
			}
		},
		interactions: {
			supported: false,
			n: {
				id: {
					dataType: ["CMIIdentifier"],
					defaultValue: "",
					accessibility: "wo",
					mandatory: false
				},
				objectives: {
					n: {
						id: {
							dataType: ["CMIIdentifier"],
							defaultValue: "",
							accessibility: "wo",
							mandatory: false
						}
					}
				},
				time: {
					dataType: ["CMITime"],
					defaultValue: "",
					accessibility: "wo",
					mandatory: false
				},
				type: {
					dataType: ["CMIVocabulary"],
					defaultValue: "",
					vocabulary: ["true-false", "choice", "fill-in", "matching", "performance", "sequencing", "likert", "numeric"],
					accessibility: "wo",
					mandatory: false
				},
				correct_responses: {
					n: {
						pattern: {
							dataType: ["CMIFeedback"],
							typeDependency: "cmi.interactions.n.type",
							defaultValue: "",
							accessibility: "wo",
							mandatory: false
						}
					}
				},
				weighting: {
					dataType: ["CMIDecimal"],
					defaultValue: "",
					accessibility: "wo",
					mandatory: false
				},
				student_response: {
					dataType: ["CMIFeedback"],
					typeDependency: "cmi.interactions.n.type",
					defaultValue: "",
					accessibility: "wo",
					mandatory: false
				},
				result: {
					dataType: ["CMIVocabulary", "CMIDecimal"],
					defaultValue: "",
					vocabulary: ["correct", "wrong", "unanticipated", "neutral"],
					accessibility: "wo",
					mandatory: false
				},
				latency: {
					dataType: ["CMItimespan"],
					defaultValue: "",
					accessibility: "wo",
					mandatory: false
				}
			}
		},
		_version: "3.4"
	}
}
