RAPP Platform  v0.6.0
RAPP Platform is a collection of ROS nodes and back-end processes that aim to deliver ready-to-use generic services to robots
 All Classes Namespaces Files Functions Variables Macros
helper_functions.CognitiveExerciseHelperFunctions Class Reference

Static Public Member Functions

def determineTestTypeListForReturningScoresOrHistory
 Validates the provided test type or selects all test types from ontology if non provided. More...
 
def filterTestsbyDifficultyAndSubtype
 Filters the tests by Difficulty and test subtype. More...
 
def getCognitiveTestsOfType
 Gets the cognitive tests of the given type and difficulty available in the ontology. More...
 
def getTestLanguagesFromOntology
 Queries the ontology and returns the cognitive test languages available. More...
 
def getTestTypesFromOntology
 Queries the ontology and returns the cognitive test types available. More...
 
def getUserLanguage
 Queries the MySQL database through the MySQL wrapper and returns the user's language. More...
 
def getUserOntologyAlias
 Gets the users ontology alias and if it doesnt exist it creates it. More...
 
def getUserPerformanceRecordsForTestType
 Gets the user cognitive test performance records for given test type. More...
 
def organizeUserPerformanceByTimestamp
 Organizes the user's performance entries by timestamp. More...
 
def traceError
 Traces and returns the code line where an error occured. More...
 

Detailed Description

Definition at line 34 of file helper_functions.py.

Member Function Documentation

def helper_functions.CognitiveExerciseHelperFunctions.determineTestTypeListForReturningScoresOrHistory (   testType,
  validtestTypesList 
)
static

Validates the provided test type or selects all test types from ontology if non provided.

Parameters
testType[string] The provided test type
validtestTypesList[list] The list of valid test types
Returns
testTypesList [list] The list of testTypes returned
Exceptions
ExceptionAppError

Definition at line 166 of file helper_functions.py.

def helper_functions.CognitiveExerciseHelperFunctions.filterTestsbyDifficultyAndSubtype (   testsOfType,
  chosenDif,
  testSubType 
)
static

Filters the tests by Difficulty and test subtype.

Parameters
testsOfType[dictionary] The dictionary containing all the tests
chosenDif[string] The test difficulty
testSubType[string] The test sub type
Returns
d [dictionary] The selected cognitive tests after filtering was applied

Definition at line 132 of file helper_functions.py.

def helper_functions.CognitiveExerciseHelperFunctions.getCognitiveTestsOfType (   testType,
  userLanguage 
)
static

Gets the cognitive tests of the given type and difficulty available in the ontology.

Parameters
testType[string] The test type (category)
userLanguage[string] The user's language
Returns
cognitiveTestsOfTypeResponse [cognitiveTestsOfTypeResponse] The cognitive tests of type service response
Exceptions
ExceptionAppError

Definition at line 113 of file helper_functions.py.

def helper_functions.CognitiveExerciseHelperFunctions.getTestLanguagesFromOntology ( )
static

Queries the ontology and returns the cognitive test languages available.

Returns
languagesList [list] The list of the available cognitive test languages they were read from the ontology
Exceptions
ExceptionAppError

Definition at line 91 of file helper_functions.py.

def helper_functions.CognitiveExerciseHelperFunctions.getTestTypesFromOntology ( )
static

Queries the ontology and returns the cognitive test types available.

Returns
testTypesList [list] The list of the available tests as they were read from the ontology
Exceptions
ExceptionAppError

Definition at line 71 of file helper_functions.py.

def helper_functions.CognitiveExerciseHelperFunctions.getUserLanguage (   username)
static

Queries the MySQL database through the MySQL wrapper and returns the user's language.

Parameters
username[string] The username of the user as is in the MySQL database
languageInSrv[string] The user's language for assigning it to the srv response trace
Returns
userLanguage [string] The user's language
Exceptions
ExceptionAppError

Definition at line 149 of file helper_functions.py.

def helper_functions.CognitiveExerciseHelperFunctions.getUserOntologyAlias (   username)
static

Gets the users ontology alias and if it doesnt exist it creates it.

Parameters
username[string] The user's username
Returns
ontologyAlias [string] The user's ontology alias
Exceptions
ExceptionAppError

Definition at line 56 of file helper_functions.py.

def helper_functions.CognitiveExerciseHelperFunctions.getUserPerformanceRecordsForTestType (   testType,
  userOntologyAlias 
)
static

Gets the user cognitive test performance records for given test type.

Parameters
username[string] The user's username
Returns
userPerformanceReq [rapp_platform_ros_communications::userPerformanceCognitveTestsSrvRequest::Request&] The user's performance records
Exceptions
ExceptionAppError

Definition at line 42 of file helper_functions.py.

def helper_functions.CognitiveExerciseHelperFunctions.organizeUserPerformanceByTimestamp (   userPerf)
static

Organizes the user's performance entries by timestamp.

Parameters
userPerf[dict] The dictionary containing the user's performance entries
Returns
userPerfOrganizedByTimestamp [OrderedDict] The dictionary containing the user's performance entries organized by timestamp

Definition at line 182 of file helper_functions.py.

def helper_functions.CognitiveExerciseHelperFunctions.traceError (   error,
  trace 
)
static

Traces and returns the code line where an error occured.

Parameters
error[String] the error occured
trace[list] the execution messages trace list
trace[list] the execution messages trace list

Definition at line 196 of file helper_functions.py.


The documentation for this class was generated from the following file: