Summing content in cells in a table

I’d like to score a problem set so students work until they have earned a set number of point (problems have different point values). I think the easiest thing would be to have a table that would check answers with a column for points earned so when a correct answer is entered those points are added to the student’s tally.

Is there a way to define a variable that is a sum of the values in a column that I could use to both display the point total and unhide an image congratulating them for earning the required number of points?

1 Like

The easiest way would be to have a hidden graph component, into which you can feed a numberList via columnNumericValues - eg. numberList(A): table.columnNumericValues(3)

In the graph, you can then calculate total(A) as another number - eg. t=total(A) - and then pull that number back into CL using graph.number(t)

I just tried your advice but was not able to get it to work, sorry not to have the coding fluency.

I did find another way to make this work that doesn’t use a graph: Graded Table of Answers Frame • Activity Builder by Desmos

The A needs to be surrounded by quotes or backticks.

(@pirsquared If you use triple backticks around your code in the forum, it’ll display how I think you intended:
numberList(` A `): table.columnNumericValues(3)

1 Like