Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions lms/static/scripts/frontend_apps/components/CheckpointSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ export default function CheckpointSelector({
}: CheckpointSelectorProps) {
const headingId = useId();

// The note below is specific to the "manual" reveal, so it only shows for that
// option. `selected` is currently always 'manual' (the only enabled option),
// but this keeps the association explicit for when more types are added.
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
const showManualNote = selected === 'manual';

return (
<div className="space-y-2">
<h3 id={headingId} className="uppercase font-medium text-slate-600">
Expand All @@ -52,18 +46,28 @@ export default function CheckpointSelector({
}
}}
>
<RadioGroup.Radio value="manual">Manual</RadioGroup.Radio>
<RadioGroup.Radio
value="manual"
// `small` matches how the other radio subtitles in the file picker
// are rendered (see `AutoGradingConfigurator`).
subtitle={
<small>
Instructor clicks a button to reveal student annotations
</small>
}
>
Manual reveal
</RadioGroup.Radio>
<RadioGroup.Radio value="more" disabled>
More coming soon
More options coming
</RadioGroup.Radio>
</RadioGroup>
{showManualNote && (
// No color class: inherits the base text color (black) per design.
<p>
Students will see when the settings have changed from
&ldquo;Hide&rdquo; to &ldquo;Reveal&rdquo; in their notifications.
</p>
)}
{/* No color class: inherits the base text color (black) per design. */}
<p>
A Checkpoint is the moment when student annotations switch from hidden
to visible. Before the Checkpoint, students write without seeing each
other&rsquo;s work.
</p>
</div>
);
}
11 changes: 10 additions & 1 deletion lms/static/scripts/frontend_apps/components/FilePickerApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,17 +322,26 @@ export default function FilePickerApp({ onSubmit }: FilePickerAppProps) {
// from the legal "left blank", and a complete one can have fallen into
// the past. Only the selector can tell; it shows the reason for any
// rejection itself.
/* istanbul ignore next: unreachable while the due-date step is skipped */
if (
workflowStep === 'due-date' &&
dueDateSelectorRef.current &&
!dueDateSelectorRef.current.validate()
) {
return;
}
// TEMPORARY: the due-date step is skipped because the
// date it collects has no effect yet, and offering it suggests the
// assignment does something it doesn't. Nothing else about the step was
// removed — to turn it back on, restore the commented-out line below in
// place of the one under it, and the blocks commented out in
// `FilePickerApp-test`.
//
// From 'checkpoint' the next step is 'due-date'; from 'due-date' (the last
// step) the workflow is done. The 'assignment-type' step has no "Next" — it
// advances directly on selection (see `selectAssignmentType`).
setWorkflowStep(step => (step === 'checkpoint' ? 'due-date' : 'done'));
// setWorkflowStep(step => (step === 'checkpoint' ? 'due-date' : 'done'));
setWorkflowStep('done');
};

// Pick an assignment type in the first workflow step. Unlike the later steps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,12 @@ describe('CheckpointSelector', () => {
assert.calledWith(fakeOnChange, 'automatic');
});

it('shows the reveal note when "manual" is selected', () => {
const wrapper = createComponent('manual');
it('explains what a checkpoint is', () => {
const wrapper = createComponent();

assert.include(
wrapper.text(),
'Students will see when the settings have changed',
);
});

it('hides the reveal note when a non-manual option is selected', () => {
// `selected` is typed `'manual'` today (the only option), so this exercises
// the conditional that will matter once more checkpoint types exist.
const wrapper = createComponent('more');

assert.notInclude(
wrapper.text(),
'Students will see when the settings have changed',
'A Checkpoint is the moment when student annotations switch from hidden to visible',
);
});

Expand Down
Loading
Loading