added "all" flag for getPending(course)