Skip to content

Sheffield | ITP-Jan-26 | Hayriye Saricicek | Sprint 3 | Quote Generator#1151

Open
mshayriyesaricicek wants to merge 3 commits intoCodeYourFuture:mainfrom
mshayriyesaricicek:Sprint-3-Quote-Generator
Open

Sheffield | ITP-Jan-26 | Hayriye Saricicek | Sprint 3 | Quote Generator#1151
mshayriyesaricicek wants to merge 3 commits intoCodeYourFuture:mainfrom
mshayriyesaricicek:Sprint-3-Quote-Generator

Conversation

@mshayriyesaricicek
Copy link
Copy Markdown

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

Added a function to enable random quotes to be generated by pressing the new quote buttons.
Added style to the page by updated HTML.

@mshayriyesaricicek mshayriyesaricicek added 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 Mar 30, 2026
@jayshreehajgude2012 jayshreehajgude2012 added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Apr 5, 2026
Copy link
Copy Markdown

@jayshreehajgude2012 jayshreehajgude2012 left a comment

Choose a reason for hiding this comment

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

Nice styling but use externally.
Java script file linked correctly.
DOM methods used correctly.
Resolve Error-quotes array missing.

padding: 10px 20px;
font-size: 16px;
}
</style>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You can use external CSS file and link it to CSS to make code clean.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I didn't see the css file that is why I did in html. I have put all styling in css now and linked in the html. Thank you.

font-size: 16px;
}
</style>
<script defer src="quotes.js"></script>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Correctly linked JavaScript file.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

thank you

@@ -1,3 +1,20 @@
// DO NOT EDIT ABOVE HERE
window.addEventListener("DOMContentLoaded", () => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You used DOMContentLoaded properly
Clean DOM selection
Good use of textContent
Proper event listener used.
You can explore more DOM selection and Event handling methods.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

thank you

const newQuoteBtn = document.getElementById("new-quote");

function displayRandomQuote() {
const randomQuote = pickFromArray(quotes);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Quote Array is missing look into it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I am not sure if you are referring to the qoute array being defined after the function that uses it? I understood that we had to write our code above the line that says do not edit below so that is what I did. Or is there something else that I am missing? Thank you

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@mshayriyesaricicek does it currently work as you have it here? the quotes variable is only defined later on line 41 so the function is not able to work with quotes. The comment // DO NOT EDIT BELOW HERE is a bit misleading sorry

Copy link
Copy Markdown
Author

@mshayriyesaricicek mshayriyesaricicek Apr 11, 2026

Choose a reason for hiding this comment

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

Hi Kyle, thank you for getting back to me. The programme is running fine and it is not a problem with the quotes variable being defined later on line 41 as I have <script defer src="quotes.js"></script> on line 8 in html. Do you want me to move my code in quotes.js to the bottom of the file so it is below quotes array? Thank you

@jayshreehajgude2012 jayshreehajgude2012 added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Apr 5, 2026
@mshayriyesaricicek mshayriyesaricicek removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 5, 2026
@mshayriyesaricicek mshayriyesaricicek 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 Apr 5, 2026
@mshayriyesaricicek
Copy link
Copy Markdown
Author

Hi Jay

Please can you review my pull request as I need it to be complete to pass Step 3. This is the only thing outstanding.

I have looked carefully at my programme and the Quotes Array is at the bottom of quotes.js I am not sure if you are wanting me to explain that the pickFromArray(quotes) function is called before quotes is defined and that this is not an issue because in html I have 'defer' so everything will be loaded before the function is performed therefore the prorgramme runs correctly.

@kyle-tightest kyle-tightest 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 Apr 11, 2026
@mshayriyesaricicek mshayriyesaricicek 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 Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Data-Groups The name of the module. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants