Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 168 additions & 0 deletions session1/answers/hello-imposter-quiz-1/answers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
{
"quiz_title": "Hello imposter quiz",
"score": 10,
"score_total": 10,
"total_questions": 5,
"answers": [
{
"question_title": "Question 1",
"question_text": "What happens when you do `arr = [1,2,3]; b = arr`?",
"selected_indexes": [
1
],
"selected_labels": "1. Both variables reference the same list in memory",
"selected_imposters": [
2
],
"selected_imposter_labels": "2. A new copy of the list is created for `b`",
"correct_indexes": [
1
],
"correct_labels": "1. Both variables reference the same list in memory",
"expected_imposters": [
2
],
"expected_imposter_labels": "2. A new copy of the list is created for `b`",
"is_correct": true,
"result_label": "Correct",
"answer_correct": true,
"question_points": 2,
"question_max_points": 2,
"imposter_true_positive": 1,
"imposter_false_positive": 0,
"imposter_false_negative": 0,
"explanation": "Assignment creates a reference, not a copy. Changes via `b` affect `arr`.",
"lifelines_used": [],
"current_points_after_question": 0,
"guaranteed_points_after_question": 0
},
{
"question_title": "Question 2",
"question_text": "What does `arr * 3` do for a list?",
"selected_indexes": [
1
],
"selected_labels": "1. Repeats the list three times",
"selected_imposters": [
4
],
"selected_imposter_labels": "4. Multiplies each element by 3",
"correct_indexes": [
1
],
"correct_labels": "1. Repeats the list three times",
"expected_imposters": [
4
],
"expected_imposter_labels": "4. Multiplies each element by 3",
"is_correct": true,
"result_label": "Correct",
"answer_correct": true,
"question_points": 2,
"question_max_points": 2,
"imposter_true_positive": 1,
"imposter_false_positive": 0,
"imposter_false_negative": 0,
"explanation": "`*` repeats the list, it does not apply multiplication to each element.",
"lifelines_used": [],
"current_points_after_question": 0,
"guaranteed_points_after_question": 0
},
{
"question_title": "Question 3",
"question_text": "What does `arr.append([4,5])` do?",
"selected_indexes": [
1
],
"selected_labels": "1. Adds the list `[4,5]` as a single element",
"selected_imposters": [
4
],
"selected_imposter_labels": "4. Extends the list with `[4,5]`",
"correct_indexes": [
1
],
"correct_labels": "1. Adds the list `[4,5]` as a single element",
"expected_imposters": [
4
],
"expected_imposter_labels": "4. Extends the list with `[4,5]`",
"is_correct": true,
"result_label": "Correct",
"answer_correct": true,
"question_points": 2,
"question_max_points": 2,
"imposter_true_positive": 1,
"imposter_false_positive": 0,
"imposter_false_negative": 0,
"explanation": "`append` adds one element, even if that element is a list. Using `extend` would add elements separately.",
"lifelines_used": [],
"current_points_after_question": 0,
"guaranteed_points_after_question": 0
},
{
"question_title": "Question 4",
"question_text": "What is the time complexity of calling `len(arr)` in Python?",
"selected_indexes": [
1
],
"selected_labels": "1. O(1)",
"selected_imposters": [
2
],
"selected_imposter_labels": "2. O(n)",
"correct_indexes": [
1
],
"correct_labels": "1. O(1)",
"expected_imposters": [
2
],
"expected_imposter_labels": "2. O(n)",
"is_correct": true,
"result_label": "Correct",
"answer_correct": true,
"question_points": 2,
"question_max_points": 2,
"imposter_true_positive": 1,
"imposter_false_positive": 0,
"imposter_false_negative": 0,
"explanation": "Python stores the length internally, so `len()` is constant time.",
"lifelines_used": [],
"current_points_after_question": 0,
"guaranteed_points_after_question": 0
},
{
"question_title": "Question 5",
"question_text": "What is the time complexity of checking if a value exists in a list using `if x in arr`?",
"selected_indexes": [
1
],
"selected_labels": "1. O(n)",
"selected_imposters": [
2
],
"selected_imposter_labels": "2. O(1)",
"correct_indexes": [
1
],
"correct_labels": "1. O(n)",
"expected_imposters": [
2
],
"expected_imposter_labels": "2. O(1)",
"is_correct": true,
"result_label": "Correct",
"answer_correct": true,
"question_points": 2,
"question_max_points": 2,
"imposter_true_positive": 1,
"imposter_false_positive": 0,
"imposter_false_negative": 0,
"explanation": "In the worst case, Python checks each element until it finds a match or reaches the end.",
"lifelines_used": [],
"current_points_after_question": 0,
"guaranteed_points_after_question": 0
}
]
}
47 changes: 47 additions & 0 deletions session1/answers/hello-imposter-quiz-1/answers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Quiz: Hello imposter quiz
Score: 10/10

Question 1
What happens when you do `arr = [1,2,3]; b = arr`?
Selected: 1. Both variables reference the same list in memory
Correct: 1. Both variables reference the same list in memory
Imposters flagged: 2. A new copy of the list is created for `b`
Expected imposters: 2. A new copy of the list is created for `b`
Result: Correct
Explanation: Assignment creates a reference, not a copy. Changes via `b` affect `arr`.

Question 2
What does `arr * 3` do for a list?
Selected: 1. Repeats the list three times
Correct: 1. Repeats the list three times
Imposters flagged: 4. Multiplies each element by 3
Expected imposters: 4. Multiplies each element by 3
Result: Correct
Explanation: `*` repeats the list, it does not apply multiplication to each element.

Question 3
What does `arr.append([4,5])` do?
Selected: 1. Adds the list `[4,5]` as a single element
Correct: 1. Adds the list `[4,5]` as a single element
Imposters flagged: 4. Extends the list with `[4,5]`
Expected imposters: 4. Extends the list with `[4,5]`
Result: Correct
Explanation: `append` adds one element, even if that element is a list. Using `extend` would add elements separately.

Question 4
What is the time complexity of calling `len(arr)` in Python?
Selected: 1. O(1)
Correct: 1. O(1)
Imposters flagged: 2. O(n)
Expected imposters: 2. O(n)
Result: Correct
Explanation: Python stores the length internally, so `len()` is constant time.

Question 5
What is the time complexity of checking if a value exists in a list using `if x in arr`?
Selected: 1. O(n)
Correct: 1. O(n)
Imposters flagged: 2. O(1)
Expected imposters: 2. O(1)
Result: Correct
Explanation: In the worst case, Python checks each element until it finds a match or reaches the end.
7 changes: 7 additions & 0 deletions session1/answers/python-basics-quiz-1/answers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"quiz_title": "Python basics quiz",
"score": 0,
"score_total": 0,
"total_questions": 6,
"answers": []
}
2 changes: 2 additions & 0 deletions session1/answers/python-basics-quiz-1/answers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Quiz: Python basics quiz
Score: 0/0
Loading