Skip to content

Hannah N - #14

Open
hannahwn wants to merge 3 commits into
HackYourAssignment:mainfrom
hannahwn:main
Open

hannahwn wants to merge 3 commits into
HackYourAssignment:mainfrom
hannahwn:main

Conversation

@hannahwn

Copy link
Copy Markdown

No description provided.

@github-actions

Copy link
Copy Markdown

📝 HackYourFuture auto grade

Assignment Score: 0 / 100 ✅

Status: ✅ Passed
Minimum score to pass: 0
🧪 The auto grade is experimental and still being improved

Test Details

@JQnetherlands
JQnetherlands self-requested a review April 1, 2026 08:31
@JQnetherlands JQnetherlands self-assigned this Apr 1, 2026
Comment thread task-1/Time.js
#secondsFromMidnight;

constructor(hours, minutes, seconds) {
const total = hours * 3600 + minutes * 60 + seconds;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Very well done, it is smart to make everything in seconds

Comment thread task-1/Time.js
}

getMinutes() {
return Math.floor((this.#secondsFromMidnight % 3600) / 60);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Very good use of the modulo %

Comment thread task-1/Time.js

addSeconds(seconds) {
this.#secondsFromMidnight =
(((this.#secondsFromMidnight + seconds) % 86400) + 86400) % 86400;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Very good use of the modulo %, you handle all the edges cases

Comment thread task-1/Time.js
const h = String(this.getHours()).padStart(2, "0");
const m = String(this.getMinutes()).padStart(2, "0");
const s = String(this.getSeconds()).padStart(2, "0");
return `${h}:${m}:${s}`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nice formatted

Comment thread task-2/display.js
console.log(`\nQuestion ${index + 1}: ${q.question}`);

// Loop through each option and print it with a number
q.options.forEach((opt, i) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Correct use of the forEach

Comment thread task-2/display.js

// \x1b[32m means green, \x1b[0m resets the colour back to normal
export function printCorrect() {
console.log("\x1b[32m✓ Correct! +1 point\x1b[0m");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

yes, it does change the colours

Comment thread task-2/display.js

export function printWrong(correct, options) {
console.log(
`\x1b[31m✗ Wrong! The correct answer was ${correct}: ${options[correct - 1]}\x1b[0m`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

es, it does change the colours

Comment thread task-2/index.js
let score = 0;


for (let i = 0; i < questions.length; i++) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nice

Comment thread task-2/index.js

const answer = parseInt(input);

if (answer === q.correct) {

@JQnetherlands JQnetherlands Apr 1, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

very good condictional

@JQnetherlands JQnetherlands left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello Hannah,

Congratulations, you have passed successfully the task 1 and task 2.

The task 1 is very nicely implemented, the class that you created is very strong and solid, I applause how you decide to make everything seconds, that indeed make it everything easier, and in every step you show you understand about the modulo and how you can use it to get the hours, minutes and seconds, the modulo is a very good trick to know in javaScript. You use the # well.

About the second task, your code works well , I mocked the fetch question with my own mockQuestions.js, cos I at the moment I don’t have a credit card to get a free API key, I trust that you tried your code with your own API Key.

I applause your implementation of the class in task1 , if one day you start to learn java you will see that your knowledge about creating a solid base class will help you with Java.

Keep the good Work! I wish you success in every instance of your career!

@JQnetherlands JQnetherlands added the Reviewed This assignment has been reivewed by a mentor and a feedback has been provided label Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed This assignment has been reivewed by a mentor and a feedback has been provided

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants