From 76abc20ca29501186d96e24bf14006f6b8da1931 Mon Sep 17 00:00:00 2001 From: Dasiame Date: Thu, 3 Oct 2024 20:53:56 +0000 Subject: [PATCH 01/10] Prime numbers --- lesson_04/dasiaenglish/lesson_04.md | 61 +++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 lesson_04/dasiaenglish/lesson_04.md diff --git a/lesson_04/dasiaenglish/lesson_04.md b/lesson_04/dasiaenglish/lesson_04.md new file mode 100644 index 000000000..06558f1fe --- /dev/null +++ b/lesson_04/dasiaenglish/lesson_04.md @@ -0,0 +1,61 @@ +## Javascript +```javascript +function findPrimes() { // A machine that helps find prime numbers + let primeNumbers = []; // Use 'let' and an empty array for prime numbers + + for (let numberToCheck = 2; numberToCheck <= 100; numberToCheck++) { // Here is a loop that starts at 2 and keeps going until 100 + let isPrime = true; //I am starting this out with assuming the number is true + + for (let factor = 2; factor <= Math.floor(numberToCheck / 2); factor++) { //this is another loop but it checks to see if the number is divisible by other numbers. + if (numberToCheck % factor === 0) { // this is checking to see if the number can divide evenly and if so then it is not a prime number + isPrime = false; // states that the number is not prime if it comes out as 0 (should have a remainder) + break; //states that it can STOP the loop once it finds a 0, no need to keep going through + } //this is closing the loop + } + + if (isPrime) { //if said number is still true that means that we did not find any number that is divided evenly so it is prime + primeNumbers.push(numberToCheck); // Push primes into the array box above [] + } + } //closing the loop from 2 to 100 + + + //Output the prime numbers + console.log("Prime numbers from 1 to 100 are:"); // telling the comuter to print it out what is in " " + console.log(primeNumbers.join(", ")); // show the prime numbers that we found +} //will fill in all the numbers that are prime + +// Call the function to find and print primes +findPrimes(); + +// credit from Coding with John youtube video https://www.youtube.com/watch?v=I9-3drnfyp0 +``` + + +## Python +```python +def find_primes(): # this is a function that will help us find all the prime numbers + prime_numbers = [] # this is an empty list for now until we run the test for all the prime numbers we find + + for number_to_check in range(2, 101): # checking numbers from 2 to 100 + is_prime = True # I am saying that it is a prime until I find out it is not + + for factor in range(2, number_to_check // 2 + 1): # checks to see if the number can be divided by a smaller number evenly + if number_to_check % factor == 0: # trying to see if there is a remainder after the divison and if it is equal to zero + is_prime = False # if it is equal to zero it is flase meaning it is not prime + break # again it means STOP + if is_prime: # after checking all + prime_numbers.append(number_to_check) # Add prime numbers + + print("Prime numbers from 1 to 100 are:") + # type out what is in the " " + print(", ".join(map(str, prime_numbers))) # put all the prime numbers split by a commma +find_primes() #tells the computer to go ahead and run the function +``` +## Explanation +My first thought was to use Javascript and html because those were the 2 languages that I was familiar with. I did some research and quickly came to the realization that html would not be the most effective. That's when I found out that I should use Python and Javascript. +Python is known for how easy it is to read and how simple it is. But is super space indentation sensitive. Whereas Javascript is a little more complex because it uses different characters, which makes it a little harder to understand. + +Similarities: Both Javascript and Python are finding prime numbers between 2 and 100 even though in pyton it says 101. That is becuase we did not plug in 101 we stopped right before it. + +Diffreneces: A diffrence that Javascript uses let for declaring variables while python uses simplier words becuase you do not need a keyword + From 2f1fb03f10d5d7eaf7b7c17da392cefdd30e848b Mon Sep 17 00:00:00 2001 From: Dasiame Date: Fri, 4 Oct 2024 15:18:45 +0000 Subject: [PATCH 02/10] fixed my code to be any number --- lesson_04/dasiaenglish/lesson_04.md | 87 +++++++++++++++++------------ 1 file changed, 51 insertions(+), 36 deletions(-) diff --git a/lesson_04/dasiaenglish/lesson_04.md b/lesson_04/dasiaenglish/lesson_04.md index 06558f1fe..4276e62c7 100644 --- a/lesson_04/dasiaenglish/lesson_04.md +++ b/lesson_04/dasiaenglish/lesson_04.md @@ -1,10 +1,20 @@ -## Javascript -```javascript -function findPrimes() { // A machine that helps find prime numbers - let primeNumbers = []; // Use 'let' and an empty array for prime numbers +```Javascript +#Javascript + +const readline = require(`readline`); + +const rl =readline.createInterface({ + input: process.stdin, + output: process.stdout +}); + +function findPrimes(numberToCheck) { // A machine that helps find prime numbers + + if (numberToCheck <=1){ + return `${numberToCheck} is not a prime number.`; //any number that is less or equal to 1 it is NOT a prime number + } + let isPrime = true; //I am start with assuming the number is prime - for (let numberToCheck = 2; numberToCheck <= 100; numberToCheck++) { // Here is a loop that starts at 2 and keeps going until 100 - let isPrime = true; //I am starting this out with assuming the number is true for (let factor = 2; factor <= Math.floor(numberToCheck / 2); factor++) { //this is another loop but it checks to see if the number is divisible by other numbers. if (numberToCheck % factor === 0) { // this is checking to see if the number can divide evenly and if so then it is not a prime number @@ -14,43 +24,48 @@ function findPrimes() { // A machine that helps find prime numbers } if (isPrime) { //if said number is still true that means that we did not find any number that is divided evenly so it is prime - primeNumbers.push(numberToCheck); // Push primes into the array box above [] - } - } //closing the loop from 2 to 100 + return `${numberToCheck} is a prime number.`; //if the numbe is prime it will say^^ + } else{ + return `${numberToCheck} is not a prime number.`; // if it is NOT prime it will say so + } +} //closing the loop of if it is a prime number or not +rl.question(`Enter a number to check if it\'s prime:`, (input)=>{ + let number = parseInt(input); - //Output the prime numbers - console.log("Prime numbers from 1 to 100 are:"); // telling the comuter to print it out what is in " " - console.log(primeNumbers.join(", ")); // show the prime numbers that we found -} //will fill in all the numbers that are prime + if (isNaN(number)) { + console.log("Please enter a valid number."); + } else { + console.log(findPrimes(number)); + } +}); +// credit from Coding with John youtube video https://www.youtube.com/watch?v=I9-3drnfyp0 and Chatgpt for a explanation of things I still might have been confused about +``` -// Call the function to find and print primes -findPrimes(); +```python +# Python +# this is a function that will help us find all the prime numbers +def find_primes(number_to_check): + if number_to_check <= 1: # this is an empty list for now until we run the test for all the prime numbers we find + return f"{number_to_check} is not a prime number." -// credit from Coding with John youtube video https://www.youtube.com/watch?v=I9-3drnfyp0 -``` + is_prime = True # I am saying that it is a prime until I find out it is not + # checks to see if the number can be divided by a smaller number evenly + for factor in range(2, number_to_check // 2 + 1): + if number_to_check % factor == 0: # trying to see if there is a remainder after the divison and if it is equal to zero + is_prime = False # if it is equal to zero it is flase meaning it is not prime + break # again it means STOP + if is_prime: # after checking all + return f"{number_to_check} is a prime number." + else: + return f"{number_to_check} is not a prime number." + +number = int(input("Enter a number to check to see if its prime: ")) +print(find_primes(number)) -## Python -```python -def find_primes(): # this is a function that will help us find all the prime numbers - prime_numbers = [] # this is an empty list for now until we run the test for all the prime numbers we find - - for number_to_check in range(2, 101): # checking numbers from 2 to 100 - is_prime = True # I am saying that it is a prime until I find out it is not - - for factor in range(2, number_to_check // 2 + 1): # checks to see if the number can be divided by a smaller number evenly - if number_to_check % factor == 0: # trying to see if there is a remainder after the divison and if it is equal to zero - is_prime = False # if it is equal to zero it is flase meaning it is not prime - break # again it means STOP - if is_prime: # after checking all - prime_numbers.append(number_to_check) # Add prime numbers - - print("Prime numbers from 1 to 100 are:") - # type out what is in the " " - print(", ".join(map(str, prime_numbers))) # put all the prime numbers split by a commma -find_primes() #tells the computer to go ahead and run the function ``` + ## Explanation My first thought was to use Javascript and html because those were the 2 languages that I was familiar with. I did some research and quickly came to the realization that html would not be the most effective. That's when I found out that I should use Python and Javascript. Python is known for how easy it is to read and how simple it is. But is super space indentation sensitive. Whereas Javascript is a little more complex because it uses different characters, which makes it a little harder to understand. From f2665f4775eb40b7c19be2520220124fce2db86c Mon Sep 17 00:00:00 2001 From: Dasiame Date: Fri, 4 Oct 2024 15:57:50 +0000 Subject: [PATCH 03/10] added notes and deleted speaker option --- lesson_04/dasiaenglish/lesson_04.md | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/lesson_04/dasiaenglish/lesson_04.md b/lesson_04/dasiaenglish/lesson_04.md index 4276e62c7..ecf6dc952 100644 --- a/lesson_04/dasiaenglish/lesson_04.md +++ b/lesson_04/dasiaenglish/lesson_04.md @@ -1,13 +1,6 @@ ```Javascript #Javascript -const readline = require(`readline`); - -const rl =readline.createInterface({ - input: process.stdin, - output: process.stdout -}); - function findPrimes(numberToCheck) { // A machine that helps find prime numbers if (numberToCheck <=1){ @@ -30,15 +23,16 @@ function findPrimes(numberToCheck) { // A machine that helps find prime numbers } } //closing the loop of if it is a prime number or not -rl.question(`Enter a number to check if it\'s prime:`, (input)=>{ - let number = parseInt(input); +const input = process.argv[2]; // telling the computer to save the 3rd thing you type - if (isNaN(number)) { - console.log("Please enter a valid number."); +let number = parseInt(input); // if it types a word the computer does the math and makes it a number + + if (isNaN(number)) { // make sure you type a number + console.log("Please enter a valid number."); // letting the user know you have to type a number } else { - console.log(findPrimes(number)); + console.log(findPrimes(number)); //now the computer can check if it is prime or not } -}); + // credit from Coding with John youtube video https://www.youtube.com/watch?v=I9-3drnfyp0 and Chatgpt for a explanation of things I still might have been confused about ``` From 49e7a017b73184f7532b874bbe7f76a4dce043eb Mon Sep 17 00:00:00 2001 From: Dasiame Date: Sat, 5 Oct 2024 23:38:23 +0000 Subject: [PATCH 04/10] user stories --- lesson_05/dasiaenglish/lesson_05.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lesson_05/dasiaenglish/lesson_05.md diff --git a/lesson_05/dasiaenglish/lesson_05.md b/lesson_05/dasiaenglish/lesson_05.md new file mode 100644 index 000000000..3d31189f6 --- /dev/null +++ b/lesson_05/dasiaenglish/lesson_05.md @@ -0,0 +1,8 @@ +# Shein app + +##As a shopper I would like to virtually try on clothing items to see if they fit or not before purchasing. + +##As a buyer I would like to know exaclty how much I am spending, with a recommendation on what is worth my dolor, by grouping clothes a certain way. + + +##As a fashionesta I want a personalized stylist to creat outfits with what is in my cart, that way I can mix and match my clothes. From a9d03ade1801953594ee2b8ed5838918da404763 Mon Sep 17 00:00:00 2001 From: Dasiame Date: Sun, 6 Oct 2024 00:03:22 +0000 Subject: [PATCH 05/10] change answers in quiz and made 3 user stories --- lesson_05/dasiaenglish/lesson_05.md | 3 ++- lesson_05/quiz/src/lesson5.ts | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lesson_05/dasiaenglish/lesson_05.md b/lesson_05/dasiaenglish/lesson_05.md index 3d31189f6..a08b3103e 100644 --- a/lesson_05/dasiaenglish/lesson_05.md +++ b/lesson_05/dasiaenglish/lesson_05.md @@ -1,5 +1,6 @@ -# Shein app +## User Stories +# Shein app ##As a shopper I would like to virtually try on clothing items to see if they fit or not before purchasing. ##As a buyer I would like to know exaclty how much I am spending, with a recommendation on what is worth my dolor, by grouping clothes a certain way. diff --git a/lesson_05/quiz/src/lesson5.ts b/lesson_05/quiz/src/lesson5.ts index 9ad62bd67..74ec75628 100644 --- a/lesson_05/quiz/src/lesson5.ts +++ b/lesson_05/quiz/src/lesson5.ts @@ -38,7 +38,7 @@ export class Lesson5 { [AnswerChoice.C, "To insert an image"], [AnswerChoice.D, "To create a paragraph"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -52,7 +52,7 @@ export class Lesson5 { [AnswerChoice.C, "alt"], [AnswerChoice.D, "href"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.C, ); } @@ -66,7 +66,7 @@ export class Lesson5 { [AnswerChoice.C, "
"], [AnswerChoice.D, ""], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -80,7 +80,7 @@ export class Lesson5 { [AnswerChoice.C, ""], [AnswerChoice.D, "
"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -94,7 +94,7 @@ export class Lesson5 { [AnswerChoice.C, "Computer Style Sheets"], [AnswerChoice.D, "Cascading System Sheets"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -108,7 +108,7 @@ export class Lesson5 { [AnswerChoice.C, "text-color"], [AnswerChoice.D, "background-color"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -122,7 +122,7 @@ export class Lesson5 { [AnswerChoice.C, "/* this is a comment */"], [AnswerChoice.D, ""], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.C, ); } @@ -136,7 +136,7 @@ export class Lesson5 { [AnswerChoice.C, "text-size"], [AnswerChoice.D, "text-style"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -150,7 +150,7 @@ export class Lesson5 { [AnswerChoice.C, "inline-block"], [AnswerChoice.D, "none"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -164,7 +164,7 @@ export class Lesson5 { [AnswerChoice.C, ""], [AnswerChoice.D, ""], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.A, ); } } From f2259392b3a01de2f491cd7c66dfe53e8bf1dc3b Mon Sep 17 00:00:00 2001 From: Dasiame Date: Sun, 6 Oct 2024 00:38:22 +0000 Subject: [PATCH 06/10] 3 user stories --- lesson_05/dasiaenglish/lesson_05.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lesson_05/dasiaenglish/lesson_05.md b/lesson_05/dasiaenglish/lesson_05.md index a08b3103e..221054cf8 100644 --- a/lesson_05/dasiaenglish/lesson_05.md +++ b/lesson_05/dasiaenglish/lesson_05.md @@ -1,9 +1,9 @@ ## User Stories # Shein app -##As a shopper I would like to virtually try on clothing items to see if they fit or not before purchasing. +-As a shopper I would like to virtually try on clothing items to see if they fit or not before purchasing. -##As a buyer I would like to know exaclty how much I am spending, with a recommendation on what is worth my dolor, by grouping clothes a certain way. +-As a buyer I would like to know exaclty how much I am spending, with a recommendation on what is worth my dolor, by grouping clothes a certain way. -##As a fashionesta I want a personalized stylist to creat outfits with what is in my cart, that way I can mix and match my clothes. +-giAs a fashionesta I want a personalized stylist to creat outfits with what is in my cart, that way I can mix and match my clothes. From 85ae4b42904451784995f9bd33e4820786949346 Mon Sep 17 00:00:00 2001 From: Dasiame Date: Mon, 7 Oct 2024 14:23:03 +0000 Subject: [PATCH 07/10] extra credit quiz --- lesson_05/quiz/src/lesson5.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lesson_05/quiz/src/lesson5.ts b/lesson_05/quiz/src/lesson5.ts index 74ec75628..f77e829d3 100644 --- a/lesson_05/quiz/src/lesson5.ts +++ b/lesson_05/quiz/src/lesson5.ts @@ -3,7 +3,7 @@ import { MultipleChoiceQuizQuestion, QuizPrinter, QuizQuestion, -} from "codedifferently-instructional"; +} from "codedifferently-instructional"; //dasiaenglish export class Lesson5 { run(): void { From 983331995bd374fc0cddb656fa8667e46091857e Mon Sep 17 00:00:00 2001 From: Dasiame Date: Fri, 11 Oct 2024 15:46:54 +0000 Subject: [PATCH 08/10] rm lesson_04 work --- lesson_04/dasiaenglish/lesson_04.md | 70 ----------------------------- 1 file changed, 70 deletions(-) delete mode 100644 lesson_04/dasiaenglish/lesson_04.md diff --git a/lesson_04/dasiaenglish/lesson_04.md b/lesson_04/dasiaenglish/lesson_04.md deleted file mode 100644 index ecf6dc952..000000000 --- a/lesson_04/dasiaenglish/lesson_04.md +++ /dev/null @@ -1,70 +0,0 @@ -```Javascript -#Javascript - -function findPrimes(numberToCheck) { // A machine that helps find prime numbers - - if (numberToCheck <=1){ - return `${numberToCheck} is not a prime number.`; //any number that is less or equal to 1 it is NOT a prime number - } - let isPrime = true; //I am start with assuming the number is prime - - - for (let factor = 2; factor <= Math.floor(numberToCheck / 2); factor++) { //this is another loop but it checks to see if the number is divisible by other numbers. - if (numberToCheck % factor === 0) { // this is checking to see if the number can divide evenly and if so then it is not a prime number - isPrime = false; // states that the number is not prime if it comes out as 0 (should have a remainder) - break; //states that it can STOP the loop once it finds a 0, no need to keep going through - } //this is closing the loop - } - - if (isPrime) { //if said number is still true that means that we did not find any number that is divided evenly so it is prime - return `${numberToCheck} is a prime number.`; //if the numbe is prime it will say^^ - } else{ - return `${numberToCheck} is not a prime number.`; // if it is NOT prime it will say so - } -} //closing the loop of if it is a prime number or not - -const input = process.argv[2]; // telling the computer to save the 3rd thing you type - -let number = parseInt(input); // if it types a word the computer does the math and makes it a number - - if (isNaN(number)) { // make sure you type a number - console.log("Please enter a valid number."); // letting the user know you have to type a number - } else { - console.log(findPrimes(number)); //now the computer can check if it is prime or not - } - -// credit from Coding with John youtube video https://www.youtube.com/watch?v=I9-3drnfyp0 and Chatgpt for a explanation of things I still might have been confused about -``` - -```python -# Python -# this is a function that will help us find all the prime numbers -def find_primes(number_to_check): - if number_to_check <= 1: # this is an empty list for now until we run the test for all the prime numbers we find - return f"{number_to_check} is not a prime number." - - is_prime = True # I am saying that it is a prime until I find out it is not - - # checks to see if the number can be divided by a smaller number evenly - for factor in range(2, number_to_check // 2 + 1): - if number_to_check % factor == 0: # trying to see if there is a remainder after the divison and if it is equal to zero - is_prime = False # if it is equal to zero it is flase meaning it is not prime - break # again it means STOP - if is_prime: # after checking all - return f"{number_to_check} is a prime number." - else: - return f"{number_to_check} is not a prime number." - -number = int(input("Enter a number to check to see if its prime: ")) -print(find_primes(number)) - -``` - -## Explanation -My first thought was to use Javascript and html because those were the 2 languages that I was familiar with. I did some research and quickly came to the realization that html would not be the most effective. That's when I found out that I should use Python and Javascript. -Python is known for how easy it is to read and how simple it is. But is super space indentation sensitive. Whereas Javascript is a little more complex because it uses different characters, which makes it a little harder to understand. - -Similarities: Both Javascript and Python are finding prime numbers between 2 and 100 even though in pyton it says 101. That is becuase we did not plug in 101 we stopped right before it. - -Diffreneces: A diffrence that Javascript uses let for declaring variables while python uses simplier words becuase you do not need a keyword - From f563e92daa9719819dd90a9ec07ccb71216663d0 Mon Sep 17 00:00:00 2001 From: Dasiame Date: Fri, 11 Oct 2024 15:56:40 +0000 Subject: [PATCH 09/10] fix changes to lesson_05 --- lesson_05/dasiaenglish/lesson_05.md | 5 +++- lesson_05/quiz/src/lesson5.ts | 41 ++++++++++------------------- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/lesson_05/dasiaenglish/lesson_05.md b/lesson_05/dasiaenglish/lesson_05.md index 221054cf8..7a6a0f288 100644 --- a/lesson_05/dasiaenglish/lesson_05.md +++ b/lesson_05/dasiaenglish/lesson_05.md @@ -2,8 +2,11 @@ # Shein app -As a shopper I would like to virtually try on clothing items to see if they fit or not before purchasing. +This will help reduce returns and ensure customer satisfaction by allowing users to feel more confident in their purchases. -As a buyer I would like to know exaclty how much I am spending, with a recommendation on what is worth my dolor, by grouping clothes a certain way. +This will help shoppers make more informed decisions and feel like they're making smart purchases, leading to a better shopping experience. --giAs a fashionesta I want a personalized stylist to creat outfits with what is in my cart, that way I can mix and match my clothes. +-As a fashionesta I want a personalized stylist to creat outfits with what is in my cart, that way I can mix and match my clothes. + This will enhance the shopping experience by helping users create stylish, personalized outfits, making them more likely to buy multiple items and enjoy their purchase. \ No newline at end of file diff --git a/lesson_05/quiz/src/lesson5.ts b/lesson_05/quiz/src/lesson5.ts index f77e829d3..84d022c11 100644 --- a/lesson_05/quiz/src/lesson5.ts +++ b/lesson_05/quiz/src/lesson5.ts @@ -2,18 +2,15 @@ import { AnswerChoice, MultipleChoiceQuizQuestion, QuizPrinter, - QuizQuestion, -} from "codedifferently-instructional"; //dasiaenglish - +} from "codedifferently-instructional"; export class Lesson5 { - run(): void { + run() { const quizQuestions = Lesson5.makeQuizQuestions(); if (!quizQuestions) throw new Error("Quiz questions cannot be null"); const printer = new QuizPrinter(); printer.printQuiz(quizQuestions); } - - static makeQuizQuestions(): QuizQuestion[] { + static makeQuizQuestions() { return [ Lesson5.makeQuestion0(), Lesson5.makeQuestion1(), @@ -27,8 +24,7 @@ export class Lesson5 { Lesson5.makeQuestion9(), ]; } - - private static makeQuestion0(): QuizQuestion { + static makeQuestion0() { return new MultipleChoiceQuizQuestion( 0, "What is the purpose of the

