schsrch icon indicating copy to clipboard operation
schsrch copied to clipboard

Add a MCQ Solver with clickable choices

Open gtm-nayan opened this issue 3 years ago • 1 comments

https://user-images.githubusercontent.com/50981692/129446423-7a3362eb-5b31-4fae-b7d6-3b9f5d6f9942.mp4

This would appear besides the paper when viewing any MCQ question paper. The component takes in the dirs array property of the MS that's returned from the API and renders a table using that.

I created the demo in svelte although I couldn't get any adapters to work. I couldn't find any proper documentation on how to get a svelte component to work with react but it has been mentioned many times so I'd believe it's possible. In the meantime, if you're willing to build it in react itself and would like to go through the source code of the svelte components or the compiled JS, let me know and I can upload the files.

gtm-nayan avatar Aug 14 '21 14:08 gtm-nayan

After going through the compiled JS file, I've managed to get it to the point where a function createMCQTable(dirsArray, elementToPopulate) can be called to inject the table into a html element.

I don't know react much but I found a few SO posts mentioning that injecting this code into a React app is achievable with the useEffect hook. The JS file created by the compiler is around ~20KB, would the size of the bundle be an issue?

gtm-nayan avatar Aug 15 '21 07:08 gtm-nayan