This page contains test cases for verifying that numbered="left" on Parsons blocks does not cause the source area to overflow its container. Each exercise targets a different combination of options that could interact with the left-label width calculation.
total = 0
---
total = 1 #paired
---
for i in range(10):
---
for i in range(0, 10, 1): #paired
---
total += i
---
total = total + 1 #paired
---
print(total)
Subsection1.1.4Group 4: Ten or more blocks (double-digit line numbers)
Activity1.1.7.
Case 4-A: Ten blocks, adaptive, left-numbered. At 10+ blocks the label gets an extra space for alignment; verify this extra padding does not cause overflow.
public static int sum(int[] arr) {
---
public int sum(int[] arr) { #paired
---
int total = 0;
---
for (int num : arr) {
---
for (int i = 0; i < arr.length; i++) { #paired
---
total += num;
---
}
---
return total;
---
}
Case 5-B: Natural language, adaptive, left-numbered. Natural language steps can be long prose; tests that the label column does not push prose lines out of the source area.
Open the file for writing.
---
Open the file for reading.
#paired
---
Write the header row to the file.
---
Loop over each record in the dataset.
---
Loop over each column in the dataset.
#paired
---
Write the current record to the file.
---
Close the file when finished.
Case 6-A: Right-numbered, adaptive, no indent. Numbers on the right should be unaffected by the left-label fix; use this as a visual baseline to confirm right-numbering still works.
Subsection1.1.7Group 7: Multiple indent levels with left numbering
Activity1.1.13.
Case 7-A: Three levels of indentation, adaptive, left-numbered. Deep indentation reduces the effective code width; the label column must still fit without causing the outer container to overflow.
def process(data):
---
for row in data:
---
for row in range(data): #paired
---
if row is not None:
---
if row != None: #paired
---
results.append(row)
---
return results
Case 7-B: Mixed indentation, long lines, static (non-adaptive), left-numbered. Combines the widest lines with indent columns to stress-test the layout.
def find_duplicates(input_list):
---
seen = set()
---
seen = [] #paired
---
duplicates = []
---
duplicates = set() #paired
---
for item in input_list:
---
if item in seen and item not in duplicates:
---
if item in seen: #paired
---
duplicates.append(item)
---
seen.add(item)
---
return duplicates