def returnUserHistory(self,req): try: res = userScoreHistoryForAllCategoriesSrvResponse() #Validate the provided time range fromTime,toTime=self.validateTimeRange(req.fromTime,req.toTime) #Get user ontology alias userOntologyAlias=CognitiveExerciseHelperFunctions.getUserOntologyAlias(req.username) #Get test types from ontology validtestTypesList=CognitiveExerciseHelperFunctions.getTestTypesFromOntology() #Construct the test type list for returning their score history testTypesList=CognitiveExerciseHelperFunctions.determineTestTypeListForReturningScoresOrHistory(req.testType,validtestTypesList) res.testCategories=testTypesList #Retrieve the test history for each test category self.assignTestHistoryForTestCategoriesToSrv(testTypesList,userOntologyAlias,fromTime,toTime,res) res.success=True except ValueError: res.trace.append("ValueError: " +str(e)) res.error="ValueError: "+str(e) res.success=False CognitiveExerciseHelperFunctions.traceError(res.error,res.trace) except IndexError, e: res.trace.append("IndexError: " +str(e)) res.error="IndexError: "+str(e) res.success=False CognitiveExerciseHelperFunctions.traceError(res.error,res.trace)
def returnUserHistory(self, req): try: res = userScoreHistoryForAllCategoriesSrvResponse() #Validate the provided time range fromTime, toTime = self.validateTimeRange(req.fromTime, req.toTime) #Get user ontology alias userOntologyAlias = CognitiveExerciseHelperFunctions.getUserOntologyAlias( req.username) #Get test types from ontology validtestTypesList = CognitiveExerciseHelperFunctions.getTestTypesFromOntology( ) #Construct the test type list for returning their score history testTypesList = CognitiveExerciseHelperFunctions.determineTestTypeListForReturningScoresOrHistory( req.testType, validtestTypesList) res.testCategories = testTypesList #Retrieve the test history for each test category self.assignTestHistoryForTestCategoriesToSrv( testTypesList, userOntologyAlias, fromTime, toTime, res) res.success = True except ValueError: res.trace.append("ValueError: " + str(e)) res.error = "ValueError: " + str(e) res.success = False CognitiveExerciseHelperFunctions.traceError(res.error, res.trace) except IndexError, e: res.trace.append("IndexError: " + str(e)) res.error = "IndexError: " + str(e) res.success = False CognitiveExerciseHelperFunctions.traceError(res.error, res.trace)
def returnUserScores(self, req): try: res = userScoresForAllCategoriesSrvResponse() #Get user ontology alias userOntologyAlias = CognitiveExerciseHelperFunctions.getUserOntologyAlias( req.username) #Get test types from ontology validtestTypesList = CognitiveExerciseHelperFunctions.getTestTypesFromOntology( ) #Construct the test type list for returning their score history testTypesList = CognitiveExerciseHelperFunctions.determineTestTypeListForReturningScoresOrHistory( req.testType, validtestTypesList) res.testCategories = testTypesList #Calculate scores for test categories res.testScores = self.calculateUserScoresForCategories( testTypesList, userOntologyAlias, req.upToTime) res.success = True except ValueError: res.trace.append("ValueError: " + str(e)) res.error = "ValueError: " + str(e) res.success = False CognitiveExerciseHelperFunctions.traceError(res.error, res.trace) except IndexError, e: res.trace.append("IndexError: " + str(e)) res.error = "IndexError: " + str(e) res.success = False CognitiveExerciseHelperFunctions.traceError(res.error, res.trace)
def returnUserScores(self,req): try: res = userScoresForAllCategoriesSrvResponse() #Get user ontology alias userOntologyAlias=CognitiveExerciseHelperFunctions.getUserOntologyAlias(req.username) #Get test types from ontology validtestTypesList=CognitiveExerciseHelperFunctions.getTestTypesFromOntology() #Construct the test type list for returning their score history testTypesList=CognitiveExerciseHelperFunctions.determineTestTypeListForReturningScoresOrHistory(req.testType,validtestTypesList) res.testCategories=testTypesList #Calculate scores for test categories res.testScores=self.calculateUserScoresForCategories(testTypesList,userOntologyAlias,req.upToTime) res.success=True except ValueError: res.trace.append("ValueError: " +str(e)) res.error="ValueError: "+str(e) res.success=False CognitiveExerciseHelperFunctions.traceError(res.error,res.trace) except IndexError, e: res.trace.append("IndexError: " +str(e)) res.error="IndexError: "+str(e) res.success=False CognitiveExerciseHelperFunctions.traceError(res.error,res.trace)