({ commit, dispatch }, { users, courseInstanceId, currentClassroom })
| 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 | } |
nothing calls this directly
no test coverage detected