READY FOR REVIEW: PyLTI edX LTI 2.0 support

This adds post_grade2(grade, user=) to the LTI object. Thus if enduser knows <anon_id> it can submit grade for that user. 
Maybe note that in the doc string, file a JIRA ticket with edX if it
doesn't exist, and ref it here since this isn't technically correct
behavior (just pragmatic).

On Thu, Nov 6, 2014 at 5:56 PM, Ivica Ceraj <notifications@github.com>
wrote:

> In pylti/flask.py:
>
> > @@ -164,6 +169,30 @@ def post_grade(self, grade):
> >
> >          return False
> >
> > +    def post_grade2(self, grade, user=None, comment=''):
> > +        content_type = 'application/vnd.ims.lis.v2.result+json'
> > +        if user is None:
> > +            user = self.user_id()
> > +        lti2_url = self.response_url().replace(
> > +            "/grade_handler",
> > +            "/lti_2_0_result_rest_handler/user/{}".format(user))
>
> :) funny thing.
> edX does not have LTI 2 launch request, only grade handler. And grade
> handler is build like that:
>
> https://github.com/starteam/edx-platform/blob/master/common/lib/xmodule/xmodule/lti_2_util.py
>
> I'm just providing functionality currently available.
>
> On the other note, at LTI consumer meeting today we talked about LTI 2.x
> support and while it is TBD I think we would evolve code as edX platform
> evolves.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mitodl/pylti/pull/6/files#r19982909>.
>