# Conditional aggregating and polygons from aggregated points

Hi,

I’m trying to create an activity where students sign up for a talk, choosing when and how long they want to talk to me. I’m using aggregate so they can see when other students already signed up for a talk, and avoid double-booking.

I have two problems:

1. I am able to aggregate points but when I’m trying to create a polygon from those points it doesn’t show up on the graph (the points are showing up).

2. I tried conditional aggregating, so the computer won’t block 3 timeslots for each student, but it stil does. For example: A student blocked 8:50-8:55, which is in the morning graph, but the next student will also see 10:00-10:05 (late moning graph) and 11:30-11:35 (around noon graph) as blocked. I was trying to condition using something I found here, otherwise aggregating 1000 and making the list defined only for values under 1000, but I must have done something wrong.

Here is the activity, if you need to see the code I was using: polygon help • Activity Builder by Desmos

*The polygon I’m trying to create in in the “other students’ timeslots” file on the graphs of the 3rd screen.

Could anyone help me figure it out?

Maor

Wow, this sounds like an awesome use of desmos and also entirely the wrong tool for the job If your school uses google apps, there are “appointment slots” you could set up. I’d be tempted to reach for a shared spreadsheet, but maybe you’ve got concerns about students deleting each others’ slots.

Regardless, I was able to bebug your aggregation graph by simulating the lists of values you’d get for Y1, Y2 in this graph: Graphing Calculator (As a general rule, I’ve found it much easier to plan out aggregation screens when I have the variables that will be set by CL defined in the graph. Otherwise, you don’t get the helpful error messages!)

The error message on your `polygon(P,Q)` statement says “Some of your arguments are not points” — looking more closely at `P` and `Q`, I see that both are actually lists of points. You’re effectively asking for something like `polygon([(0,0),(0,1),(0,2)], [(0,3), (0,4), (0,5)])` — while what you were hoping for is probably something more like `[polygon((0,0),(0,3)), polygon((0,1), (0,4)), polygon((0,2),(0,5))]`. The good news is, that’s an easy change to make! In my graph link, you’ll see in line 31 that I’ve used list comprehension to write a list of polygons from pairing up points within the aggregated point lists.

As a side note, where you’ve got your conditions set up in `Y_p` and `Y_q` to make undefined entries if the value is `1000`, you could replace the curly braces with square brackets to write a list filter. There’s really not a huge difference in effect, but instead of a list that includes undefined elements you just get a list without those elements present. I’m a fan, 10/10 would recommend.

1 Like

Isn’t another issue here that aggregate can have unpredictable lag? I have only used it a couple of times and it didn’t always work like I expected. So if a class of students is all signing up at the same time, I wonder if this is going to work properly.

Sure — “aggregate” is designed more for “put student responses into a bucket” than “let students respond in real-time to each other.” (That’s what snapshots / teacher overlay and pause are for!)