MCPcopy Create free account
hub / github.com/code100x/daily-code / getAllMCQsForProblem

Function getAllMCQsForProblem

apps/web/components/utils.tsx:414–430  ·  view source on GitHub ↗
(problemId: string)

Source from the content-addressed store, hash-verified

412 }
413}
414export async function getAllMCQsForProblem(problemId: string) {
415 const value = await cache.get("getAllMCQsForProblem", [problemId.toString()]);
416 if (value) {
417 return value;
418 }
419 try {
420 const mcqs = await db.mCQQuestion.findMany({
421 where: {
422 problemId,
423 },
424 });
425 await cache.set("getAllMCQsForProblem", [problemId.toString()], mcqs);
426 return mcqs;
427 } catch (e) {
428 return [];
429 }
430}
431
432export async function createQuizScore(data: { userId: string; score: number; problemId: string }) {
433 const submission = await db.quizScore.create({

Callers 1

fetchQuestionsFunction · 0.90

Calls 2

getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected