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

Function getQuizScore

apps/web/components/utils.tsx:439–456  ·  view source on GitHub ↗
({ userId, problemId }: { userId: string; problemId: string })

Source from the content-addressed store, hash-verified

437}
438
439export async function getQuizScore({ userId, problemId }: { userId: string; problemId: string }) {
440 const value = await cache.get("getQuizScore", [userId.toString(), problemId.toString()]);
441 if (value) {
442 return value;
443 }
444 try {
445 const submissions = await db.quizScore.findMany({
446 where: {
447 userId,
448 problemId,
449 },
450 });
451 await cache.set("getQuizScore", [userId.toString(), problemId.toString()], submissions);
452 return submissions;
453 } catch (e) {
454 return [];
455 }
456}
457
458export async function getCategories() {
459 try {

Callers 1

fetchSubmissionFunction · 0.90

Calls 2

getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected