Shared data on similar tables on multiple screens

I’m just starting to learn CL, so feel free to point me to the doc to figure things out … .

I have a table, say coordinate pairs in 2 columns. I want this table to appear on several screens. So far so good. I want additions, deletions, and updates to happen on any screen and be reflected on all screens.


You would need to code each individual cell. If your first (editable) table is named table1, in the next table:

cellContent(1,1): T.cellContent(1,1)
cellContent(1,2): T.cellContent(1,2)

You can then copy the entire CL from table #2 into each following table’s CL. If you have another editable table in your activity, say table5, which you want to similarly copy to following tables, then you can copy-paste the same CL and just change the first line to:


Also, if you are editing the CL for a component, there are common sources and sinks from the documentation on the right.

Thanks! That allows me to copy data entered in table 1 to other tables. But, I can only enter data into table1. I’d like to have several tables that are editable and share updates. Is that possible?

Just change the T’s for each cellContent to a specific table name. The T=whatever is just a convenient way to copy CL code without needing to edit each individual line.

To copy something from a table: tableName.cellContent(row, column)
From a math input: inputName.latex
From a text input: inputName.content
A variable created inside a different component: componentName.script.variableName

There’s also .numericValue or .cellNumericValue(row, column) instead of .latex or .content, and you can surround any of the above with ${ } if you want to create dynamic latex or text like:

content: "Your answer on the last screen was ${input3.numericValue} feet."

Thanks for all your help! I’m pretty sure I have not communicated clearly. I want two identical tables on different screens, where I can enter or update data in either table, and they propagate to the other table. I think you’ve outlined a single master table with read-only copies, but I may be mistaken.

Unfortunately I don’t think there is a way of doing this, as it would create circular dependency issues. I believe that as far as Desmos is concerned, a cell is either pre-populated by CL or is editable by a student; there isn’t a way to have both.

1 Like

I’m a complete newbie on this so it’s probably nonsense but I’d like to know if so for my own future use. Is there any sort of callback function that can be triggered if a student enters a value in a table that could then run the above suggestions to copy the new entry into all other copies of the table?

No. As @pirsquared noted, you can set the content of a table cell using the CL (rendering the cell uneditable), or it can be editable by a student (which can be referenced elsewhere). You can’t have two cells that are bidirectionally linked where editing one cell changes the other and vice versa (as OP would like).

OK, thanks, that is helpful to know.

I was thinking if say you had a table pre-loaded with one example entry and student A added a second, that would be editable by him but could be copied to others as read-only for them. If student B then added a third entry that would remain editable for her but could be copied as read-only for A and everyone else.

I’m not sure if that would satisfy the O.P.'s question but might be useful for say logging the results of a class all doing their own version of an experiment. Statistics could be run on the table but nobody could mess up anyone else’s result.

There’s an aggregate function that would be necessary to use just to collect that info, and would be much more useful to use a dotplot or something to display the full class info.

Using a table for this would be extremely unwieldy and difficult to code (i.e. an aggregate for each cell would be needed just to be able to allow access to other students’ data), whereas a single input can be used to create a list of all student data for that input and used as you see fit. You could conceivably create a table from that data, one cell at a time, and it would update when a student changed their input, but the aggregated (and shared) data is not necessarily quick to update.

1 Like

Thank you Daniel, sorry to be a pain but I’ve got a lot to learn.

Everyone is still learning. That’s why this forum is here! I know I still learn new tricks (plus Desmos periodically has new features).

1 Like

I had never heard of Desmos before January so I have more to learn than most !

1 Like