Skip to content

Potential fixes for 2 code quality findings#115

Merged
ajm19826 merged 2 commits intomainfrom
ai-findings-autofix/math-grade4-division-remainders.html
Apr 10, 2026
Merged

Potential fixes for 2 code quality findings#115
ajm19826 merged 2 commits intomainfrom
ai-findings-autofix/math-grade4-division-remainders.html

Conversation

@ajm19826
Copy link
Copy Markdown
Member

This PR applies 2/4 suggestions from code quality AI findings. 2 suggestions were skipped to avoid creating conflicts.

ajm19826 and others added 2 commits April 10, 2026 16:21
…lot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…lot Autofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@ajm19826 ajm19826 marked this pull request as ready for review April 10, 2026 20:21
@ajm19826 ajm19826 merged commit 9ab27d8 into main Apr 10, 2026
8 checks passed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces logout state handling and input validation for the division remainder exercise. Specifically, it resets user progress and updates the sidebar when a user logs out, and adds checks to ensure inputs are valid numbers. The review feedback suggests a more comprehensive state reset upon logout, including resetting the practice count and returning the user to the introduction page to maintain a consistent UI state.

Comment on lines +167 to +178
} else {
currentUser = null;
stepsCompleted = {
step_0: false,
step_1: false,
step_2: false,
step_3: false,
step_4: false,
step_5: false
};
updateSidebar();
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When the user logs out, the application resets currentUser and stepsCompleted, but it does not reset the current lesson progress (practiceCount) or the UI view (currentStep). This can leave the user on a restricted practice page in an unauthenticated state. Calling showPage(0) will reset the view to the introduction and internally trigger updateSidebar(), ensuring a consistent state.

Suggested change
} else {
currentUser = null;
stepsCompleted = {
step_0: false,
step_1: false,
step_2: false,
step_3: false,
step_4: false,
step_5: false
};
updateSidebar();
}
} else {
currentUser = null;
stepsCompleted = {
step_0: false,
step_1: false,
step_2: false,
step_3: false,
step_4: false,
step_5: false
};
practiceCount = 0;
showPage(0);
}

@github-actions
Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 270afed.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant