diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index b34cfcfc..ea03447f 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1,13 +1,2 @@
-# These are supported funding model platforms
-
github: CodeYourFuture
-patreon: # Replace with a single Patreon username
-open_collective: # Replace with a single Open Collective username
-ko_fi: # Replace with a single Ko-fi username
-tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
-community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
-liberapay: # Replace with a single Liberapay username
-issuehunt: # Replace with a single IssueHunt username
-otechie: # Replace with a single Otechie username
-lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: https://codeyourfuture.io/donate
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index 5fe8ffd0..db0e6f43 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -1,4 +1,4 @@
-blank_issues_enabled: false
+blank_issues_enabled: true
contact_links:
- name: CYF
url: contact@codeyourfuture.io
@@ -8,7 +8,7 @@ contact_links:
about: Join CYF here
- name: CYF Slack
url: codeyourfuture.slack.com
- about: Come to #cyf-syllabus-tech and chat
+ about: Come to #cyf-curriculum and chat
- name: CYF Tech Ed
url: https://github.com/orgs/CodeYourFuture/teams/mentors
about: CYF mentors on Github
diff --git a/.github/ISSUE_TEMPLATE/pd-assignment.yml b/.github/ISSUE_TEMPLATE/pd-assignment.yml
index c8bd2298..19f15fa3 100644
--- a/.github/ISSUE_TEMPLATE/pd-assignment.yml
+++ b/.github/ISSUE_TEMPLATE/pd-assignment.yml
@@ -1,7 +1,7 @@
name: PD Coursework
description: Assign a piece of PD coursework
title: "[PD]
"
-labels: [PD, 🏝 Priority Stretch, 🐇 Size Small]
+labels: [PD, 🏝 Priority Stretch, 🐇 Size Small, 📅 Sprint 1]
body:
- type: markdown
attributes:
diff --git a/.github/ISSUE_TEMPLATE/tech-ed-assignment.yml b/.github/ISSUE_TEMPLATE/tech-ed-assignment.yml
index 1bdba293..343b4d67 100644
--- a/.github/ISSUE_TEMPLATE/tech-ed-assignment.yml
+++ b/.github/ISSUE_TEMPLATE/tech-ed-assignment.yml
@@ -1,26 +1,34 @@
name: Tech Ed Coursework
description: Assign a piece of technical coursework
-title: "[TECH ED] "
-labels: [Tech Ed, 🏕 Priority Mandatory, 🐂 Size Medium]
+title: ""
+labels: [Tech Ed, 🏕 Priority Mandatory, 🐂 Size Medium, 📅 Sprint 1]
body:
- type: markdown
attributes:
value: |
- Thanks for taking the time to assign this coursework!
+ Thanks for taking the time to assign this coursework!
- To support our trainees with planning and prioritising their own learning journey, we want our coursework assignments to be more informative.
+ To support our trainees with planning and prioritising their own learning journey, we want our coursework assignments to be more informative.
We don't just want to tell them what to do, we want to tell them stuff like:
- why we are doing it
- what it's "for" (problem-solving, debugging, etc)
- how long they should spend on it, maximum
- - how to get help
- - how to review it with answers
+ - how to get help
+ - how to review it with answers
- how to get it reviewed from mentors and peers
- type: input
attributes:
label: Link to the coursework
validations:
required: true
+ - type : textarea
+ attributes:
+ label: Learning Objectives
+ description: https://common.codeyourfuture.io/common-theme/shortcodes/objectives/
+ placeholder: |
+
+ - [ ] CYF format, task list formatting
+
- type: textarea
attributes:
label: Why are we doing this?
@@ -37,14 +45,14 @@ body:
attributes:
label: How to get help
description: State simply how trainees can get help with this assignment
- placeholder: |
+ value: |
Share your blockers in your class channel
- https://syllabus.codeyourfuture.io/guides/asking-questions
+ https://curriculum.codeyourfuture.io/guides/getting-help/asking-questions/
- type: textarea
attributes:
label: How to submit
description: State in clear steps how a trainee can submit this assignment.
- placeholder: |
+ value: |
Fork the repo to your own GitHub account
Make regular small commits with clear messages
When you are ready, open a Pull Request to the CYF repo
@@ -72,9 +80,9 @@ body:
1. Update labels
- priority -- is this coursework key, mandatory, or stretch? Pick one.
- size -- help trainees plan their time with rough estimation. Pick one
- - topics -- add all that seem relevant to you.
- 2. Add to milestone
- - week 1,2,3,4
+ - topics -- add all that seem relevant to you.
+ 2. Add a Sprint label to add to the backlog view
+ - sprint 1,2,3,4
Once your ticket is complete, you may like to add it to the example project board attached to this repo.
This is so you understand how trainees will use your work. Nobody has built a board copier yet, so trainees will be doing this step themselves.
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index ae4e1977..0d8ee1df 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -2,14 +2,19 @@
You must title your PR like this:
-COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
+Region | Cohort | FirstName LastName | Sprint | Assignment Title
For example,
-NW4 | Carol Owen | HTML-CSS-Module | Week1
+London | 25-ITP-May | Carol Owen | Sprint 1 | Alarm Clock
-Complete the task list below this message.
-If your PR is rejected, check the task list.
+Fill in the template below - remove any sections that don't apply.
+
+Complete the self checklist - replace each empty box in the checklist [ ] with a [x].
+
+Add the label "Needs Review" and you will get review.
+
+Respond to volunteer reviews until the volunteer marks it as "Complete".
-->
@@ -17,11 +22,10 @@ If your PR is rejected, check the task list.
Self checklist
-- [ ] I have committed my files one by one, on purpose, and for a reason
-- [ ] I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
+- [ ] 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](https://curriculum.codeyourfuture.io/guides/contributing/)
-- [ ] My changes meet the [requirements](./README.md) of this task
+- [ ] My changes follow the [style guide](https://curriculum.codeyourfuture.io/guides/reviewing/style-guide/)
## Changelist
diff --git a/.github/workflows/validate-pr-metadata.yml b/.github/workflows/validate-pr-metadata.yml
new file mode 100644
index 00000000..10ef3c74
--- /dev/null
+++ b/.github/workflows/validate-pr-metadata.yml
@@ -0,0 +1,18 @@
+name: Validate PR Metadata
+on:
+ pull_request_target:
+ types:
+ - labeled
+ - unlabeled
+ - opened
+ - edited
+ - reopened
+
+jobs:
+ validate_pr_metadata:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: CodeYourFuture/actions/validate-pr-metadata@main
+ with:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/HOW_TO_REVIEW.md b/HOW_TO_REVIEW.md
deleted file mode 100644
index fd7820a1..00000000
--- a/HOW_TO_REVIEW.md
+++ /dev/null
@@ -1,52 +0,0 @@
-# Everyone reviews code at CYF
-
-https://curriculum.codeyourfuture.io/guides/reviewing/
-
-Mentors and trainees all review code, and collaborate on improving code quality. We are all helping each other to talk, write, and think about code more clearly.
-
-We are not reviewing code as if we were to merge this PR into production; we are opening a technical conversation for the purpose of insight and development.
-
-## Key points:
-
-1. Ask questions instead of making statements:
-
- **YES:** "Is there another element you could use to group a set of fields in a form? Why might someone use a different element in a form?"
- **NO:** "Use fieldset not divs"
-
-2. Encourage simplicity, clarity, and precision:
-
- **YES** "There are 15,0000 files in this changelist. Which files should be reviewed?"
- **NO** "It doesn't matter; I can try to figure out what you meant."
-
-3. Respect everyone's work and time:
-
- **YES** "I think there's some more to do here. Thanks for sharing where you're up to."
- **NO** "This is rubbish. Try harder."
-
-## Labels
-
-Reviewers, please add labels (provided) to the PR once you've reviewed. This helps to focus the trainee on the areas they should work on, and gives an overview for mentors on what the whole cohort needs to work on.
-
-## Solutions
-
-### Where to find solutions?
-
-You can find the solutions for the module on the `solutions` branch.
-
-### Solutions branch
-
-The solutions branch typically contains:
-
-#### Sample solutions
-
-Solutions are example answers not the only correct answers.
-
-#### Common responses guides.
-
-Everyone is invited to contribute commonly encountered problems, mistakes, misunderstandings, and mental-model errors to our common responses documents.
-
-Use these resources to inform your code review, get unstuck, and improve your understanding.
-
-## Guides
-
-https://curriculum.codeyourfuture.io/guides/reviewing/
diff --git a/Sprint-3/dead-code/README.md b/Sprint-3/dead-code/README.md
new file mode 100644
index 00000000..785101d3
--- /dev/null
+++ b/Sprint-3/dead-code/README.md
@@ -0,0 +1,9 @@
+# Refactoring Dead Code
+
+Here are two example of code that has not been built efficiently. Both files have dead code in them, it's your job to go back through this existing code, identify the dead code, and remove it so the code is ready for production.
+
+## Instructions
+
+1. Work through each `exercise` file inside this directory.
+2. Delete the dead code.
+3. Commit your changes and make a PR when done.
diff --git a/Sprint-3/dead-code/exercise-1.js b/Sprint-3/dead-code/exercise-1.js
new file mode 100644
index 00000000..6077b36f
--- /dev/null
+++ b/Sprint-3/dead-code/exercise-1.js
@@ -0,0 +1,16 @@
+// Find the instances of unreachable and redundant code - remove them!
+
+let testName = "Jerry";
+const greeting = "hello";
+
+function sayHello(greeting, name) {
+ const greetingStr = greeting + ", " + name + "!";
+ return `${greeting}, ${name}!`;
+ console.log(greetingStr);
+}
+
+testName = "Aman";
+
+const greetingMessage = sayHello(greeting, testName);
+
+console.log(greetingMessage); // 'hello, Aman!'
diff --git a/Sprint-3/dead-code/exercise-2.js b/Sprint-3/dead-code/exercise-2.js
new file mode 100644
index 00000000..df0e3b45
--- /dev/null
+++ b/Sprint-3/dead-code/exercise-2.js
@@ -0,0 +1,27 @@
+// Remove the unused code that does not contribute to the final console log
+
+const pets = ["parrot", "hamster", "horse", "dog", "hamster", "cat", "hamster"];
+const capitalisedPets = pets.map((pet) => pet.toUpperCase());
+const petsStartingWithH = pets.filter((pet) => pet[0] === "h");
+
+function logPets(petsArr) {
+ petsArr.forEach((pet) => console.log(pet));
+}
+
+function countAndCapitalisePets(petsArr) {
+ const petCount = {};
+
+ petsArr.forEach((pet) => {
+ const capitalisedPet = pet.toUpperCase();
+ if (petCount[capitalisedPet]) {
+ petCount[capitalisedPet] += 1;
+ } else {
+ petCount[capitalisedPet] = 1;
+ }
+ });
+ return petCount;
+}
+
+const countedPetsStartingWithH = countAndCapitalisePets(petsStartingWithH);
+
+console.log(countedPetsStartingWithH); // { 'HAMSTER': 3, 'HORSE': 1 } <- Final console log
diff --git a/debugging/book-library/script.js b/debugging/book-library/script.js
index 75ce6c1d..5032b51d 100644
--- a/debugging/book-library/script.js
+++ b/debugging/book-library/script.js
@@ -37,11 +37,24 @@ function submit() {
alert("Please fill all fields!");
return false;
} else {
- let book = new Book(title.value, title.value, pages.value, check.checked);
- library.push(book);
+ const alreadyExists = myLibrary.some(
+ (book) => book.title === title.value);
+ if (alreadyExists) {
+ alert("This book is already in your library!");
+ return;
+ }
+ }
+ let book = new Book(title.value, author.value, pages.value, check.checked);
+ myLibrary.push(book);
render();
+
+ //clear the form after submit
+ title.value = "";
+ author.value = "";
+ pages.value = "";
+ check.checked = false;
}
-}
+
function Book(title, author, pages, check) {
this.title = title;
@@ -54,7 +67,7 @@ function render() {
let table = document.getElementById("display");
let rowsNumber = table.rows.length;
//delete old table
- for (let n = rowsNumber - 1; n > 0; n-- {
+ for (let n = rowsNumber - 1; n > 0; n--) {
table.deleteRow(n);
}
//insert updated row and cells
@@ -77,9 +90,9 @@ function render() {
wasReadCell.appendChild(changeBut);
let readStatus = "";
if (myLibrary[i].check == false) {
- readStatus = "Yes";
- } else {
readStatus = "No";
+ } else {
+ readStatus = "Yes";
}
changeBut.innerText = readStatus;
@@ -89,12 +102,12 @@ function render() {
});
//add delete button to every row and render again
- let delButton = document.createElement("button");
+ let delBut = document.createElement("button");
delBut.id = i + 5;
deleteCell.appendChild(delBut);
delBut.className = "btn btn-warning";
delBut.innerHTML = "Delete";
- delBut.addEventListener("clicks", function () {
+ delBut.addEventListener("click", function () {
alert(`You've deleted title: ${myLibrary[i].title}`);
myLibrary.splice(i, 1);
render();