Skip to content

London | 26-ITP-May | Ebrahim Moqbel | sprint 3 | Alarm clock - #1442

Open
Ebrahim-Moqbel wants to merge 5 commits into
CodeYourFuture:mainfrom
Ebrahim-Moqbel:coursework/sprint-3-alarmclock
Open

London | 26-ITP-May | Ebrahim Moqbel | sprint 3 | Alarm clock#1442
Ebrahim-Moqbel wants to merge 5 commits into
CodeYourFuture:mainfrom
Ebrahim-Moqbel:coursework/sprint-3-alarmclock

Conversation

@Ebrahim-Moqbel

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

I have implemented a function for setting an alarm of a given time from the requirements provided.

Questions

N/A

@Ebrahim-MoqbelEbrahim-Moqbel added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Data-Groups The name of the module. labels Aug 20, 2026
Comment threadSprint-3/alarmclock/alarmclock.js Outdated
Comment on lines +12 to +14
if (intervalId !== null){
clearInterval(intervalId)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What else should also be reset?

Note: a user may not click the "Stop" button first before starting a new count down.

Comment threadSprint-3/alarmclock/alarmclock.js Outdated
clearInterval(intervalId)
}
const input = document.getElementById("alarmSet");
totalSeconds = Number(input.value);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Could the user enters an invalid number?

  • What type of number should totalSeconds be?

  • What range of numbers should the variable hold?

Comment threadSprint-3/alarmclock/alarmclock.js Outdated

intervalId = setInterval(() => {
totalSeconds--;
document.getElementById("timeRemaining").textContent = `Time Remaining: ${formatTime(totalSeconds)}`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could consider implement a function to display the time instead of repeating the code on lines 18 and 22.

@cjyuancjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 20, 2026
@Ebrahim-MoqbelEbrahim-Moqbel added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Aug 21, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Data-GroupsThe name of the module.Needs ReviewTrainee to add when requesting review. PRs without this label will not be reviewed.📅 Sprint 3Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Ebrahim-Moqbel@cjyuan