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

Function getAllMCQQuestion

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

Source from the content-addressed store, hash-verified

356}
357
358export async function getAllMCQQuestion(problemId: string) {
359 const value = await cache.get("getAllMCQQuestion", [problemId.toString()]);
360 if (value) {
361 return value;
362 }
363 try {
364 const mcqs = await db.mCQQuestion.findMany({
365 where: {
366 problemId,
367 },
368 });
369 await cache.set("getAllMCQQuestion", [problemId.toString()], mcqs);
370 return mcqs;
371 } catch (e) {
372 return [];
373 }
374}
375
376export async function createMCQ(data: Omit<MCQQuestion, "id">) {
377 try {

Callers 1

fetchMCQsFunction · 0.90

Calls 2

getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected