Skip to content

Fix/update kd quiz question#213

Open
meganrm wants to merge 7 commits into
fix/organize-statefrom
fix/update-kd-quiz-question
Open

Fix/update kd quiz question#213
meganrm wants to merge 7 commits into
fix/organize-statefrom
fix/update-kd-quiz-question

Conversation

@meganrm
Copy link
Copy Markdown
Contributor

@meganrm meganrm commented May 26, 2026

Problem

Estimated review size: md

closes #205

Solution

  1. added a Ki quiz question that follows the same setup as the Kd question. Changed the variable name to reflect the more general case.
  2. Disabled the slider in the 3rd module to make sure the user measures the baseline point before moving on.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Steps to Verify:

  1. bun dev
  2. go to third module by clicking on the nav bar
  3. follow instructions
  4. you should see a Ki question when it's relevant

Screenshots (optional):

Screenshot 2026-05-21 at 5 57 49 PM Screenshot 2026-05-21 at 5 57 57 PM

@meganrm meganrm requested a review from a team as a code owner May 26, 2026 22:02
@meganrm meganrm requested review from ShrimpCryptid, Copilot and tyler-foster and removed request for a team May 26, 2026 22:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the competitive binding (Module.A_B_D_AB) learning flow to ask for Kᵢ instead of Kd, and enforces collecting a baseline (0 inhibitor) measurement before allowing the inhibitor concentration to be adjusted.

Changes:

  • Added a new KiQuestion component and conditionally render it for the competitive binding module.
  • Disabled the inhibitor concentration slider in module 3 until a baseline (0) concentration has been recorded, with a hover help popup explaining why.
  • Renamed the gating prop/variable from canDetermineEquilibrium/canDetermineKd to a more general canDetermineConstant.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/components/quiz-questions/KiQuestion.tsx New quiz question component for Kᵢ in the competitive binding module.
src/components/main-layout/CenterPanel.tsx Switches between Kd/Ki question based on the active module.
src/components/concentration-display/Concentration.tsx Disables the slider in module 3 until baseline is recorded.
src/components/concentration-display/ConcentrationSlider.tsx Adds disabled support and a help popup explaining baseline requirement.
src/components/HelpPopup.tsx Updates HelpPopup API to use open/trigger.
src/components/main-layout/RightPanel.tsx Adapts HelpPopup usage to the updated open prop.
src/App.tsx Renames determination gating logic to canDetermineConstant and updates downstream usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +41 to +46
const handleAnswerSelection = (answer: valueType | null) => {
setSelectedAnswer(Number(answer));
if (formState === FormState.Incorrect) {
setFormState(FormState.Clear);
}
};
Comment thread src/components/quiz-questions/KiQuestion.tsx Outdated
Comment on lines +84 to +89
<InputNumber
aria-labelledby="ki question"
value={selectedAnswer || ""}
onChange={handleAnswerSelection}
placeholder="Type value..."
/>
Comment thread src/components/concentration-display/ConcentrationSlider.tsx Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@ShrimpCryptid ShrimpCryptid left a comment

Choose a reason for hiding this comment

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

Left some non-blocking comments!

Comment on lines +64 to +66
} else {
setFormState(FormState.Incorrect);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So just to check, if the student submits a wrong answer, it will show an incorrect state, and if the student hits submit again, it will clear the state?

Does QuizForm change the button message text when in the incorrect state?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes the button says "try again"

successMessage={getSuccessMessage(selectedAnswer!)}
failureMessage='Visit the "Learn how to derive Ki" button above, then use the Equilibrium concentration plot to answer.'
formState={formState}
id="Ki Value"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can id strings contain spaces? Or is this being used differently by QuizForm?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, looked in QuizForm. Out of scope of this PR but I feel like id has two uses that are both different from the HTML id convention. Maybe it would be better to split it into id and minimizedTitle props?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah, that seems like a good idea

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in #216

Comment thread src/components/quiz-questions/KiQuestion.tsx Outdated
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.

3 participants