Skip to content
Merged
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
26 changes: 9 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
# DebugChallenger
# PRIMMDebug

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.3.5.
An educational tool designed to teach secondary school students a reflective approach to debugging in a text-based programming language. Inspired by findings from my PhD project into beginner programmers' debugging strategies.

## Development server
Built in [Angular CLI](https://github.com/angular/angular-cli) (originally in version 17.3.5), served by a [Firebase Firestore](https://firebase.google.com/docs/firestore) database and hosted with [Firebase hosting](https://firebase.google.com/docs/hosting) on https://primmdebug.web.app/.

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
## Development Setup

## Code scaffolding
Run `ng serve` for a dev server and navigate to `http://localhost:4200/`. Currently, no data will load on the homepage due to the use of git-ignored environment variables for establishing a database connection (adding of sample data is a known issue, provisionally to be implemented by September 2025). In the meantime, feel free to investigate the source code!

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build
### Building

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
## Contributing

## Further help
Pedagogical/technical/UX suggestions are welcome! Just open up an [issue](https://github.com/LaurieGale10/primmdebug/issues) and tag it appropriately.

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
Pull requests are welcome but unlikely to be incorporated until September 2025.
9 changes: 0 additions & 9 deletions src/app/homepage/homepage.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@
<h1>PRIMMDebug</h1>
<mat-icon class="bug-icon">bug_report</mat-icon>
</div>

@if (displaySurveyButton) {
<button mat-raised-button color="grey" class="button-display" (click)="openSurvey()">
<div class="survey-text">
<mat-icon class="survey-icon">menu_book</mat-icon>
<h1>Take the survey</h1>
</div>
</button>
}
</mat-toolbar>

<!--<div *ngIf="exercises">-->
Expand Down
24 changes: 1 addition & 23 deletions src/app/homepage/homepage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,32 +41,10 @@ export class HomepageComponent implements OnInit {
this.loggingService.setStudentId(sessionStorage.getItem("studentId")!);
}
}
this.verifyDisplayStudentButton();
}

verifyDisplayStudentButton() {
if (environment.logChanges && this.loggingService.getStudentId()) {
this.firestoreService.getStudentSchool(this.loggingService.getStudentId()!).then((school) => {
if (school && environment.surveyDates.has(school)) {
const surveyStartDate: Date = environment.surveyDates.get(school)!.get("startDate")!;
const surveyEndDate: Date = environment.surveyDates.get(school)!.get("endDate")!;
const now: Date = new Date();
if (now >= surveyStartDate && now <= surveyEndDate) {
this.displaySurveyButton = true;
}
}
});
}
}

openSurvey() {
window.open(environment.surveyLink+"?student_id="+this.loggingService.getStudentId(), "_blank");
}

openToStudentDialog() {
const dialogRef = this.dialog.open(StudentIdDialogComponent, {disableClose: true}).afterClosed().subscribe(result => {
this.verifyDisplayStudentButton();
});
const dialogRef = this.dialog.open(StudentIdDialogComponent, {disableClose: true});
}

}
Loading