def determineTestTypeIfNotProvided(self,res,testTypesList,userOntologyAlias):
    serv_topic = rospy.get_param('rapp_knowrob_wrapper_user_performance_cognitve_tests')  
    res.trace.append("no test type provided, will use least recently used")
    noRecordsList=[]
    d1=OrderedDict()
    for s in testTypesList:
      userPerformanceReq=userPerformanceCognitveTestsSrvRequest()
      userPerformanceReq.test_type=s
      userPerformanceReq.ontology_alias=userOntologyAlias
      knowrob_service = rospy.ServiceProxy(serv_topic, userPerformanceCognitveTestsSrv)
      userPerformanceResponse = knowrob_service(userPerformanceReq)
      if(userPerformanceResponse.success!=True):
        noRecordsList.append(s)
      else:
        tmpUserPerfOrganizedByTimestamp=self.organizeUserPerformance(userPerformanceResponse)
        t1=tmpUserPerfOrganizedByTimestamp.items()[0][0]
        d1[t1]=[s]

    if(0 > len(noRecordsList)):
      testType=random.choice(noRecordsList)
      res.trace.append("made random choice from the test types which were never used by the user, choice was: "+ testType)
    else:
      d1=OrderedDict(sorted(d1.items(), key=lambda t: t[0]))
      testType=d1.values()[0][0]
      res.trace.append("all test types had performance records.. least recently used one was :"+ testType)
    return testType 
    
  ## @brief Organizes the test performance entries of the user by timestamp and determines the appropriate difficulty for the to be returned test
  # @param testType [string] The test type (category)
  # @param userOntologyAlias [string] The user's ontology alias
  # @param currentTimestamp [int] The timestamp at the time of the service call
  # @param lookBackTimeStamp [int] The look back timestamp. Default value is 3 months back from current time
  # @param res [rapp_platform_ros_communications::testSelectorSrvResponse::Response&] The output arguments of the service as defined in the testSelectorSrv
  # @param modifier1 [int] The first difficulty modifier
  # @param modifier2 [int] The second difficulty modifier
  #
  # @return res [rapp_platform_ros_communications::testSelectorSrvResponse::Response&] The output arguments of the service as defined in the testSelectorSrv
  # @return chosenDif [string] The chosen difficulty setting
  # @return noUserPerformanceRecordsExist [bool] True if no user performance records exit for the user for the given test type
  # @return userPerfOrganizedByTimestamp [OrderedDict] The user's performance records in a dictionary, ordered by timestamp
dataset/ETHPy150Open rapp-project/rapp-platform/rapp_cognitive_exercise/src/test_selector.py/TestSelector.determineTestTypeIfNotProvided/swapped operands of `>`