Пример #1
0
 def initializeFromToken(self, token, context=None):
     super(BlackWhiteListEntry, self).initializeFromToken(token, context)
     self._messageName = untokenizeObject(
         token.get(self.MESSAGE_NAME_KEY, ""))
     self._messageType = untokenizeObject(
         token.get(self.MESSAGE_TYPE_KEY, ""))
     self._version = untokenizeObject(token.get(self.VERSION_KEY))
 def initializeFromToken(self, token, context=None):
     super(SerializableStudent, self).initializeFromToken(token, context)
     self.studentId = untokenizeObject(token.get(self.STUDENT_ID_KEY, None))
     self.sessions = untokenizeObject(token.get(self.SESSIONS_KEY, []), context)
     self.oAuthIds = untokenizeObject(token.get(self.OAUTH_IDS_KEY,{}), context)
     self.studentModels = untokenizeObject(token.get(self.STUDENT_MODELS_KEY, {}), context)
     self.kcGoals = untokenizeObject(token.get(self.KC_GOALS_KEY, {}))
 def initializeFromToken(self, token, context=None):
     super(SerializableAssistmentsItem, self).initializeFromToken(token, context)
     self._assignmentNumber = untokenizeObject(token.get(self.ASSIGNMENT_NUMBER_KEY, None), context)
     self._itemId = untokenizeObject(token.get(self.ITEM_ID_KEY, None), context)
     self._problemSetId = untokenizeObject(token.get(self.PROBLEM_SET_ID_KEY, None), context)
     self._problemSetName = untokenizeObject(token.get(self.PROBLEM_SET_NAME_KEY, None), context)
     self._assignments = untokenizeObject(token.get(self.ASSIGNMENTS_KEY, []), context)
Пример #4
0
 def initializeFromToken(self, token, context=None):
     super(SerializableCalendarData,
           self).initializeFromToken(token, context)
     self.ownerId = untokenizeObject(token.get(self.OWNER_ID_KEY, None))
     self.ownerType = untokenizeObject(token.get(self.OWNER_TYPE_KEY, None))
     self.calendarData = untokenizeObject(
         token.get(self.CALENDAR_DATA_KEY, None))
     self.accessPermissions = untokenizeObject(
         token.get(self.PERMISSIONS_KEY, None))
Пример #5
0
 def initializeFromToken(self, token, context=None):
     super(SerializableTopic, self).initializeFromToken(token, context)
     self.description = untokenizeObject(
         token.get(self.TOPIC_DESCRIPTION_KEY, None))
     self.topicId = untokenizeObject(token.get(self.TOPIC_ID_KEY, None),
                                     context)
     self.kcList = untokenizeObject(token.get(self.KC_LIST_KEY, []),
                                    context)
     self.resourceList = untokenizeObject(
         token.get(self.RESOURCE_LIST_KEY, []))
Пример #6
0
 def initializeFromToken(self, token, context=None):
     super(SerializableStudent, self).initializeFromToken(token, context)
     self.studentId = untokenizeObject(token.get(self.STUDENT_ID_KEY, None))
     self.sessions = untokenizeObject(token.get(self.SESSIONS_KEY, []),
                                      context)
     self.oAuthIds = untokenizeObject(token.get(self.OAUTH_IDS_KEY, {}),
                                      context)
     self.studentModels = untokenizeObject(
         token.get(self.STUDENT_MODELS_KEY, {}), context)
     self.kcGoals = untokenizeObject(token.get(self.KC_GOALS_KEY, {}))
Пример #7
0
 def initializeFromToken(self, token, context=None):
     super(SerializableAssistmentsItem,
           self).initializeFromToken(token, context)
     self._assignmentNumber = untokenizeObject(
         token.get(self.ASSIGNMENT_NUMBER_KEY, None), context)
     self._itemId = untokenizeObject(token.get(self.ITEM_ID_KEY, None),
                                     context)
     self._problemSetId = untokenizeObject(
         token.get(self.PROBLEM_SET_ID_KEY, None), context)
     self._problemSetName = untokenizeObject(
         token.get(self.PROBLEM_SET_NAME_KEY, None), context)
     self._assignments = untokenizeObject(
         token.get(self.ASSIGNMENTS_KEY, []), context)
Пример #8
0
    def initializeFromToken(self, token, context=None):
        super(ServiceConfiguration, self).initializeFromToken(token, context)

        self.type = untokenizeObject(token.get(self.TYPE_KEY), None)

        self.params = untokenizeObject(token.get(self.PARAMS_KEY, {}))
        self.nodes = untokenizeObject(token.get(self.NODES_KEY, []))

        blackListAsString = untokenizeObject(token.get(self.BLACK_LIST_KEY,
                                                       []))
        self.blacklist = self.importBlackWhiteList(blackListAsString)

        whitelistAsString = untokenizeObject(token.get(self.WHITE_LIST_KEY,
                                                       []))
        self.whitelist = self.importBlackWhiteList(whitelistAsString)
Пример #9
0
 def read(self, key, context=None):
     """ Return an unserialized/nativized object from the datastore
     corresponding to the given key.
     @param key the key to be used for locating the object in the DB
     @param context object passed to Serialization routines"""
     obj = self._find(key)
     return untokenizeObject(obj, context)
 def testJSTranlation_JS_To_Python_Serializable_UndefVal(self):
     sObj = executeJS("SerializableTestClassUndef.js", self.jsdir, getBasePath())
     token = makeNative(sObj)
     x = untokenizeObject(token)
     self.assertIsInstance(x, TestClass)
     self.assertEqual(type(x), TestClass)
     self.assertIsNone(x._value)
 def testJSTranlation_JS_To_Python_SerializableSubclass2(self):
     sObj = executeJS("SerializableTestClass2.js", self.jsdir, getBasePath())
     token = makeNative(sObj)
     x = untokenizeObject(token)
     self.assertIsInstance(x, TestClass2)
     self.assertEqual(type(x), TestClass2)
     self.assertEqual(x._statement, "AAA")
Пример #12
0
 def testJSTranlation_JS_To_Python_Serializable_UndefVal(self):
     sObj = executeJS("SerializableTestClassUndef.js", self.jsdir, getBasePath())
     token = makeNative(sObj)
     x = untokenizeObject(token)
     self.assertIsInstance(x, TestClass)
     self.assertEqual(type(x), TestClass)
     self.assertIsNone(x._value)
Пример #13
0
 def read(self, key, context=None):
     """ Return an unserialized/nativized object from the datastore
     corresponding to the given key.
     @param key the key to be used for locating the object in the DB
     @param context object passed to Serialization routines"""
     obj = self._find(key)
     return untokenizeObject(obj, context)
Пример #14
0
 def testJSTranlation_JS_To_Python_BasicSerializable(self):
     sObj = executeJS("SerializableTestClass0.js", self.jsdir,
                      getBasePath())
     token = makeNative(sObj)
     x = untokenizeObject(token)
     self.assertIsInstance(x, Serializable)
     self.assertEqual(type(x), Serializable)
Пример #15
0
 def testJSTranlation_JS_To_Python_SerializableSubclass2(self):
     sObj = executeJS("SerializableTestClass2.js", self.jsdir, getBasePath())
     token = makeNative(sObj)
     x = untokenizeObject(token)
     self.assertIsInstance(x, TestClass2)
     self.assertEqual(type(x), TestClass2)
     self.assertEqual(x._statement, "AAA")
Пример #16
0
 def initializeFromToken(self, token, context=None):
     super(Message, self).initializeFromToken(token, context)
     self._actor = untokenizeObject(token.get(self.ACTOR_KEY, None))
     self._verb = untokenizeObject(token.get(self.VERB_KEY, None))
     self._object = untokenizeObject(token.get(self.OBJECT_KEY, None))
     self._result = untokenizeObject(token.get(self.RESULT_KEY, None))
     self._speechAct = untokenizeObject(token.get(self.SPEECH_ACT_KEY, None))
     self._timestamp = untokenizeObject(token.get(self.TIMESTAMP_KEY, None))
     self._context = untokenizeObject(token.get(self.CONTEXT_KEY, {}))
