zeeguu/core/model/word_knowledge/word_interaction_history.py
def encodeExerciseResult(exercise_outcome, exercise_source):
        """
            Matches the exercise type and result to a WordHistoryEvent code

            returns: an integer representing the type of event
        """
        if exercise_outcome in [3,5]:#Correct
            if exercise_source in [1,4]: #Recognize
                return WIH_CORRECT_EX_RECOGNIZE
            elif exercise_source == 2: #Translate
                return WIH_CORRECT_EX_TRANSLATE
            elif exercise_source in [3,5,7]: #Choice
                return WIH_CORRECT_EX_CHOICE
            elif exercise_source == 6:#Match three
                return WIH_CORRECT_EX_MATCH
        elif exercise_outcome in [1,2,4]: #Wrong
            if exercise_source in [1,4]: #Recognize
                return WIH_WRONG_EX_RECOGNIZE
            elif exercise_source == 2: #Translate
                return WIH_WRONG_EX_TRANSLATE
            elif exercise_source in [3,5,7]: #Choice
                return WIH_WRONG_EX_CHOICE
            elif exercise_source == 6:#Match three
                return WIH_WRONG_EX_MATCH

            Matches the exercise type and result to a WordHistoryEvent code

            returns: an integer representing the type of event
        
Matches the exercise type and result to a WordHistoryEvent code
returns: an integer representing the type of event
Matches the exercise type and result to a WordHistoryEvent code returns : an integer representing the type of event
def encodeExerciseResult(exercise_outcome, exercise_source):
        if exercise_outcome in [3,5]:
            if exercise_source in [1,4]: 
                return WIH_CORRECT_EX_RECOGNIZE
            elif exercise_source == 2: 
                return WIH_CORRECT_EX_TRANSLATE
            elif exercise_source in [3,5,7]: 
                return WIH_CORRECT_EX_CHOICE
            elif exercise_source == 6:
                return WIH_CORRECT_EX_MATCH
        elif exercise_outcome in [1,2,4]: 
            if exercise_source in [1,4]: 
                return WIH_WRONG_EX_RECOGNIZE
            elif exercise_source == 2: 
                return WIH_WRONG_EX_TRANSLATE
            elif exercise_source in [3,5,7]: 
                return WIH_WRONG_EX_CHOICE
            elif exercise_source == 6:
                return WIH_WRONG_EX_MATCH
def encodeExerciseResult ( exercise_outcome , exercise_source ) : if exercise_outcome in [ 3 , 5 ] : if exercise_source in [ 1 , 4 ] : return WIH_CORRECT_EX_RECOGNIZE elif exercise_source == 2 : return WIH_CORRECT_EX_TRANSLATE elif exercise_source in [ 3 , 5 , 7 ] : return WIH_CORRECT_EX_CHOICE elif exercise_source == 6 : return WIH_CORRECT_EX_MATCH elif exercise_outcome in [ 1 , 2 , 4 ] : if exercise_source in [ 1 , 4 ] : return WIH_WRONG_EX_RECOGNIZE elif exercise_source == 2 : return WIH_WRONG_EX_TRANSLATE elif exercise_source in [ 3 , 5 , 7 ] : return WIH_WRONG_EX_CHOICE elif exercise_source == 6 : return WIH_WRONG_EX_MATCH
Matches the exercise type and result to a WordHistoryEvent code
returns: an integer representing the type of event
Matches the exercise type and result to a WordHistoryEvent code returns : an integer representing the type of event
"""
            Matches the exercise type and result to a WordHistoryEvent code

            returns: an integer representing the type of event
        """ #Correct #Recognize #Translate #Choice #Match three #Wrong #Recognize #Translate #Choice #Match three
exercise_outcome
exercise_source