The main difference is having the debug message available, to make clear
the students & assignments for which grades are missing.

This helps in the context of using edx-platform residentially.


On Wed, Oct 16, 2013 at 5:07 PM, David Ormsbee <notifications@github.com>wrote:

> In lms/djangoapps/instructor/views/legacy.py:
>
> > @@ -469,7 +469,14 @@ def domatch(x):
> >              else:
> >                  aidx = allgrades['assignments'].index(aname)
> >                  datatable = {'header': ['External email', aname]}
> > -                datatable['data'] = [[x.email, x.grades[aidx]] for x in allgrades['students']]
> > +                ddata = []
> > +                for x in allgrades['students']:	  # do one by one in case there is a student who has only partial grades
> > +                    try:
> > +                        ddata.append([x.email, x.grades[aidx]])
> > +                    except IndexError:
> > +                        log.debug('No grade for assignment %s (%s) for student %s'  % (aidx, aname, x.email))
> > +                datatable['data'] = ddata
> > +
> >                  datatable['title'] = 'Grades for assignment "%s"' % aname
>
> Is there any difference between this and just adding a if aidx in x.gradesto the original list comprehension?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/edx/edx-platform/pull/1334/files#r7016005>
> .
>