Propositional Logic Response Area#7
Propositional Logic Response Area#7ashwin6-dev wants to merge 20 commits intolambda-feedback:mainfrom
Conversation
…plemented in evaluation_function)
…nge, full stringify or partial stringify
m-messer
left a comment
There was a problem hiding this comment.
Thanks for your work on this! I've add a few minor comments, and there is a little git cleanup that would be helpful to sort.
There was a problem hiding this comment.
Should this be commited as a change?
There was a problem hiding this comment.
Why was this workaround necessary? This would be good to feedback.
| import { SandboxResponseAreaTub } from './types/Sandbox/index' | ||
|
|
||
| // Create a QueryClient instance | ||
| const queryClient = new QueryClient({ |
There was a problem hiding this comment.
What is the query client used for?
| } | ||
|
|
||
| export function deserializeAnswer(raw: string): PropositionalLogicAnswerSchema | undefined { | ||
| if (!raw || typeof raw !== 'object') return undefined |
There was a problem hiding this comment.
Should it be typeof raw !== 'string' instead?
| allowPhoto: this.config.allowPhoto, | ||
| setAllowSave: props.setAllowSave, | ||
| onChange: args => { | ||
| this.config = { ...this.config!, expectedAnswer: args.expectedAnswer } |
There was a problem hiding this comment.
The onChange handler only extracts expectedAnswer:
this.config = { ...this.config!, expectedAnswer: args.expectedAnswer } But PropositionalLogicWizard emits { expectedAnswer, allowHandwrite, allowPhoto } via onChange. The two allow-flags are ignored completely. If a teacher unchecks "allow handwrite" in the
wizard, the change is never saved to this.config. What about the handler being:
this.config = { ...this.config!, expectedAnswer: args.expectedAnswer, allowHandwrite: args.allowHandwrite, allowPhoto: args.allowPhoto }
?
|
|
||
| public readonly displayInFlexContainer = false | ||
|
|
||
| protected answerSchema = z.unknown() |
There was a problem hiding this comment.
propositionalLogicAnswerSchema is already imported on line 11 and should be used here.
| truthTable: undefined, | ||
| } | ||
|
|
||
| const EMPTY_EXPECTED: PropositionalLogicExpectedAnswerSchema = { |
There was a problem hiding this comment.
Another EMPTY_EXPECTED const is defined in PropositionalLogicWizard.
Should they be refactored?
| responseType: this.responseType, | ||
| config: this.config, | ||
| answer: this.config.expectedAnswer, | ||
| } as unknown as Parameters<typeof props.handleChange>[0]) |
There was a problem hiding this comment.
as unknown as baypasses TypeScript's type system. Please check if it can be done differently
Check
README.mdwithin thePropositionalLogicfolder for a short description of what this response area contains.Key External Changes
Some changes were made outside the
PropositionalLogicfolder.src/externals/styles/fonts.tsx- wasexternals/styles/fonts.tsx (1:37): "Roboto" is not exported by "node_modules/next/font/google/index.js"error with the original file. Current file injects Google Fonts CSS at runtime.src/sandbox-component.tsx- added a query client provider wrapper. Had aError: No QueryClient set, use QueryClientProvider to set onein the brower console otherwise. I think this is due to the fact this response area uses OmniInput.OmniInput Preview Issue To Look At
Currently, preview doesn't show anything. I changed the backend to return a fixed dummy value for now, but still the preview doesn't show anything, which makes me believe there is an issue in the frontend.
When hand drawing the input, there is a console error saying
Input processing error (draw): TypeError: fetchData(...) is not a function. Typing the input doesn't have this error, but still the preview is empty.In
externals/api/fetcher.ts,fetchDatareturnsnull, which I think is the issue, but I do not know how I should go from there.Other response areas that use OmniInput display previews fine in the sandbox.