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

Function getAllMCQs

apps/web/components/utils.tsx:337–356  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

335}
336
337export async function getAllMCQs() {
338 const value = await cache.get("getAllMCQs", []);
339 if (value) {
340 return value;
341 }
342 try {
343 const mcqs = await db.problem.findMany({
344 where: {
345 type: "MCQ",
346 },
347 include: {
348 mcqQuestions: true,
349 },
350 });
351 await cache.set("getAllMCQs", [], mcqs);
352 return mcqs;
353 } catch (e) {
354 return [];
355 }
356}
357
358export async function getAllMCQQuestion(problemId: string) {
359 const value = await cache.get("getAllMCQQuestion", [problemId.toString()]);

Callers 1

fetchMCQsFunction · 0.90

Calls 2

getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected