(newClassroom, data, options)
| 683 | } |
| 684 | |
| 685 | onJoinClassroomSuccess (newClassroom, data, options) { |
| 686 | this.state = null |
| 687 | if (application.tracker != null) { |
| 688 | application.tracker.trackEvent('Joined classroom', { |
| 689 | category: 'Courses', |
| 690 | classCode: this.classCode, |
| 691 | classroomID: newClassroom.id, |
| 692 | classroomName: newClassroom.get('name'), |
| 693 | ownerID: newClassroom.get('ownerID'), |
| 694 | }) |
| 695 | } |
| 696 | this.classrooms.add(newClassroom) |
| 697 | this.render() |
| 698 | this.classroomJustAdded = newClassroom.id |
| 699 | |
| 700 | const classroomCourseInstances = new CocoCollection([], { url: '/db/course_instance', model: CourseInstance }) |
| 701 | classroomCourseInstances.fetch({ data: { classroomID: newClassroom.id } }) |
| 702 | return this.listenToOnce(classroomCourseInstances, 'sync', () => { |
| 703 | // TODO: Smoother system for joining a classroom and course instances, without requiring page reload, |
| 704 | // and showing which class was just joined. |
| 705 | document.location.search = '' |
| 706 | }) // Using document.location.reload() causes an infinite loop of reloading |
| 707 | } |
| 708 | |
| 709 | nextLevelUrl () { |
| 710 | if (!this.nextLevelInfo) { return null } |
no test coverage detected