The Challenges System - GlimmerLabs/MathOverImages GitHub Wiki
The Challenges System
- This page is intended to gather thoughts and design issues for the Challenges subsystem of the MIST Web site.
Basic Issues
There are (at least) two dimensions along which we can think about arranging or categorizing the challenges
- First, we can think about the type of challenge. Is it a simple still greyscale image, a color image, an animated image, etc?
- We should decide upon these categories early, but be prepared to update.
- But we should also consider the author of the challenge.
- The system/standard/primer challenges are the ones that we've come up with to help people learn MIST. These should be presented in a fixed order.
- The user-created challenges are ones that users have created. These might be presented in the same orders as the galleries (although within the other kind of category): Most recent, most popular, random.
- Some user-created challenges might be promoted to standard challenges.
Tables
Given the design discussion above, it seems we will need a variety of tables.
Challenge Category
categoryID - number, unique, primary key
categoryName - string
For example, we might have an id of 1 for "Basic, Static, Greyscale" and 2 for "Intermediate, Static, Greyscale". (Hmmm ... will we always have triplets? In that case, we might have three things for the category: complexity (basic, intermediate, advanced), interactivity (static, animated, interactive, interactive and animated), color (greyscale, rgb, hsv).
Challenge
challengeID - number, unique, primary key
categoryID - number, references category table
order - number (used primarily for ordering within the standard challenges)
userID - number, references user table (using the admin id means that it's a standard challenge)
created - date
modified - date
name - string
description - longer string
code - string
rating - number (or are ratings stored elsewhere?)
anything else you think is relevant
E.g. (1,1,3,0,[now],[now],'Basic Circle','Circles are simple shapes that we see everywhere. But how do we create one in MIST? See if you can figure it out.','sign(wsum(multiply(x,x),multiply(y,y)))',0)
Challenge Completion
userID - number, references user table [the user who completed the challenge]
challengeID - number, references challenge table
Challenge Likes/Ratings
Similar to the image likes/ratings
Challenge Comments
Similar to the image comments. (We'll start without comments, however.)
Pages
- A typical challenge page shows the challenge (an image), its description, its author, whether or not the user has completed it, its rating, and so on and so forth. There should also be a space for entering a solution.
- A create challenge page lets you enter all of that information.
- A list of challenges page or pages.
- I expect that the design will be similar to that of the Help page
- As suggested above, since we have multiple categories, we might have multiple pages
- I'd suggest two level navigation. The top-level challenges page lists the types of challenges and links to the lists within a particular type.
Checking solutions
How do we know if someone's solution for a static image is acceptable?
Exact match: Generate the JPG or PNG data for both the original and the proposed solution. Compare them. If they are the same, it's an exact match, or close enough.
Approximate match, v1: Render both in a 20x20 canvas. Compare all of the pixels in those two canvases. (Comparing 400 pixels is pretty quick.) When comparing pixels, you might allow some difference (e.g., abs(pixel0-pixel1) < .01) and you might allow some pixels to differ (e.g., 90% match is good enough). Both of those parameters should be tunable.
Approximate match, v2: Render both in a 400x400 canvas. Randomly select 400 or so points and compare them as in the previous version.
What about animated images?
We can treat animated images as a sequence of static images, using the renderAt
(or whatever it's called) method to make sure that they render at the same time.
Tasks
Here's an approximate order.
- Make the list of challenge categories.
- Make the challenge category table.
- Populate the challenge category table with a few simple categories.
- Make the challenge table.
- Make the create challenge page.
- It would be nice if the field for "order" shows up for the admin, but not the normal user. However, that can wait until later.
- Create a few simple standard challenges. (E.g., the circle.)
- Make the display challenge page. In this case, don't worry about the bells and whistles (ratings, comments, confirmation of success, completed/not completed, etc.)
- Make the pages that list challenges.
- Add ratings system.
- Add completion system.
In parallel, you might have Daniel (or someone) write the "do they match" algorithm.
Questions
- Do we include a hints system?