()
| 164 | } |
| 165 | |
| 166 | load () { |
| 167 | this.loadStartTime = new Date() |
| 168 | const levelLoaderOptions = { |
| 169 | supermodel: this.supermodel, |
| 170 | levelID: this.levelID, |
| 171 | sessionID: this.sessionID, |
| 172 | opponentSessionID: this.opponentSessionID, |
| 173 | team: utils.getQueryVariable('team'), |
| 174 | observing: this.observing, |
| 175 | courseID: this.courseID, |
| 176 | courseInstanceID: this.courseInstanceID, |
| 177 | classroomId: this.classroomId |
| 178 | } |
| 179 | if (me.isSessionless()) { |
| 180 | levelLoaderOptions.fakeSessionConfig = {} |
| 181 | } |
| 182 | this.levelLoader = new LevelLoader(levelLoaderOptions) |
| 183 | this.listenToOnce( |
| 184 | this.levelLoader, |
| 185 | 'world-necessities-loaded', |
| 186 | this.onWorldNecessitiesLoaded |
| 187 | ) |
| 188 | this.classroomAceConfig = { liveCompletion: true, disablePaste: false } // default (home users, teachers, etc.) |
| 189 | if (this.courseInstanceID) { |
| 190 | const fetchAceConfig = $.get(`/db/course_instance/${this.courseInstanceID}/classroom?project=aceConfig,members`) |
| 191 | this.supermodel.trackRequest(fetchAceConfig) |
| 192 | fetchAceConfig.then(classroom => { |
| 193 | this.classroomAceConfig.liveCompletion = classroom.aceConfig?.liveCompletion != null ? classroom.aceConfig.liveCompletion : true |
| 194 | this.classroomAceConfig.disablePaste = classroom.aceConfig?.disablePaste |
| 195 | const levelChat = classroom.aceConfig?.levelChat || 'none' |
| 196 | this.classroomAceConfig.levelChat = levelChat |
| 197 | store.commit('game/setAIHintVisible', levelChat !== 'none') |
| 198 | }) |
| 199 | } |
| 200 | if (me.isTeacher()) { |
| 201 | store.commit('game/setAIHintVisible', true) |
| 202 | } |
| 203 | |
| 204 | return this.listenTo( |
| 205 | this.levelLoader, |
| 206 | 'world-necessity-load-failed', |
| 207 | this.onWorldNecessityLoadFailed |
| 208 | ) |
| 209 | } |
| 210 | |
| 211 | onLevelLoaded (e) { |
| 212 | let needle |
no test coverage detected