MCPcopy Create free account
hub / github.com/codecombat/codecombat / checkIfProjectComplete

Function checkIfProjectComplete

app/lib/ai-projects-helper.js:2–17  ·  view source on GitHub ↗
(aiScenario, aiProjects)

Source from the content-addressed store, hash-verified

1module.exports = {
2 checkIfProjectComplete (aiScenario, aiProjects) {
3 if (aiScenario.minMsgs) { // if minMsgs is 0, let's still use old logic
4 if (aiProjects.some(project => {
5 return (project.totalChatMessages || 0) - (project.unsafeChatMessages?.length || 0) >= aiScenario.minMsgs
6 })) {
7 return true
8 }
9 return false
10 }
11 if (aiScenario.mode === 'learn to use' && aiProjects.some(project => (project.actionQueue?.length === 0))) {
12 return true
13 } else if (aiScenario.mode === 'use' && aiProjects.some(project => (project.isReadyToReview))) {
14 return true
15 }
16 return false
17 },
18}

Callers 1

statsForAIProjectsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected