'Update the ID of the module that the specified user last visited in the specified course.'

@mobile_course_access(depth=2)
def patch(self, request, course, *args, **kwargs):

    module_id = request.data.get('last_visited_module_id')
    modification_date_string = request.data.get('modification_date')
    modification_date = None
    if modification_date_string:
        modification_date = dateparse.parse_datetime(modification_date_string)
        if ((not modification_date) or (not modification_date.tzinfo)):
            return Response(errors.ERROR_INVALID_MODIFICATION_DATE, status=400)
    if module_id:
        try:
            module_key = UsageKey.from_string(module_id)
        except InvalidKeyError:
            return Response(errors.ERROR_INVALID_MODULE_ID, status=400)
        return self._update_last_visited_module_id(request, course, module_key, modification_date)
    else:
        return self._get_course_info(request, course)
