﻿//<using>
//  nui/nui.js
//  nui/prototype.js
//  nui/lang.js
//  nui/quill/entity/entity.js
//</using>

/**
 * The Survey entity
 * @class NUI.Quill.Entity.Survey
 */
NUI.Quill.Entity.Survey = (function() {
    var g_ht = NUI.Util.DataStructure.HashTable;
    
    return function() {
        return {
            /**
             * Id of the survey. If id < 0, the survey hasn't been saved before
             */
            id : -1,
            caption : "双击此处编辑问卷标题",
            subcaption : "双击此处编辑子标题",
            description : "双击此处输入问卷说明文字",
            header : "欢迎参加问卷调查",
            footer : "谢谢您的参与",
            
            /**
             * Question set
             *  HashTable {
             *      key : question id,
             *      value : Question
             *  }
             */
            questionSet : new g_ht(),
            
            /**
             * The structure id list of questions
             */
            qIdList : [],
            
            /**
             * Pagination tags
             *  HashTable {
             *      key : question id,
             *      value : true
             *  }
             */
            pageTags : new g_ht(),
            
            /**
             * Portion tags
             *  HashTable {
             *      key : question id,
             *      value : string
             *  }
             */
            portionTags : new g_ht(),
            
            /**
             *  Question Jumper
             *  HashTable {
             *      key : question id,
             *      value : HashTable {
             *          key : option index,
             *          value : HashTable {
             *              key : target question id,
             *              value : true
             *          }
             *      }
             *  }
             */
            jumper : new g_ht(),
            
            /**
             *  Branch : HashTable{
             *      key : question id,
             *      value : HashTable{
             *          key : optIdx,
             *          value : {
             *              type : BranchType,
             *              value : survey id
             *          }
             *      }
             *  }
             */
            branch : new g_ht()
        };
    };
})();