tag in HTML?", @@ -41,8 +37,7 @@ export class Lesson5 { AnswerChoice.B, ); } - - private static makeQuestion1(): QuizQuestion { + static makeQuestion1() { return new MultipleChoiceQuizQuestion( 1, "Which attribute is used to specify alternative text for an image in HTML?", @@ -55,8 +50,7 @@ export class Lesson5 { AnswerChoice.C, ); } - - private static makeQuestion2(): QuizQuestion { + static makeQuestion2() { return new MultipleChoiceQuizQuestion( 2, "Which HTML tag is used to create a hyperlink?", @@ -69,8 +63,7 @@ export class Lesson5 { AnswerChoice.B, ); } - - private static makeQuestion3(): QuizQuestion { + static makeQuestion3() { return new MultipleChoiceQuizQuestion( 3, "Which of the following is a semantic HTML tag?", @@ -83,8 +76,7 @@ export class Lesson5 { AnswerChoice.B, ); } - - private static makeQuestion4(): QuizQuestion { + static makeQuestion4() { return new MultipleChoiceQuizQuestion( 4, "What does CSS stand for?", @@ -97,8 +89,7 @@ export class Lesson5 { AnswerChoice.B, ); } - - private static makeQuestion5(): QuizQuestion { + static makeQuestion5() { return new MultipleChoiceQuizQuestion( 5, "Which CSS property is used to change the text color?", @@ -111,8 +102,7 @@ export class Lesson5 { AnswerChoice.B, ); } - - private static makeQuestion6(): QuizQuestion { + static makeQuestion6() { return new MultipleChoiceQuizQuestion( 6, "How do you add a comment in CSS?", @@ -125,8 +115,7 @@ export class Lesson5 { AnswerChoice.C, ); } - - private static makeQuestion7(): QuizQuestion { + static makeQuestion7() { return new MultipleChoiceQuizQuestion( 7, "Which CSS property controls the size of text?", @@ -139,8 +128,7 @@ export class Lesson5 { AnswerChoice.B, ); } - - private static makeQuestion8(): QuizQuestion { + static makeQuestion8() { return new MultipleChoiceQuizQuestion( 8, "What is the default display value for `
` in CSS?", @@ -153,8 +141,7 @@ export class Lesson5 { AnswerChoice.B, ); } - - private static makeQuestion9(): QuizQuestion { + static makeQuestion9() { return new MultipleChoiceQuizQuestion( 9, "How do you link an external CSS file to an HTML document?", @@ -168,7 +155,7 @@ export class Lesson5 { ); } } - if (!process.env.JEST_WORKER_ID) { new Lesson5().run(); } +//# sourceMappingURL=lesson5.js.map From 045b84ab510ae8bed1d51f6fe60bec7e80c695e1 Mon Sep 17 00:00:00 2001 From: "Anthony D. Mays" Date: Fri, 11 Oct 2024 19:22:38 +0000 Subject: [PATCH 10/10] chore: revert quiz before submit --- lesson_05/quiz/src/lesson5.ts | 59 +++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/lesson_05/quiz/src/lesson5.ts b/lesson_05/quiz/src/lesson5.ts index 84d022c11..9ad62bd67 100644 --- a/lesson_05/quiz/src/lesson5.ts +++ b/lesson_05/quiz/src/lesson5.ts @@ -2,15 +2,18 @@ import { AnswerChoice, MultipleChoiceQuizQuestion, QuizPrinter, + QuizQuestion, } from "codedifferently-instructional"; + export class Lesson5 { - run() { + run(): void { const quizQuestions = Lesson5.makeQuizQuestions(); if (!quizQuestions) throw new Error("Quiz questions cannot be null"); const printer = new QuizPrinter(); printer.printQuiz(quizQuestions); } - static makeQuizQuestions() { + + static makeQuizQuestions(): QuizQuestion[] { return [ Lesson5.makeQuestion0(), Lesson5.makeQuestion1(), @@ -24,7 +27,8 @@ export class Lesson5 { Lesson5.makeQuestion9(), ]; } - static makeQuestion0() { + + private static makeQuestion0(): QuizQuestion { return new MultipleChoiceQuizQuestion( 0, "What is the purpose of the