Пример #17
0
 def initializeFromToken(self, token, context=None):
     super(Message, self).initializeFromToken(token, context)
     self._actor = untokenizeObject(token.get(self.ACTOR_KEY, None))
     self._verb = untokenizeObject(token.get(self.VERB_KEY, None))
     self._object = untokenizeObject(token.get(self.OBJECT_KEY, None))
     self._result = untokenizeObject(token.get(self.RESULT_KEY, None))
     self._speechAct = untokenizeObject(token.get(self.SPEECH_ACT_KEY,
                                                  None))
     self._timestamp = untokenizeObject(token.get(self.TIMESTAMP_KEY, None))
Пример #18
0
 def initializeFromToken(self, token, context=None):
     super(BaseMessage, self).initializeFromToken(token, context)
     self._context = untokenizeObject(token.get(self.CONTEXT_KEY, {}))
 def initializeFromToken(self, token, context=None):
     super(LearningTask, self).initializeFromToken(token, context)
     self._taskId = untokenizeObject(token.get(self.TASK_ID_KEY, None), context)
     self._aliasIds = untokenizeObject(token.get(self.ALIAS_IDS_KEY, []), context)
     self._name = untokenizeObject(token.get(self.NAME_KEY, None))
     self._displayName = untokenizeObject(token.get(self.DISPLAY_NAME_KEY, None), context)
     self._description = untokenizeObject(token.get(self.DESCRIPTION_KEY, None), context)
     self._system = untokenizeObject(token.get(self.SYSTEM_KEY, None), context)
     self._subtasks = untokenizeObject(token.get(self.SUBTASKS_KEY, []), context)
     self._kcs = untokenizeObject(token.get(self.KCS_KEY, []), context)
     self._baseURL = untokenizeObject(token.get(self.BASE_URL_KEY, None), context)
     self._assistmentsItem = untokenizeObject(token.get(self.ASSISTMENTS_ITEM_KEY, None), context)
     self._canBeRecommendedIndividually = untokenizeObject(token.get(self.CAN_BE_RECOMMENDED_INDIVIDUALLY_KEY, True), context)
Пример #20
0
 def initializeFromToken(self, token, context=None):
     super(UtteranceContainer, self).initializeFromToken(token, context)
     self._defaultLanguage = token["language"]
     self._languageMap = untokenizeObject(token["languageMap"])
Пример #21
0
 def initializeFromToken(self, token, context=None):
     super(GatewayBlackWhiteListConfiguration,
           self).initializeFromToken(token, context)
     self._configDictionary = untokenizeObject(
         token.get(self.CONFIG_KEY, {}))
Пример #22
0
 def initializeFromToken(self, token, context=None):
     super(SerializableSession, self).initializeFromToken(token, context)
     self.sessionId = untokenizeObject(token.get(self.SESSION_ID_KEY, None))
     self.students = untokenizeObject(token.get(self.students, []), context)
     self.system = untokenizeObject(token.get(self.SYSTEM_KEY, None),
                                    context)
     self.task = untokenizeObject(token.get(self.TASK_KEY, None))
     self.assignmentNumber = untokenizeObject(
         token.get(self.ASSIGNMENT_NUMBER_KEY, 0), context)
     self.startTime = untokenizeObject(token.get(self.START_TIME_KEY, None),
                                       context)
     self.duration = untokenizeObject(token.get(self.DURATION_KEY, 0),
                                      context)
     self.endCondition = untokenizeObject(
         token.get(self.END_CONDITION_KEY, None), context)
     self.performance = untokenizeObject(
         token.get(self.PERFORMANCE_KEY, None), context)
     self.classroomId = untokenizeObject(
         token.get(self.CLASSROOM_ID_KEY, None), context)
     self.hints = untokenizeObject(token.get(self.HINTS_KEY, []), context)
     self.feedback = untokenizeObject(token.get(self.FEEDBACK_KEY, []),
                                      context)
     self.messageIds = untokenizeObject(token.get(self.MESSAGE_IDS_KEY, []),
                                        context)
     self.sourceDataN = untokenizeObject(
         token.get(self.SOURCE_DATA_N_KEY, None), context)
     self.sourceDataHash = untokenizeObject(
         token.get(self.SOURCE_DATA_HASH_KEY, None), context)
 def initializeFromToken(self, token, context=None):
     super(TestClassComplex, self).initializeFromToken(token, context)
     self._simples = [untokenizeObject(i) for i in token.get('simples', [])]
