zeeguu/core/word_scheduling/arts/bookmark_priority_updater.py
def _update_exercise_source_stats(cls):
        """Update the ExerciseStats for the ArtsDiffSlow and ArtsDiffFast algorithm to provide
         normalization information between the different exercise sources"""
        exercise_sources = list(ExerciseSource.query.all())
        for source in exercise_sources:
            exercises = Exercise.query.filter_by(source_id=source.id).filter(Exercise.solving_speed <= 30000).all()
            reaction_times = list(map(lambda x: x.solving_speed, exercises))
            if len(reaction_times) == 0:
                # magic values for the reaction, if no data exists
                reaction_times = [5000, 6000]
                print('This exercise source has no data yet. ID: ' + str(source.id))

            mean, sd = NormalDistribution.calc_normal_distribution(
                reaction_times)
            if sd is None:
                sd = 1000
            exercise_stats = ExerciseStats.find_or_create(db.session, ExerciseStats(source, mean, sd))
            db.session.merge(exercise_stats)

        db.session.commit()
Update the ExerciseStats for the ArtsDiffSlow and ArtsDiffFast algorithm to provide
         normalization information between the different exercise sources
Update the ExerciseStats for the ArtsDiffSlow and ArtsDiffFast algorithm to provide
normalization information between the different exercise sources
Update the ExerciseStats for the ArtsDiffSlow and ArtsDiffFast algorithm to provide normalization information between the different exercise sources
def _update_exercise_source_stats(cls):
        exercise_sources = list(ExerciseSource.query.all())
        for source in exercise_sources:
            exercises = Exercise.query.filter_by(source_id=source.id).filter(Exercise.solving_speed <= 30000).all()
            reaction_times = list(map(lambda x: x.solving_speed, exercises))
            if len(reaction_times) == 0:
                reaction_times = [5000, 6000]
                print('This exercise source has no data yet. ID: ' + str(source.id))
            mean, sd = NormalDistribution.calc_normal_distribution(
                reaction_times)
            if sd is None:
                sd = 1000
            exercise_stats = ExerciseStats.find_or_create(db.session, ExerciseStats(source, mean, sd))
            db.session.merge(exercise_stats)
        db.session.commit()
def _update_exercise_source_stats ( cls ) : exercise_sources = list ( ExerciseSource . query . all ( ) ) for source in exercise_sources : exercises = Exercise . query . filter_by ( source_id = source . id ) . filter ( Exercise . solving_speed <= 30000 ) . all ( ) reaction_times = list ( map ( lambda x : x . solving_speed , exercises ) ) if len ( reaction_times ) == 0 : reaction_times = [ 5000 , 6000 ] print ( 'This exercise source has no data yet. ID: ' + str ( source . id ) ) mean , sd = NormalDistribution . calc_normal_distribution ( reaction_times ) if sd is None : sd = 1000 exercise_stats = ExerciseStats . find_or_create ( db . session , ExerciseStats ( source , mean , sd ) ) db . session . merge ( exercise_stats ) db . session . commit ( )
Update the ExerciseStats for the ArtsDiffSlow and ArtsDiffFast algorithm to provide
normalization information between the different exercise sources
Update the ExerciseStats for the ArtsDiffSlow and ArtsDiffFast algorithm to provide normalization information between the different exercise sources
"""Update the ExerciseStats for the ArtsDiffSlow and ArtsDiffFast algorithm to provide
         normalization information between the different exercise sources""" # magic values for the reaction, if no data exists
cls