Canvas Formula Question App

Hi!
I use Canvas on a regular basis, all our classes are maintained via Canvas at my University. Making quizzes and question banks are a pain. There is a special type of question call a “formula question” that I use a lot. The quiz maker types in the inputs, then an equation based on those inputs. Then you generate a set of random inputs, and Canvas will generate multiple solutions based on your equation. The idea is good but it is horrible to use. So I wrote a macro in Excel that uses Precedents and Dependents to create a formula from a bunch of equations in a spreadsheet. It works great, in fact I have to send the macro to instructors everywhere, so I wrote a new program using Python to manipulate Google Sheets. It was ever harder to write because Google Sheets doesn’t have Precedents or Dependents, thank God for Python!
So now, how to make it so everyone who needs it can use it via the web? I’m no web programmer but this is what I want to do:
-create an anvil app that will let any user log in to Google
-open their spreadsheet
-user must select a cell in the spreadsheet (must contain formula), then run my Python code to generate the equation
-save all question information to a Canvas file
But I’ll need all sorts of packages like gspread, auth2client, regex and others. Do you think this is possible in Anvil (free version)?

Thanks

Hello and welcome,

I think almost anything is possible in Anvil, especially if you inject a little creative thinking along the way.

I would suggest splitting your problem up into smaller “sub problems” and then consulting the forum and documentation for each until you build up the full application.

Based on what you have written I would suggest reading the docs on the following:

…and definitely go through some of the introductory tutorials as they cover key functionality that will likely be valuable to you.

Good luck with your development!

1 Like

Thanks for posting @sprince! I’m an educator myself, and while we use Moodle, this type of question is common in our LMS as well. We would be very interested in using this app, and I’m happy to help along the way.

As @alcampopiano recommended, it is a good idea to break it up into smaller pieces. Once you get started if you run into issues please post and I’m sure we will be able to help.

One recommendation I would have for now is to get code working locally with the available packages in Anvil. Then port your solution over to the web app. The actual spreadsheet manipulation will be hard to iteratively code using only the Anvil IDE.

1 Like

Thanks for the positive feedback with regards to the Canvas Formula Question app, I can’t insert more than one image but I will tell you I got the main equation calculator working, not as easy as in Excel but still possible. In the image below you can see a google sheet with some inputs, and a bunch of linked equations. The blue cell has the desired linked formula, and the read cell is the result from the explicit equation. They yield the same number, so it works, at least for this equation. Now I’ll test various functions that are allowed in Canvas.

More to come as I progress…

image

BTW this is what the app looks like so far, the user inputs the sheet name and the row/column of the desired formula, and returned are the test equation and the Canvas equation with input variable names, now I need to allow users to select their own google sheet for testing.

On to the Google drive part, I read the doc and was able to link anvil to google drive in the UNVERIFIED mode, good enough for now. I can also get all files and print the names, but has anyone:
–Used the file loader to show the files on the google drive? I don’t see any way to use the file loader to show files, other than those on your computer.