Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
*/
public enum ScienceEventType {
LECTURE__OPEN, LECTURE__OPEN_UNIT, EXERCISE__OPEN, COMPETENCY__OPEN, COMPETENCY__OPEN_OVERVIEW, LEARNING_PATH__OPEN, LEARNING_PATH__OPEN_NAVIGATION, LEARNING_PATH__NAV_NEXT,
LEARNING_PATH__NAV_PREV, LEARNING_PATH__OPEN_GRAPH
LEARNING_PATH__NAV_PREV, LEARNING_PATH__OPEN_GRAPH, THEIA__OPEN
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import { ProfileService } from 'app/core/layouts/profiles/shared/profile.service
import { IdeSettingsService } from 'app/core/user/settings/ide-preferences/ide-settings.service';
import { Ide } from 'app/core/user/settings/ide-preferences/ide.model';
import { ProfileInfo } from 'app/core/layouts/profiles/profile-info.model';
import { ScienceService } from 'app/shared/science/science.service';
import { ScienceEventType } from 'app/shared/science/science.model';

export enum RepositoryAuthenticationMethod {
Password = 'password',
Expand Down Expand Up @@ -72,6 +74,7 @@ export class CodeButtonComponent implements OnInit {
private alertService = inject(AlertService);
private theiaService = inject(TheiaService);
private router = inject(Router);
private readonly scienceService = inject(ScienceService);

protected readonly FeatureToggle = FeatureToggle;
protected readonly ProgrammingLanguage = ProgrammingLanguage;
Expand Down Expand Up @@ -441,6 +444,10 @@ export class CodeButtonComponent implements OnInit {
const userName = this.user.name;
const userEmail = this.user.email;

if (this.exercise()) {
this.scienceService.logEvent(ScienceEventType.THEIA__OPEN, this.exercise()!.id);
}

await this.theiaService.startOnlineIDE(this.theiaPortalURL, theiaImage, repositoryUri, userName, userEmail);
}
}
1 change: 1 addition & 0 deletions src/main/webapp/app/shared/science/science.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export enum ScienceEventType {
LEARNING_PATH__NAV_NEXT = 'LEARNING_PATH__NAV_NEXT',
LEARNING_PATH__NAV_PREV = 'LEARNING_PATH__NAV_PREV',
LEARNING_PATH__OPEN_GRAPH = 'LEARNING_PATH__OPEN_GRAPH',
THEIA__OPEN = 'THEIA__OPEN',
}

export class ScienceEventDTO {
Expand Down
Loading