Пример #24
0
 def initializeFromToken(self, token, context=None):
     super(SpeechActType, self).initializeFromToken(token, context)
     self._name = token["name"]
     self._keywords = tuple(untokenizeObject(token["keywords"]))
 def initializeFromToken(self, token, context=None):
     super(SerializableStudentModel, self).initializeFromToken(token, context)
     self._studentId = untokenizeObject(token.get(self.STUDENT_ID_KEY, None))
     self._kcMastery = untokenizeObject(token.get(self.KC_MASTERY_KEY, {}))
 def testJSTranlation_JS_To_Python_BasicSerializable(self):
     sObj = executeJS("SerializableTestClass0.js", self.jsdir, getBasePath())
     token = makeNative(sObj)
     x = untokenizeObject(token)
     self.assertIsInstance(x, Serializable)
     self.assertEqual(type(x), Serializable)
 def initializeFromToken(self, token, context=None):
     super(SerializableSession, self).initializeFromToken(token, context)
     self.sessionId = untokenizeObject(token.get(self.SESSION_ID_KEY, None))
     self.students = untokenizeObject(token.get(self.students, []), context)
     self.system = untokenizeObject(token.get(self.SYSTEM_KEY, None), context)
     self.task = untokenizeObject(token.get(self.TASK_KEY, None))
     self.assignmentNumber = untokenizeObject(token.get(self.ASSIGNMENT_NUMBER_KEY, 0), context)
     self.startTime = untokenizeObject(token.get(self.START_TIME_KEY, None), context)
     self.duration = untokenizeObject(token.get(self.DURATION_KEY, 0), context)
     self.endCondition = untokenizeObject(token.get(self.END_CONDITION_KEY, None), context)
     self.performance = untokenizeObject(token.get(self.PERFORMANCE_KEY, None), context)
     self.classroomId = untokenizeObject(token.get(self.CLASSROOM_ID_KEY, None), context)
     self.hints = untokenizeObject(token.get(self.HINTS_KEY, []), context)
     self.feedback = untokenizeObject(token.get(self.FEEDBACK_KEY, []), context)
     self.messageIds = untokenizeObject(token.get(self.MESSAGE_IDS_KEY, []), context)
     self.sourceDataN = untokenizeObject(token.get(self.SOURCE_DATA_N_KEY, None), context)
     self.sourceDataHash = untokenizeObject(token.get(self.SOURCE_DATA_HASH_KEY, None), context)
 def initializeFromToken(self, token, context=None):
     super(SerializableTopic, self).initializeFromToken(token, context)
     self.description = untokenizeObject(token.get(self.TOPIC_DESCRIPTION_KEY, None))
     self.topicId = untokenizeObject(token.get(self.TOPIC_ID_KEY, None), context)
     self.kcList = untokenizeObject(token.get(self.KC_LIST_KEY, []), context)
     self.resourceList = untokenizeObject(token.get(self.RESOURCE_LIST_KEY, []))
Пример #29
0
 def initializeFromToken(self, token, context=None):
     super(LearningTask, self).initializeFromToken(token, context)
     self._taskId = untokenizeObject(token.get(self.TASK_ID_KEY, None),
                                     context)
     self._aliasIds = untokenizeObject(token.get(self.ALIAS_IDS_KEY, []),
                                       context)
     self._name = untokenizeObject(token.get(self.NAME_KEY, None))
     self._displayName = untokenizeObject(
         token.get(self.DISPLAY_NAME_KEY, None), context)
     self._description = untokenizeObject(
         token.get(self.DESCRIPTION_KEY, None), context)
     self._system = untokenizeObject(token.get(self.SYSTEM_KEY, None),
                                     context)
     self._subtasks = untokenizeObject(token.get(self.SUBTASKS_KEY, []),
                                       context)
     self._kcs = untokenizeObject(token.get(self.KCS_KEY, []), context)
     self._baseURL = untokenizeObject(token.get(self.BASE_URL_KEY, None),
                                      context)
     self._assistmentsItem = untokenizeObject(
         token.get(self.ASSISTMENTS_ITEM_KEY, None), context)
     self._canBeRecommendedIndividually = untokenizeObject(
         token.get(self.CAN_BE_RECOMMENDED_INDIVIDUALLY_KEY, True), context)
 def initializeFromToken(self, token, context=None):
     super(UtteranceContainer, self).initializeFromToken(token, context)
     self._defaultLanguage = token["language"]
     self._languageMap = untokenizeObject(token["languageMap"])
 def initializeFromToken(self, token, context=None):
     super(ParameterizedUtteranceType, self).initializeFromToken(token, context)
     self._parameterNames = untokenizeObject(token["parameterNames"])
