this commit fixes the issue where the state of the outcomes would not be
updated correctly when a user imported an outcome from the outcome
dialog. this was because the ".on" method was being used to listen to
the import event, which was causing the code inside to not use the
updated react state values. instead, it has been changed to use the
useRef hook that will always have the latest state value.
closes EVAL-4225
flag=enhanced_rubrics
test plan:
- go to the rubric builder page to create a new rubric
- verify that you can create a criterion from an outcome
- verify that if you create a 2nd criterion from a diffrerent outcome
that it works as expected
- delete the criterion first outcome
- verify that you can add the same outcome again without any issues
- try adding an outcome that is already listed. verify that you cannot
add it again and you see an error message
Change-Id: I0881bafe0c29a7e7199d38bc2769436095b852c9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349289
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>