Organizing Bits of Code

Does anyone have a good way to organize bits of code so that you can go back to get it later? I use the documentation page pretty frequently, but I forget if the bit of code is in the graph section, note section, etc. It’s somewhat difficult going through all of my previous activities trying to find the piece of the activity I’m thinking of.

For example, I’d like to be able to search “check student graph against correct graph” and find all of the code that goes into doing that.

Do you make a single activity with all your code examples in it? Word doc? Something else?

1 Like

I keep a Google Document with useful bits of code ready to go, with mostly bits for displaying variables for equations and setting up screens I use often. I’m happy to share if you’d like, though I don’t know that it would be terribly useful.

Having a shared community document (or maybe even a section of the website) that works as a function library for common tasks, code to generate certain function types quickly - here’s code that will randomly generate a quadratic with intercepts and vertex that are all integers, for example - and just a place to shake out some community standards with Desmos staff guidance might be really cool, and make it easier for less code savvy creative types to make some powerful learning experiences.

I’d be interested in seeing how you organized it. I think I had seen mention of Desmos Fellows being tasked with creating that kind of document, but they might have meant the “try this” code in the documentation page.

The fellows created the CL bank of wonders a while back and the bank was transferred into the examples category of this site. The code snippets haven’t been updated with current tech so watch out for methods that may be outdated.

Want to update an example or share one of your own? Send me a message or post to the examples category.

Here’s a link to my stuff for what its worth.

Code Snippets

1 Like

Particularly for more involved code. I just made an activity as a template. Here’s one I did with different slides for different functions. I haven’t quite gotten in the habit of it yet, but I should be making a copy of it to edit when I want to make a new activity. Then, I can just duplicate template slides for each I want to create, and delete the template slides when I’m done. I’m updating them as I make improvements. (Note: I don’t think I’ve quite got the Venn Diagram working correctly)

I like your activity. I couldn’t get the venn diagram to work either - what was the objective?

Can you drag slides between activities?

The venn diagram was just a framework. The idea was you could use the points as the centers of images, or build polygons with the point as the anchor. You would set the correct circles for the point for it to auto-check, but some of the checking equations aren’t working.

I don’t think there’s a way to drag or copy/paste slides. You can only duplicate within an activity.

Venn Diagram is working, but you have to look at A_K to see where the points are supposed to go.