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
4 changes: 2 additions & 2 deletions frontend/src/blocks/capstone-check/CapstoneCheckClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ function Report({ check, onSend, sending, decided }: { check: CapstoneCheckView;
<>
<Button type="button" variant="outline" size="sm" onClick={onSend} loading={sending} disabled={sending}>
<Send />
Ask my mentor to look
Move on, and ask my mentor to check
</Button>
<p className="text-xs text-muted-foreground">The AI checks your project. You can also ask a mentor for feedback.</p>
<p className="text-xs text-muted-foreground">The AI notes are tips. Send it to your mentor and you can go on to the next chapter now, then come back to these checks later.</p>
</>
)}
</div>
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/shared/blocks/open-question/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ export type OpenQuestionConfig = z.infer<typeof OpenQuestionConfigSchema>;
export type SanitizedOpenQuestionConfig = Omit<
OpenQuestionConfig,
"rubric" | "sampleAnswer" | "hints" | "personalizeInstructions"
>;
> & {
/**
* Set when the course turned on AI feedback for a question that is not AI-graded on its own.
* The answer already counts once sent, so the reader tells the learner they can move on.
*/
countsOnSubmit?: boolean;
};

/** True when this open question is graded instantly with the learner's OpenRouter key. */
export function isLlmGradedOpenQuestion(config: unknown): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,11 @@ export function OpenQuestionClient({
Not quite{typeof llmResult.attempt === "number" ? ` (try ${llmResult.attempt})` : ""}
</p>
</div>
{config.countsOnSubmit ? (
<p className="border-b border-destructive px-4 py-3 text-sm font-medium leading-relaxed text-foreground">
This already counts as done, so you can go on to the next lesson now. The notes below are tips. Come back and improve your answer whenever you like.
</p>
) : null}
{llmResult.explanation ? (
<p className="whitespace-pre-wrap px-4 py-3 text-sm leading-relaxed text-foreground">
{llmResult.explanation}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ export type OpenQuestionConfig = z.infer<typeof OpenQuestionConfigSchema>;
export type SanitizedOpenQuestionConfig = Omit<
OpenQuestionConfig,
"rubric" | "sampleAnswer" | "hints" | "personalizeInstructions"
>;
> & {
/**
* Set when the course turned on AI feedback for a question that is not AI-graded on its own.
* The answer already counts once sent, so the reader tells the learner they can move on.
*/
countsOnSubmit?: boolean;
};

/** True when this open question is graded instantly with the learner's OpenRouter key. */
export function isLlmGradedOpenQuestion(config: unknown): boolean {
Expand Down
5 changes: 4 additions & 1 deletion server/src/services/blocks/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { loadCapstoneState } from "../capstone/service.js";
import { CodeConfigSchema, type SanitizedCodeConfig } from "../../shared/blocks/code/schema.js";
import { MustReadConfigSchema } from "../../shared/blocks/must-read/schema.js";
import {
isLlmGradedOpenQuestion,
shouldLlmGradeOpenQuestion,
OpenQuestionConfigSchema,
type OpenQuestionStoredPayload,
Expand Down Expand Up @@ -179,7 +180,9 @@ async function blockStateFor(
return {
type: "OPEN_QUESTION",
// Course-level auto-grade must look like llm mode so the learner UI asks for an OpenRouter key.
config: llmMode ? { ...clientConfig, autoGrade: "llm" as const } : clientConfig,
config: llmMode
? { ...clientConfig, autoGrade: "llm" as const, ...(isLlmGradedOpenQuestion(config) ? {} : { countsOnSubmit: true }) }
: clientConfig,
group: getOpenQuestionGroupPosition(chapterBlocks, blockId),
...(aiStatus
? { ai: { configured: aiStatus.configured, hasKey: aiStatus.hasKey } }
Expand Down
8 changes: 7 additions & 1 deletion server/src/shared/blocks/open-question/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ export type OpenQuestionConfig = z.infer<typeof OpenQuestionConfigSchema>;
export type SanitizedOpenQuestionConfig = Omit<
OpenQuestionConfig,
"rubric" | "sampleAnswer" | "hints" | "personalizeInstructions"
>;
> & {
/**
* Set when the course turned on AI feedback for a question that is not AI-graded on its own.
* The answer already counts once sent, so the reader tells the learner they can move on.
*/
countsOnSubmit?: boolean;
};

/** True when this open question is graded instantly with the learner's OpenRouter key. */
export function isLlmGradedOpenQuestion(config: unknown): boolean {
Expand Down
Loading