Skip to content

Commit 4c2e4ef

Browse files
authored
Merge branch 'main' into DavidSmith-Lesson03
2 parents d3119c4 + ddcf9f2 commit 4c2e4ef

File tree

9 files changed

+349
-2
lines changed

9 files changed

+349
-2
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ quiz:
1010
- $2y$10$EM5346ILJER4xu66qf1OcuJ/7f6hCOb9z1OUHgSXvl3QuCohBySTm
1111
- $2y$10$gWIUYJPn94weKopOVQKTl.XOwODK1tamszmt4uXCJupZofi7vXPdq
1212
- $2y$10$eh1.Cd6tXSmolUnY02xwM.BVR7RkYqJIDHepPfk8wJBIwol4jRw0S
13+
kimberleehaldane:
14+
- $2y$10$7u0/PUZE4NFsRmjPtsaNOuQpXsQcuZh22wqYK5vli5LUO8wxIDR7q
15+
- $2y$10$zBW5IVw5BDBaa2PuxuyoO.kjixYznWpMXJ0a8hwO1zIYG8o5LJXAq
16+
- $2y$10$BjDUqT33QmjaSNeYJ99GCeyrjx99NSfCThB4l/KIh9PfbP4cJo03a
1317
jamescapparell:
1418
- $2y$10$iLvL/AaFPzcGZrcna7umMuHqkZe1f9at/ix77NUI6uakDGNuVKQCy
1519
- $2y$10$FLxmGXJLm5EziyhA5D33ju0kUjXhiDbuUdImciLQz8lBRu5ou0hee
@@ -47,10 +51,14 @@ quiz:
4751
- $2y$10$QsN9VkjWORsKgZRiBT46VOUgc5HVnswKAT4uDbs7JYbTF7DdKbsw.
4852
- $2y$10$sqXEOL0L8o0kRyiAb.2s4u0RlBC2.LmOGDbGWXHj5IfBNwinkv2yq
4953
- $2y$10$HaWueXgrIzd7z8yf39HfVeTjjyr.Kgx0GFBqwCRSzW3zRSreN19yi
54+
ljmcwilliams:
55+
- $2y$10$krHODbBQL0Z.4Me1fsRc0.XODWzJQPjrEL1xzXwDa98TPONF8OeiK
56+
- $2y$10$S5HH5Vv834yLEUO2B3hHQO9gnR.8eBMA3zDORpXFrSYzXCuDsWHN6
57+
- $2y$10$nAd2FkTtyrmhHfTlhuxPcu1tWPimr7cX9mpDSGeIweUPLafpSTeiW
5058
tommytran:
5159
- $2y$10$6Mf9m8JXRHUyCgRNPn4nceimRZVOhtmsZbOGoFnI4ZJp..RluHmwy
5260
- $2y$10$Xr6W53IVq52orDvf6.TQQuXeMGaysQdgAu1cm5DYi1NyCskG2ByPe
53-
- $2y$10$x8BG/EcIbVohTU1s/thyc.TIzlfc8f/aVZaD4/1yMpcks2OWzKKMe
61+
- $2y$10$x8BG/EcIbVohTU1s/thyc.TIzlfc8f/aVZaD4/1yMpcks2OWzKKMe
5462
zionbuchanan:
5563
- $2y$10$ufNCdP1efvioBYIih6K92uye33p5ckN/IrxfCvw4n7agHjN8aNfhe
5664
- $2y$10$Mb7LA1kqlDRWlN9jdBYvF.u1B8cmJqXWkrxQeMr/3ETRVOAzFlflG
@@ -59,3 +67,12 @@ quiz:
5967
- $2y$10$Kpde4LAfDyEhgWezFoI5texc53Sge6QQs8y5hR8DA7zHfyK8It5LW
6068
- $2y$10$T061IZuccoHb2XGjaICB/Olchf62DqrSDVIE0TE9Q9qidfLAL7sHS
6169
- $2y$10$T061IZuccoHb2XGjaICB/Olchf62DqrSDVIE0TE9Q9qidfLAL7sHS
70+
chelseaogbonnia:
71+
- $2y$10$zToVGnZqyIwx0GGE.19Cve8sJ9enR1V0hGtssvR/8l42AcsR10aJS
72+
- $2y$10$dkWnar/ZXMr9ndtRDcbTbe/HN3DhuULPoZhTx/xATi.UYQ0DUIx1W
73+
- $2y$10$.Cw9Sjf6Pf9K8EsThegQ5e8BMoJdLl40CCuJ2FKHLar1k8hVfR9fu
74+
- $2y$10$.pmOuTs0Oqjfhn9mMIQCQu7Fbe1ZOZmZIbTGqqul.hnVLqIV6bn/W
75+
pablolimonparedes:
76+
- $2y$10$Oj.VjaxLuCk3H3XGRLH99.y5LnVkVqEAS30eopxFsNfL6FQ0RRdbC
77+
- $2y$10$cs9lhS.nLe6Ym1nkgvr89Oa6Se5DafERs6MJm0t6plQ76zGlTj9JC
78+
- $2y$10$ftCSIQi1kpbWf9CYsrmjCe1H/i/NWzqTX3Jfuqi0TAPcqoCdxrk3O
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class ChelseaOgbonniaQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'chelseaogbonnia';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [
15+
ChelseaOgbonniaQuiz.makeQuestion0(),
16+
ChelseaOgbonniaQuiz.makeQuestion1(),
17+
ChelseaOgbonniaQuiz.makeQuestion2(),
18+
ChelseaOgbonniaQuiz.makeQuestion3(),
19+
];
20+
}
21+
22+
private static makeQuestion0(): QuizQuestion {
23+
return new MultipleChoiceQuizQuestion(
24+
0,
25+
'Which git command combines the changes from one branch to the current branch?',
26+
new Map<AnswerChoice, string>([
27+
[AnswerChoice.A, 'git branch -d <branchname>'],
28+
[AnswerChoice.B, 'git merge <branchname>'],
29+
[AnswerChoice.C, 'git branch'],
30+
[AnswerChoice.D, 'git add <filename>'],
31+
]),
32+
AnswerChoice.UNANSWERED,
33+
); // Replace `UNANSWERED` with the correct answer.
34+
}
35+
36+
private static makeQuestion1(): QuizQuestion {
37+
return new MultipleChoiceQuizQuestion(
38+
1,
39+
'Which git command is used fetch and download content from a remote repository to update the local repository?',
40+
new Map<AnswerChoice, string>([
41+
[AnswerChoice.A, 'git fetch'],
42+
[AnswerChoice.B, 'git merge'],
43+
[AnswerChoice.C, 'git clone'],
44+
[AnswerChoice.D, 'git pull'],
45+
]),
46+
AnswerChoice.UNANSWERED,
47+
); // Replace `UNANSWERED` with the correct answer.
48+
}
49+
private static makeQuestion2(): QuizQuestion {
50+
return new MultipleChoiceQuizQuestion(
51+
2,
52+
'Which Git command is NOT used to sync repositories?',
53+
new Map<AnswerChoice, string>([
54+
[AnswerChoice.A, 'git push'],
55+
[AnswerChoice.B, 'git sync'],
56+
[AnswerChoice.C, 'git pull'],
57+
[AnswerChoice.D, 'git merge'],
58+
]),
59+
AnswerChoice.UNANSWERED,
60+
); // Replace `UNANSWERED` with the correct answer.
61+
}
62+
63+
private static makeQuestion3(): QuizQuestion {
64+
return new MultipleChoiceQuizQuestion(
65+
3,
66+
'Which git command creates a new Git repository?',
67+
new Map<AnswerChoice, string>([
68+
[AnswerChoice.A, 'git init'],
69+
[AnswerChoice.B, 'git clone'],
70+
[AnswerChoice.C, 'git folder <repositoryname>'],
71+
[AnswerChoice.D, 'git add <repositoryname>'],
72+
]),
73+
AnswerChoice.UNANSWERED,
74+
); // Replace `UNANSWERED` with the correct answer.
75+
}
76+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class KimberleeHaldaneQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'kimberleehaldane';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [
15+
KimberleeHaldaneQuiz.makeQuestion0(),
16+
KimberleeHaldaneQuiz.makeQuestion1(),
17+
KimberleeHaldaneQuiz.makeQuestion2(),
18+
];
19+
}
20+
21+
private static makeQuestion0(): QuizQuestion {
22+
return new MultipleChoiceQuizQuestion(
23+
0,
24+
'Which command tells you where you are in the terminal?',
25+
new Map<AnswerChoice, string>([
26+
[AnswerChoice.A, 'pwd'],
27+
[AnswerChoice.B, 'ls'],
28+
[AnswerChoice.C, 'cd'],
29+
[AnswerChoice.D, 'mkdir'],
30+
]),
31+
AnswerChoice.UNANSWERED,
32+
); // Replace `UNANSWERED` with the correct answer.
33+
}
34+
35+
private static makeQuestion1(): QuizQuestion {
36+
return new MultipleChoiceQuizQuestion(
37+
1,
38+
'Why do we use IDEs?',
39+
new Map<AnswerChoice, string>([
40+
[AnswerChoice.A, 'hunting insects'],
41+
[AnswerChoice.B, 'testing powerlines'],
42+
[AnswerChoice.C, 'editing and refactoring code'],
43+
[AnswerChoice.D, 'all of the above'],
44+
]),
45+
AnswerChoice.UNANSWERED,
46+
); // Replace `UNANSWERED` with the correct answer.
47+
}
48+
49+
private static makeQuestion2(): QuizQuestion {
50+
return new MultipleChoiceQuizQuestion(
51+
2,
52+
'In the vscode terminal, what command is used to verify that you created a branch?',
53+
new Map<AnswerChoice, string>([
54+
[AnswerChoice.A, 'git branch -a'],
55+
[AnswerChoice.B, 'git merge main'],
56+
[AnswerChoice.C, 'git checkout -b new_feature'],
57+
[AnswerChoice.D, 'git remote -v'],
58+
]),
59+
AnswerChoice.UNANSWERED,
60+
); // Replace `UNANSWERED` with the correct answer.
61+
}
62+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class LjMcwilliamsQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'ljmcwilliams';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [
15+
LjMcwilliamsQuiz.makeQuestion0(),
16+
LjMcwilliamsQuiz.makeQuestion1(),
17+
LjMcwilliamsQuiz.makeQuestion2(),
18+
];
19+
}
20+
21+
private static makeQuestion0(): QuizQuestion {
22+
return new MultipleChoiceQuizQuestion(
23+
0,
24+
'Which component of a computer is responsible for short-term memory?',
25+
new Map<AnswerChoice, string>([
26+
[AnswerChoice.A, 'Motherboard'],
27+
[AnswerChoice.B, 'CPU (Central Processing Unit)'],
28+
[AnswerChoice.C, 'RAM (Random Access Memory)'],
29+
[AnswerChoice.D, 'Power Supply'],
30+
]),
31+
AnswerChoice.UNANSWERED,
32+
); // Replace `UNANSWERED` with the correct answer.
33+
}
34+
35+
private static makeQuestion1(): QuizQuestion {
36+
return new MultipleChoiceQuizQuestion(
37+
1,
38+
'Which terminal command allows a user to copy a file or directory?',
39+
new Map<AnswerChoice, string>([
40+
[AnswerChoice.A, 'cp file-name'],
41+
[AnswerChoice.B, 'cpy file-name'],
42+
[AnswerChoice.C, 'dupe file-name'],
43+
[AnswerChoice.D, 'make file-name'],
44+
]),
45+
AnswerChoice.UNANSWERED,
46+
); // Replace `UNANSWERED` with the correct answer.
47+
}
48+
49+
private static makeQuestion2(): QuizQuestion {
50+
return new MultipleChoiceQuizQuestion(
51+
2,
52+
'Which Git command allows a user to delete a feature branch LOCALLY?',
53+
new Map<AnswerChoice, string>([
54+
[AnswerChoice.A, 'git remove branch-name'],
55+
[AnswerChoice.B, 'git push origin --delete branch-name'],
56+
[AnswerChoice.C, 'git checkout master'],
57+
[AnswerChoice.D, 'git branch -d branch-name'],
58+
]),
59+
AnswerChoice.UNANSWERED,
60+
); // Replace `UNANSWERED` with the correct answer.
61+
}
62+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class PabloLimonParedesQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'pablolimonparedes';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [
15+
PabloLimonParedesQuiz.makeQuestion0(),
16+
PabloLimonParedesQuiz.makeQuestion1(),
17+
PabloLimonParedesQuiz.makeQuestion2(),
18+
];
19+
}
20+
21+
private static makeQuestion0(): QuizQuestion {
22+
return new MultipleChoiceQuizQuestion(
23+
0,
24+
'What does git checkout -b branch command do?',
25+
new Map<AnswerChoice, string>([
26+
[AnswerChoice.A, 'Creates a pull request'],
27+
[AnswerChoice.B, 'Creates a new branch and switches you to it'],
28+
[AnswerChoice.C, 'To move to another branch'],
29+
[AnswerChoice.D, 'Delete a branch'],
30+
]),
31+
AnswerChoice.UNANSWERED,
32+
); // Replace `UNANSWERED` with the correct answer.
33+
}
34+
35+
private static makeQuestion1(): QuizQuestion {
36+
return new MultipleChoiceQuizQuestion(
37+
1,
38+
'What does the man git command do?',
39+
new Map<AnswerChoice, string>([
40+
[AnswerChoice.A, 'Create a new directory'],
41+
[AnswerChoice.B, 'Shows history of commands'],
42+
[AnswerChoice.C, 'Get to main branch'],
43+
[AnswerChoice.D, 'Access the manual for git'],
44+
]),
45+
AnswerChoice.UNANSWERED,
46+
); // Replace `UNANSWERED` with the correct answer.
47+
}
48+
private static makeQuestion2(): QuizQuestion {
49+
return new MultipleChoiceQuizQuestion(
50+
2,
51+
'How do you clear up your terminal if your screen is cramped?',
52+
new Map<AnswerChoice, string>([
53+
[AnswerChoice.A, 'command + k'],
54+
[AnswerChoice.B, 'CTRL + space'],
55+
[AnswerChoice.C, 'command + shift + P'],
56+
[AnswerChoice.D, 'command + T'],
57+
]),
58+
AnswerChoice.UNANSWERED,
59+
); // Replace `UNANSWERED` with the correct answer.
60+
}
61+
}