Пример #32
0
 def initializeFromToken(self, token, context=None):
     super(VHMessage, self).initializeFromToken(token, context)
     self._firstWord = untokenizeObject(token.get(self.FIRST_WORD_KEY,
                                                  None))
     self._body = untokenizeObject(token.get(self.BODY_KEY, None))
 def initializeFromToken(self, token, context=None):
     super(SpeechActType, self).initializeFromToken(token, context)
     self._name = token["name"]
     self._keywords = tuple(untokenizeObject(token["keywords"]))
Пример #34
0
 def initializeFromToken(self, token, context=None):
     super(Speech, self).initializeFromToken(token, context)
     self.ref = untokenizeObject(token.get(self.REF_KEY, None))
     self.typ = untokenizeObject(token.get(self.TYPE_KEY, None))
     self.utterance = untokenizeObject(token.get(self.UTTERANCE_KEY, ""))
 def initializeFromToken(self, token, context=None):
     super(SpeechCan, self).initializeFromToken(token, context)
     self._description = token["description"]
     self._utterances = tuple(untokenizeObject(token["utterances"]))
Пример #36
0
 def initializeFromToken(self, token, context=None):
     super(TestClassComplex, self).initializeFromToken(token, context)
     self._simples = [untokenizeObject(i) for i in token.get('simples', [])]
Пример #37
0
 def initializeFromToken(self, token, context=None):
     super(SerializableStudentModel,
           self).initializeFromToken(token, context)
     self._studentId = untokenizeObject(token.get(self.STUDENT_ID_KEY,
                                                  None))
     self._kcMastery = untokenizeObject(token.get(self.KC_MASTERY_KEY, {}))
Пример #38
0
 def initializeFromToken(self, token, context=None):
     super(ServiceConfigurationCollection,
           self).initializeFromToken(token, context)
     self._serviceConfigurations = untokenizeObject(
         token.get(self.SERVICE_CONFIG_MAP_KEY, {}), context)
Пример #39
0
 def initializeFromToken(self, token, context=None):
     super(GIFTMessage, self).initializeFromToken(token, context)
     self._header = untokenizeObject(token.get(self.HEADER_KEY, None))
     self._payload = token.get(self.PAYLOAD_KEY, None)
Пример #40
0
 def initializeFromToken(self, token, context=None):
     super(ParameterizedUtteranceType,
           self).initializeFromToken(token, context)
     self._parameterNames = untokenizeObject(token["parameterNames"])
 def initializeFromToken(self, token, context=None):
     super(SerializableCalendarData, self).initializeFromToken(token, context)
     self.ownerId = untokenizeObject(token.get(self.OWNER_ID_KEY, None))
     self.ownerType = untokenizeObject(token.get(self.OWNER_TYPE_KEY, None))
     self.calendarData = untokenizeObject(token.get(self.CALENDAR_DATA_KEY, None))
     self.accessPermissions = untokenizeObject(token.get(self.PERMISSIONS_KEY, None))
Пример #42
0
 def initializeFromToken(self, token, context=None):
     super(SpeechCan, self).initializeFromToken(token, context)
     self._description = token["description"]
     self._utterances = tuple(untokenizeObject(token["utterances"]))
 def initializeFromToken(self, token, context=None):
     super(Speech, self).initializeFromToken(token, context)
     self.ref = untokenizeObject(token.get(self.REF_KEY, None))
     self.typ = untokenizeObject(token.get(self.TYPE_KEY, None))
     self.utterance = untokenizeObject(token.get(self.UTTERANCE_KEY, ""))