MCPcopy Index your code
hub / github.com/codecombat/codecombat / fetchForClassroom

Method fetchForClassroom

app/collections/Users.js:22–44  ·  view source on GitHub ↗
(classroom, options)

Source from the content-addressed store, hash-verified

20 }
21
22 fetchForClassroom (classroom, options) {
23 if (options == null) { options = {} }
24 if (options.removeDeleted) {
25 delete options.removeDeleted
26 this.listenTo(this, 'sync', this.removeDeletedUsers)
27 }
28 const classroomID = classroom.id || classroom
29 const limit = 10
30 let skip = 0
31 const size = _.size(classroom.get('members'))
32 options.url = `/db/classroom/${classroomID}/members`
33 if (options.data == null) { options.data = {} }
34 options.data.memberLimit = limit
35 options.remove = false
36 const jqxhrs = []
37 while (skip < size) {
38 options = _.cloneDeep(options)
39 options.data.memberSkip = skip
40 jqxhrs.push(this.fetch(options))
41 skip += limit
42 }
43 return jqxhrs
44 }
45
46 removeDeletedUsers () {
47 this.remove(this.filter(user => user.get('deleted'))

Callers 15

revokeStudentLicensesMethod · 0.95
levels.jsFile · 0.45
initializeMethod · 0.45
constructorMethod · 0.45
constructorMethod · 0.45
fetchStudentsMethod · 0.45
fetchPrepaidsMethod · 0.45
onLoadedMethod · 0.45
constructorMethod · 0.45
fetchPrepaidsMethod · 0.45
onceClassroomsSyncMethod · 0.45
constructorMethod · 0.45

Calls 2

getMethod · 0.45
fetchMethod · 0.45

Tested by

no test coverage detected