Collect Class Data

Good Morning! One of my science teachers is trying to create a graph that will collect the class data in real time while students are entering their individual trait’s data. She tried to copy the code from another data collector template but has not figured it out so any help would be much appreciated! The activity is on slide’s 1 and 2…students enter their data in a table on slide 1 that should populate the graph on slide 2. Or, on slide 3 students could enter the data and see it populate the graph on the same slide. Thanks in advance for the help!

Several issues:

  1. If you are referencing components from a different slide, it has to have a unique name. Currently, you have three slides with “Traits_Labels”. That’s the first error showing. I tend to put numbers for the slide #, so I know where to look later if there’s possibly a problem on that component. You can make a variable set to the component name so you don’t need to replace the many times you use it:
Traits_Label= Traits_Label3
  1. You’ve tried to define numberList(`x_1`) twice. (Take out the second one)
  2. You can only aggregate individual numbers. No columnValues. So you will need separate numberLists to aggregate each cell of the table individually. You can join them into a single list in the graph. (Instead of aggregating each cell it’ll shorten things a little to use the elements of the numberList:
numberList(`L_1`): aggregate(this.number(`x_1[1]`))
numberList(`L_2`): aggregate(this.number(`x_1[2]`))
numberList(`L_3`): aggregate(this.number(`x_1[3]`))
numberList(`L_4`): aggregate(this.number(`x_1[4]`))
...

In the graph: L=join(L_1, L_2, L_3, L_4)

Thank you! That makes a lot of sense! I went ahead and fixed those things and now it will carry the data over from slide 1 to slide 2, however it will not aggregate the data for the entire class on one graph. Is it possible to do that? Thanks!

aggregate is class data. So L_1 above is a list of the first element from x_1 for all students. You might need to use total( ) for each list. The totals may be what is actually intended for list x_1 for the bar graph, so you may need to use a different list name than x_1. Then, x_1 should actually be a list of the totals for each trait list.

Also, I was looking at the table, I don’t think you want students to put the trait number in column 3. It’s counting that as a quantity. It should really be 1 or 0 for each trait.