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

Function makeCourseInstance

test/app/factories.ozar.js:180–195  ·  view source on GitHub ↗
(attrs, sources)

Source from the content-addressed store, hash-verified

178 },
179
180 makeCourseInstance(attrs, sources) {
181 if (sources == null) { sources = {}; }
182 const _id = _.uniqueId('course_instance_');
183 const course = sources.course || this.makeCourse();
184 const classroom = sources.classroom || this.makeClassroom();
185 const owner = sources.owner || this.makeUser();
186 const members = sources.members || new Users();
187 attrs = _.extend({}, {
188 _id,
189 courseID: course.id,
190 classroomID: classroom.id,
191 ownerID: owner.id,
192 members: members.pluck('_id')
193 }, attrs);
194 return new CourseInstance(attrs);
195 },
196
197 makeLevelCompleteAchievement(attrs, sources) {
198 if (sources == null) { sources = {}; }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected