Error
There was an error loading the page.
Asks the student to calculate the sum of the triangular numbers (up to some randomised number).
Steps guide the student through each step in the calculation.
Metadata
-
England schools
-
England university
-
Scotland schools
Taxonomy: mathcentre
Taxonomy: Kind of activity
Taxonomy: Context
Contributors
History
Christian Lawson-Perfect 1 year, 10 months ago
Published this.Christian Lawson-Perfect commented 3 years, 1 month ago
I've fixed the expected answer display.
You need to be careful when testing numpy arrays. When a and b are arrays,
a == b
returns an array, not a bool.So, to test if two arrays are equal, you need
np.array_equal(a,b)
.Also, Pyodide doesn't seem to be able to post numpy values back from the worker, so you need to return a Python built-in type. I've added a special case checking for the numpy.bool_ type, because wrapping every test in bool() would get boring quickly, but you can't pass back numpy.array or numpy.int64/float64.
George Stagg commented 3 years, 1 month ago
Apologies, some of those issues might be me, I'm adding back R into the latest version of the extension.
Chris Graham commented 3 years, 1 month ago
Couple of things to look at in the programming extension when I tried this out:
- Noticed an issue in the marking of the steps:
"Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': [object Object] could not be cloned."- The correct answer is actually the placeholder content I think?
Chris Graham 3 years, 1 month ago
Created this.There is only one version of this question that you have access to.
Name | Type | Generated Value |
---|
nmax | integer |
100
|
Generated value: integer
This variable doesn't seem to be used anywhere.
Use this tab to check that this question works as expected.
Part | Test | Passed? |
---|---|---|
Code | ||
Hasn't run yet | ||
Code | ||
Hasn't run yet | ||
Code | ||
Hasn't run yet | ||
Code | ||
Hasn't run yet |
This question is used in the following exam: