wip: refactor store_assignment_grade_if_need
wip: stash changes
wip: use new refactored function store_course_grade_if_need