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

Function resetProgressOfUsers

app/core/store/modules/levelSessions.js:286–310  ·  view source on GitHub ↗
({ commit, dispatch }, { users, courseInstanceId, currentClassroom })

Source from the content-addressed store, hash-verified

284 },
285
286 async resetProgressOfUsers ({ commit, dispatch }, { users, courseInstanceId, currentClassroom }) {
287 for (let i = 0; i< users.length; i++) {
288 const userId = users[i]._id
289 await levelSessionsApi.resetProgressOfUserInCourseInstance(courseInstanceId, userId)
290 if (i % 3 === 0 || i === users.length - 1) {
291 noty({
292 text: `Progress reset status: ${i + 1} / ${users.length}`,
293 type: 'success',
294 timeout: 2000,
295 layout: 'center'
296 })
297 }
298 }
299 if (currentClassroom) {
300 noty({
301 text: 'Fetching progress after deletion',
302 type: 'information',
303 timeout: 3000,
304 layout: 'center'
305 })
306 commit('clearSessionsByClassroom', currentClassroom._id)
307 await dispatch('fetchForClassroomMembers', { classroom: currentClassroom })
308 }
309
310 }
311 }
312}

Callers

nothing calls this directly

Calls 1

dispatchFunction · 0.85

Tested by

no test coverage detected