lesson_03/quiz/src/quizzes/quizzes.module.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { AmiyahJonesQuiz } from './amiyah_jones_quiz.js';
33
import { AnotherQuiz } from './another_quiz.js';
44
import { AngelicaCQuiz } from './angelica_c_quiz.js';
55
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
6+
import { ChelseaOgbonniaQuiz } from './chelsea_ogbonnia_quiz.js';
67
import { ChigazoGrahamsQuiz } from './chigazo_graham_quiz.js';
78
import { DasiaEnglishQuiz } from './dasia_english_quiz.js';
89
import { DavidSmithQuiz } from './david_smith_quiz.js';
@@ -12,7 +13,10 @@ import { XavierCruzQuiz } from './xavier_cruz_quiz.js';
1213
import { YafiahAbdullahQuiz } from './yafiah_abdullah_quiz.js';
1314
import { JamesCapparellQuiz } from './james_capparell_quiz.js';
1415
import { JosephCaballeroQuiz } from './joseph_caballero_quiz.js';
16+
import { KimberleeHaldaneQuiz } from './kimberlee_haldane_quiz.js';
17+
import { LjMcwilliamsQuiz } from './lj_mcwilliams_quiz.js';
1518
import { OyeyemiJimohQuiz } from './oyeyemi_jimoh_quiz.js';
19+
import { PabloLimonParedesQuiz } from './pablo_limon_paredes_quiz.js';
1620
import { ShawnDunsmoreQuiz } from './shawn_dunsmore_quiz.js';
1721
import { TommyTranQuiz } from './tommy.tran.quiz.js';
1822
import { XavierCruzQuiz } from './xavier_cruz_quiz.js';
@@ -31,13 +35,17 @@ const QUIZ_PROVIDERS = [
3135
JosephCaballeroQuiz,
3236
AngelicaCQuiz,
3337
OyeyemiJimohQuiz,
38+
KimberleeHaldaneQuiz,
3439
ShawnDunsmoreQuiz,
3540
DasiaEnglishQuiz,
3641
ChigazoGrahamsQuiz,
3742
AmiyahJonesQuiz,
3843
XavierCruzQuiz,
44+
LjMcwilliamsQuiz,
3945
ZionBuchananQuiz,
46+
ChelseaOgbonniaQuiz,
4047
TommyTranQuiz,
48+
PabloLimonParedesQuiz,
4149
];
4250

4351
@Module({

lesson_04/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@ Please review the following resources before lecture:
99

1010
## Homework
1111

12-
TODO(anthonydmays): Add details
12+
- [ ] Do [coding exercise](#writing-some-code).
13+
- [ ] Do pre-work for [lesson 05](/lesson_05/).
14+
15+
### Writing some code
16+
17+
For this assignment, you will need to write code that determines whether a number is a prime number. You will produce code in two different languages, then provide a 100+ word write up about the similarities and differences between the two implementations you made. An example is provided in the [anthonydmays/](./anthonydmays/) folder.

lesson_04/anthonydmays/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## Python implementation
2+
3+
```python
4+
def is_even(number):
5+
return number % 2 == 0
6+
7+
# Example usage:
8+
print(is_even(4)) # Output: True
9+
print(is_even(7)) # Output: False
10+
```
11+
12+
## JavaScript implementation
13+
14+
```javascript
15+
function isEven(number) {
16+
return number % 2 === 0;
17+
}
18+
19+
// Example usage:
20+
console.log(isEven(4)); // Output: true
21+
console.log(isEven(7)); // Output: false
22+
```
23+
24+
## Explanation
25+
26+
The Python implementation uses a function named `is_even` that takes a single argument `number`. It returns `True` if the number is even (i.e., when the remainder of the division of the number by 2 is zero), otherwise, it returns `False`.
27+
28+
The JavaScript implementation uses a function named `isEven` that also takes a single argument `number`. It returns `true` if the number is even (using the same logic as the Python function) and `false` otherwise.
29+
30+
### Differences
31+
32+
1. **Syntax**:
33+
- In Python, functions are defined using the `def` keyword, whereas in JavaScript, the `function` keyword is used.
34+
- Python uses `True` and `False` for boolean values, while JavaScript uses `true` and `false`.
35+
36+
2. **Type Coercion**:
37+
- JavaScript has type coercion, which can sometimes lead to unexpected results if the input is not properly handled. In contrast, Python is more strict with types.
38+
39+
3. **Function Calls**:
40+
- The syntax for calling functions and printing to the console/output is slightly different. Python uses `print()`, while JavaScript uses `console.log()`.

0 commit comments

Comments
 (0)