Skip to content

Commit 5da095d

Browse files
authored
[Bugfix:TAGrading] Fully discard changes on click (Submitty#11488)
### Please check if the PR fulfills these requirements: * [ ] Tests for the changes have been added/updated (if possible) * [ ] Documentation has been updated/added if relevant * [ ] Screenshots are attached to Github PR if visual/UI changes were made ### What is the current behavior? <!-- List issue if it fixes/closes/implements one using the "Fixes #<number>" or "Closes #<number>" syntax --> When clicking to discard changes the component will be closed and the changes will not be saved, but they are still reflected locally until refresh. ### What is the new behavior? When discard is clicked the local data is also reset to show the component in the state it was before the grader opened it. ### Other information? <!-- Is this a breaking change? --> <!-- How did you test --> Fixes Submitty#10717
1 parent cd52209 commit 5da095d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

site/public/js/ta-grading-rubric.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2855,10 +2855,9 @@ async function closeComponentInstructorEdit(component_id, saveChanges) {
28552855
* @return {void}
28562856
*/
28572857
async function closeComponentGrading(component_id, saveChanges) {
2858-
GRADED_COMPONENTS_LIST[component_id] = getGradedComponentFromDOM(component_id);
2859-
COMPONENT_RUBRIC_LIST[component_id] = getComponentFromDOM(component_id);
2860-
28612858
if (saveChanges) {
2859+
GRADED_COMPONENTS_LIST[component_id] = getGradedComponentFromDOM(component_id);
2860+
COMPONENT_RUBRIC_LIST[component_id] = getComponentFromDOM(component_id);
28622861
await saveComponent(component_id);
28632862
}
28642863
// Finally, render the graded component in non-edit mode with the mark list hidden

0 commit comments

Comments
 (0)