tag in HTML?", @@ -34,10 +38,11 @@ export class Lesson5 { [AnswerChoice.C, "To insert an image"], [AnswerChoice.D, "To create a paragraph"], ]), - AnswerChoice.B, + AnswerChoice.UNANSWERED, ); } - static makeQuestion1() { + + private static makeQuestion1(): QuizQuestion { return new MultipleChoiceQuizQuestion( 1, "Which attribute is used to specify alternative text for an image in HTML?", @@ -47,10 +52,11 @@ export class Lesson5 { [AnswerChoice.C, "alt"], [AnswerChoice.D, "href"], ]), - AnswerChoice.C, + AnswerChoice.UNANSWERED, ); } - static makeQuestion2() { + + private static makeQuestion2(): QuizQuestion { return new MultipleChoiceQuizQuestion( 2, "Which HTML tag is used to create a hyperlink?", @@ -60,10 +66,11 @@ export class Lesson5 { [AnswerChoice.C, "
"], [AnswerChoice.D, ""], ]), - AnswerChoice.B, + AnswerChoice.UNANSWERED, ); } - static makeQuestion3() { + + private static makeQuestion3(): QuizQuestion { return new MultipleChoiceQuizQuestion( 3, "Which of the following is a semantic HTML tag?", @@ -73,10 +80,11 @@ export class Lesson5 { [AnswerChoice.C, ""], [AnswerChoice.D, "
"], ]), - AnswerChoice.B, + AnswerChoice.UNANSWERED, ); } - static makeQuestion4() { + + private static makeQuestion4(): QuizQuestion { return new MultipleChoiceQuizQuestion( 4, "What does CSS stand for?", @@ -86,10 +94,11 @@ export class Lesson5 { [AnswerChoice.C, "Computer Style Sheets"], [AnswerChoice.D, "Cascading System Sheets"], ]), - AnswerChoice.B, + AnswerChoice.UNANSWERED, ); } - static makeQuestion5() { + + private static makeQuestion5(): QuizQuestion { return new MultipleChoiceQuizQuestion( 5, "Which CSS property is used to change the text color?", @@ -99,10 +108,11 @@ export class Lesson5 { [AnswerChoice.C, "text-color"], [AnswerChoice.D, "background-color"], ]), - AnswerChoice.B, + AnswerChoice.UNANSWERED, ); } - static makeQuestion6() { + + private static makeQuestion6(): QuizQuestion { return new MultipleChoiceQuizQuestion( 6, "How do you add a comment in CSS?", @@ -112,10 +122,11 @@ export class Lesson5 { [AnswerChoice.C, "/* this is a comment */"], [AnswerChoice.D, ""], ]), - AnswerChoice.C, + AnswerChoice.UNANSWERED, ); } - static makeQuestion7() { + + private static makeQuestion7(): QuizQuestion { return new MultipleChoiceQuizQuestion( 7, "Which CSS property controls the size of text?", @@ -125,10 +136,11 @@ export class Lesson5 { [AnswerChoice.C, "text-size"], [AnswerChoice.D, "text-style"], ]), - AnswerChoice.B, + AnswerChoice.UNANSWERED, ); } - static makeQuestion8() { + + private static makeQuestion8(): QuizQuestion { return new MultipleChoiceQuizQuestion( 8, "What is the default display value for `
` in CSS?", @@ -138,10 +150,11 @@ export class Lesson5 { [AnswerChoice.C, "inline-block"], [AnswerChoice.D, "none"], ]), - AnswerChoice.B, + AnswerChoice.UNANSWERED, ); } - static makeQuestion9() { + + private static makeQuestion9(): QuizQuestion { return new MultipleChoiceQuizQuestion( 9, "How do you link an external CSS file to an HTML document?", @@ -151,11 +164,11 @@ export class Lesson5 { [AnswerChoice.C, ""], [AnswerChoice.D, ""], ]), - AnswerChoice.A, + AnswerChoice.UNANSWERED, ); } } + if (!process.env.JEST_WORKER_ID) { new Lesson5().run(); } -//# sourceMappingURL=lesson5.js.map