Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- /**
- * Module dependencies.
- */
- var mongoose = require('mongoose'),
- Schema = mongoose.Schema;
- /**
- * Tracking Schema
- */
- var TrackingSchema = new Schema({
- name: {
- type: String,
- default: '',
- required: 'Please fill Tracking name',
- trim: true
- },
- activity: { // Attempts information
- active: { // Indicates that an attempt is currently in progress for the activity.
- type: Boolean,
- default: false
- },
- suspended: { // Indicates that activity is currently suspended.
- type: Boolean,
- default: false
- },
- /* availableChildren: { // Indicates attempt progress information is meaningful.
- type: Boolean,
- default: false
- } */
- progressStatus: { // Indicates attempt progress information is meaningful.
- type: Boolean,
- default: false
- },
- absoluteDuration: { // Cumulative duration of all attempts on the activity. Unrealiable unless progressStatus is True.
- type: Number,
- default: 0
- },
- experiencedDuration: { // Cumulative experienced duration of all attempts on the activity. No include suspend time. Unreliable unless progressStatus is True.
- type: Number,
- default: 0
- },
- attemptCount: { // Number of attempts on the activity. Unreliable unless progressStatus is True.
- type: Number,
- default: 0
- }
- },
- attempts: [ // Indicate learner's progress on an activity. Describes per attempt progress on activity.
- {
- progressStatus: { // Indicates attempt progress information is meaningful. Unrealiable unless activity.progressStatus > 0.
- type: Boolean,
- default: false
- },
- completionAmount: { // Measure of completion of the attempt on the activity (normalized [Not complete] 0..1 [Complete]). Unreliable unless progressStatus is True.
- type: Number,
- default: 0
- },
- completionStatus: { // Indicates the attempt is completed. Unreliable unless progressStatus is True.
- type: Boolean,
- default: false
- },
- absoluteDuration: {
- type: Number, // Duration of attempt.
- default: 0
- },
- experiencedDuration: { // Duration of attempt (no include elapsed time while the activity attempt is suspendend.
- type: Number,
- default: 0
- }
- }
- ],
- objectives: [ // Indicate learner's progress related to learning objective.
- {
- progressStatus: { // Indicates that objective currently has a 'satisfaction' value.
- type: Boolean,
- default: false
- },
- satisfiedStatus: { // Indicates that objective is 'satisfied'. Valid only if 'progressStatus' = true.
- type: Boolean,
- default: false
- },
- measureStatus: { // Indicates that objective has a 'measure' value.
- type: Boolean,
- default: false
- },
- normalizedMeasure: { // Measure for the objective. Valid only if 'measureStatus'=true.
- type: Number,
- default: 0.0
- }
- }
- ],
- created: {
- type: Date,
- default: Date.now
- },
- user: {
- type: Schema.ObjectId,
- ref: 'User'
- }
- });
- mongoose.model('Tracking', TrackingSchema);
Add Comment
Please, Sign In to add comment