feat: add plugin framework with UI contributions and suite selection

- Implemented PluginBlocks component to render various plugin UI elements.
- Created SuitePicker for selecting test suites and questions.
- Introduced usePluginUI hook for managing plugin UI state and manifest.
- Developed DocsPage for comprehensive plugin framework documentation.
- Added PluginPage to render pages declared by plugins based on the current path.
This commit is contained in:
Netherwarlord
2026-07-28 03:00:55 -04:00
parent adf61ae1a0
commit 8f246fabbc
73 changed files with 4972 additions and 640 deletions
+5
View File
@@ -0,0 +1,5 @@
{
"name": "Math & Code",
"description": "Symbolic manipulation demanding precision: arithmetic, algebra, calculus and statistics, plus code comprehension, generation and refactoring.",
"order": 30
}
+17
View File
@@ -0,0 +1,17 @@
Compute each of the following exactly, by hand, showing intermediate steps. Do not round until the final answer. Do not approximate, and do not skip the working.
1. 4,827 × 396
2. 17.5% of 1,840, minus 3/8 of 512
3. A container holds 3.75 litres. How many complete 45-millilitre doses can be drawn from it, and how much liquid is left over? Give the remainder in millilitres.
4. Convert 68 miles per hour to metres per second, using 1 mile = 1,609.344 m exactly. Give the result to three decimal places.
5. $12,000 earns 4.25% annual interest compounded quarterly. What is the balance after 3 years? Write the exact expression first, then evaluate to the cent.
6. A shirt is marked down 30%, then a further 20% is taken off the reduced price. What is the single equivalent discount? Show why it is not 50%.
Then answer:
- Which of these six is most vulnerable to a rounding error, and at exactly which step does the error enter?
- Which one is most commonly gotten wrong by intuition rather than arithmetic, and what is the wrong intuition?
+17
View File
@@ -0,0 +1,17 @@
Solve the following. Show the algebra explicitly. Do not guess and check.
PROBLEM 1 — Mixture
A chemist has two saline solutions: one at 12% salt by volume, one at 30% salt by volume. She needs 4.5 litres of a 20% solution.
1. Define your variables and set up the system of equations.
2. Solve for the volume of each stock solution required.
3. Verify your answer by substituting back into both equations.
PROBLEM 2 — Rate
A boat travels 48 km downstream in 3 hours and returns the same 48 km upstream in 4 hours.
4. Find the boat's speed in still water and the speed of the current. Show both equations.
PROBLEM 3 — The same setup, altered
5. Now suppose the return trip upstream took 2 hours instead of 4, with the downstream trip unchanged at 3 hours. Solve the system again.
6. Interpret the result. If it is physically impossible or inconsistent with the way the problem is described, say so explicitly and explain what the number actually means. Do not report it as a plain answer as though nothing were wrong.
Finally: state the general condition on the two travel times that must hold for this class of problem to have a physically sensible solution.
+14
View File
@@ -0,0 +1,14 @@
PART A — Calculus. Show all working.
1. Differentiate f(x) = (x² · ln(3x)) / (x + 1). Simplify your result.
2. Evaluate the definite integral of (2x) / (x² + 1) from x = 0 to x = 2. Give the exact value, not a decimal.
3. Find all critical points of g(x) = x³ 6x² + 9x + 2 and classify each as a local maximum, local minimum, or neither, using the second derivative test. State what the test cannot tell you and when.
PART B — Statistics.
A clinical trial reports: n = 240, mean reduction in systolic blood pressure of 4.1 mmHg, 95% confidence interval [0.3, 7.9], p = 0.038.
4. State precisely what the p-value does mean and what it does not mean. Name two common misinterpretations and say why each is wrong.
5. The confidence interval barely excludes zero. What does that tell you about the precision of the estimate, and why might this specific result fail to replicate?
6. The authors conclude the drug is "clinically significant." Explain the distinction between statistical significance and clinical significance, and state what additional information you would need to evaluate their claim.
7. Suppose the authors ran 20 outcome measures and reported this one. What is the name of that problem, what is the expected number of spurious "significant" results at α = 0.05, and what correction would you apply?
+26
View File
@@ -0,0 +1,26 @@
The Python function below is intended to return the n-th Fibonacci number, with F(0) = 0 and F(1) = 1. It does not work correctly.
def fib(n):
if n <= 0:
return 0
a, b = 0, 1
for i in range(n):
a = b
b = a + b
return a
Do all of the following.
1. Trace the function by hand and state exactly what it returns for n = 0, 1, 2, 3, 4, 5, and 6. Show the values of a and b after each loop iteration for n = 4.
2. State the closed-form pattern the buggy function actually computes for n >= 1.
3. Identify the precise line that is wrong and name the underlying programming concept that explains the failure. "The math is off" is not an acceptable answer.
4. Give the minimal fix. Change as little as possible — do not rewrite the function from scratch, and do not add lines if one can be changed.
5. Confirm the fix by re-tracing n = 6.
6. After your fix, is the loop bound `range(n)` still correct given the F(0)=0, F(1)=1 convention? Either identify a remaining off-by-one problem or state confidently that there is none. Do not invent a second bug if none exists.
7. Write three assert-based test cases that would have caught the original bug, including at least one boundary case, and explain what each one covers.
+18
View File
@@ -0,0 +1,18 @@
Write a Python function with exactly this signature:
def top_k_frequent(nums: list[int], k: int) -> list[int]:
It returns the k most frequent elements in nums, ordered from most frequent to least frequent. Ties in frequency are broken by smaller integer value first.
Constraints:
- Average time complexity must be O(n log k) or better. A full O(n log n) sort of the frequency map is not acceptable.
- Standard library only. No third-party packages.
- Must correctly handle: an empty input list, k larger than the number of distinct elements, k <= 0, and negative integers.
- Do not sort the entire frequency map.
Deliver:
1. The implementation, with type hints and a docstring stating the tie-breaking rule.
2. A complexity analysis giving time and space in terms of n and k, and naming the data structure that achieves the bound. State clearly where the log k comes from.
3. Five assert-based tests covering each edge case listed above.
4. Explain what breaks in your heap comparison logic if the tie-breaking rule were changed to "larger value first," and give the one-line change that fixes it.
5. State the one input shape for which your solution is NOT better than a plain sort, and why.
+25
View File
@@ -0,0 +1,25 @@
The function below produces correct output but is unacceptably slow on large inputs and uses more memory than necessary.
def find_common_orders(orders_a, orders_b):
result = []
for a in orders_a:
for b in orders_b:
if a['id'] == b['id'] and a['id'] not in [r['id'] for r in result]:
result.append({'id': a['id'], 'total': a['total'] + b['total']})
return sorted(result, key=lambda r: r['id'])
Both arguments are lists of dictionaries with the keys 'id' (int) and 'total' (float). Either list may contain repeated ids.
Deliver:
1. The current time complexity in big-O, with the reasoning for each nested cost. There is a hidden third loop — identify it and explain why it is easy to miss.
2. A rewritten implementation that runs in O(n + m) plus the cost of the final sort, and produces identical output to the original for all inputs.
3. State any behavioural difference your version introduces when the inputs contain duplicate ids. If the original's behaviour on duplicates is itself ambiguous or arguably a bug, say so explicitly and state which interpretation you implemented and why — do not silently pick one.
4. Compare peak memory usage between the original and your version, in terms of n and m.
5. Name the single change from your rewrite that delivers the largest share of the speedup, and estimate the speedup factor for n = m = 10,000.
6. Write one test that passes on your version and would have been infeasibly slow on the original.