regolith/gradebuilder.py
def makestats(self, course):
        """Returns a dictionary of statistics for a course whose keys are
        the assignments and whose values are a (mean-problem, std-problem,
        mean-total, std-total) tuple.
        """
        scores = {}
        course_id = course['_id']
        for grade in self.gtx['grades']:
            if grade['course'] != course_id:
                 continue
            assignment_id = grade['assignment']
            if assignment_id not in scores:
                scores[assignment_id] = []
            scores[assignment_id].append(grade['scores'])
        stats = {}
        for assignment_id, data in scores.items():
            mu = np.mean(data, axis=0)
            sig = np.std(data, axis=0)
            max_score = np.max(data, axis=0)
            norm = st.norm(mu, sig)
            percent_above_60 = 1.0 - norm.cdf(0.6 * max_score)
            percent_above_80 = 1.0 - norm.cdf(0.8 * max_score)
            total = np.sum(data, axis=1)
            total_mu = np.mean(total, axis=0)
            total_sig = np.std(total, axis=0)
            total_max_score = np.max(total, axis=0)
            total_norm = st.norm(total_mu, total_sig)
            total_percent_above_60 = 1.0 - total_norm.cdf(0.6 * total_max_score)
            total_percent_above_80 = 1.0 - total_norm.cdf(0.8 * total_max_score)
            stats[assignment_id] = (
                mu, sig, max_score, percent_above_60, percent_above_80,
                total_mu, total_sig, total_max_score, total_percent_above_60,
                total_percent_above_80,
                )
        # handle stats for ungraded assignments
        for assignment in self.gtx['assignments']:
            assignment_id = assignment['_id']
            if assignment_id not in stats:
                n = len(assignment['points'])
                z = (0,) * n
                stats[assignment_id] = (z, z, z, z, z, 0, 0, 0, 0, 0)
        return stats
Returns a dictionary of statistics for a course whose keys are
        the assignments and whose values are a (mean-problem, std-problem,
        mean-total, std-total) tuple.
        
Returns a dictionary of statistics for a course whose keys are
the assignments and whose values are a (mean-problem, std-problem,
mean-total, std-total) tuple.
Returns a dictionary of statistics for a course whose keys are the assignments and whose values are a ( mean - problem std - problem mean - total std - total ) tuple .
def makestats(self, course):
        scores = {}
        course_id = course['_id']
        for grade in self.gtx['grades']:
            if grade['course'] != course_id:
                 continue
            assignment_id = grade['assignment']
            if assignment_id not in scores:
                scores[assignment_id] = []
            scores[assignment_id].append(grade['scores'])
        stats = {}
        for assignment_id, data in scores.items():
            mu = np.mean(data, axis=0)
            sig = np.std(data, axis=0)
            max_score = np.max(data, axis=0)
            norm = st.norm(mu, sig)
            percent_above_60 = 1.0 - norm.cdf(0.6 * max_score)
            percent_above_80 = 1.0 - norm.cdf(0.8 * max_score)
            total = np.sum(data, axis=1)
            total_mu = np.mean(total, axis=0)
            total_sig = np.std(total, axis=0)
            total_max_score = np.max(total, axis=0)
            total_norm = st.norm(total_mu, total_sig)
            total_percent_above_60 = 1.0 - total_norm.cdf(0.6 * total_max_score)
            total_percent_above_80 = 1.0 - total_norm.cdf(0.8 * total_max_score)
            stats[assignment_id] = (
                mu, sig, max_score, percent_above_60, percent_above_80,
                total_mu, total_sig, total_max_score, total_percent_above_60,
                total_percent_above_80,
                )
        for assignment in self.gtx['assignments']:
            assignment_id = assignment['_id']
            if assignment_id not in stats:
                n = len(assignment['points'])
                z = (0,) * n
                stats[assignment_id] = (z, z, z, z, z, 0, 0, 0, 0, 0)
        return stats
def makestats ( self , course ) : scores = { } course_id = course [ '_id' ] for grade in self . gtx [ 'grades' ] : if grade [ 'course' ] != course_id : continue assignment_id = grade [ 'assignment' ] if assignment_id not in scores : scores [ assignment_id ] = [ ] scores [ assignment_id ] . append ( grade [ 'scores' ] ) stats = { } for assignment_id , data in scores . items ( ) : mu = np . mean ( data , axis = 0 ) sig = np . std ( data , axis = 0 ) max_score = np . max ( data , axis = 0 ) norm = st . norm ( mu , sig ) percent_above_60 = 1.0 - norm . cdf ( 0.6 * max_score ) percent_above_80 = 1.0 - norm . cdf ( 0.8 * max_score ) total = np . sum ( data , axis = 1 ) total_mu = np . mean ( total , axis = 0 ) total_sig = np . std ( total , axis = 0 ) total_max_score = np . max ( total , axis = 0 ) total_norm = st . norm ( total_mu , total_sig ) total_percent_above_60 = 1.0 - total_norm . cdf ( 0.6 * total_max_score ) total_percent_above_80 = 1.0 - total_norm . cdf ( 0.8 * total_max_score ) stats [ assignment_id ] = ( mu , sig , max_score , percent_above_60 , percent_above_80 , total_mu , total_sig , total_max_score , total_percent_above_60 , total_percent_above_80 , ) for assignment in self . gtx [ 'assignments' ] : assignment_id = assignment [ '_id' ] if assignment_id not in stats : n = len ( assignment [ 'points' ] ) z = ( 0 , ) * n stats [ assignment_id ] = ( z , z , z , z , z , 0 , 0 , 0 , 0 , 0 ) return stats
Returns a dictionary of statistics for a course whose keys are
the assignments and whose values are a (mean-problem, std-problem,
mean-total, std-total) tuple.
Returns a dictionary of statistics for a course whose keys are the assignments and whose values are a ( mean - problem std - problem mean - total std - total ) tuple .
"""Returns a dictionary of statistics for a course whose keys are
        the assignments and whose values are a (mean-problem, std-problem,
        mean-total, std-total) tuple.
        """ # handle stats for ungraded assignments
self
course