ziafazal/api-time-series-invalid-data: fix negative values in users_not_started

@mattdrayer calculating time series data from `StudentProgress` instead of `StudentProgressHistory` to avoid negative values for `users_not_started` metrics.  @dino-cikatic I'm making `users_enrolled` metrics same as other so it mean it would add up number of users enrolled earlier than start date as does the other metrics. Fixed some broken tests.
StudentProgress records contain a 'created' field which indicates when the
record was first added to the table -- we can use this field to place
students into their respective date buckets

On Fri, Nov 21, 2014 at 9:43 AM, Martyn James <notifications@github.com>
wrote:

> In lms/djangoapps/api_manager/courses/views.py:
>
> > @@ -1617,8 +1617,8 @@ def get(self, request, course_id):  # pylint: disable=W0613
> >          enrolled_series = get_time_series_data(enrolled_qs, start_dt, end_dt, interval=interval,
> >                                                 date_field='created', aggregate=Count('id'))
> >          started_series = get_time_series_data(users_started_qs, start_dt, end_dt, interval=interval,
> > -                                              date_field='created', date_field_model=StudentProgressHistory,
> > -                                              aggregate=Count('user', distinct=True))
> > +                                              date_field='created', date_field_model=StudentProgress,
>
> Does StudentProgress also contain the history? Otherwise how can we get
> all the time series data?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/edx-solutions/edx-platform/pull/321/files#r20717865>.
>



-- 
Matthew Drayer
Solutions Architect
edX | MIT
mattdrayer@edx.org