toonarmycaptain / dionysus

Student avatar score chart generator
GNU Affero General Public License v3.0
9 stars 13 forks source link

Graph creation logic/dialogue #16

Closed toonarmycaptain closed 5 years ago

toonarmycaptain commented 6 years ago

To create a graph/chart, a classlist/set of avatars*1 and associated scores will need to be assembled with some graph parameters to pass to the (probably matplotlib) image creation code.

The idea is to create essentially a bar graph, with the avatars of students with similar scores stacked on top of eachother. Possibly in Quartiles, Quintiles, or smaller brackets eg 80-85 or 80-89 5 or 10 point brackets)*2: Image from http://www.mathblaster.com/coolmath/articles/reading-bar-graphs So create a graph, iterate over the students/avatars/scores and plot the avatars. Save the image.

Some options with graph titling, axis etc would be nice, but getting a prototype is a priority over sophistication. The initial version probably needs a user selected title (eg classname - title), and could use 0-100 broken down into 10 point blocks as the column size (eg 0-9, 10-19...80-89, 90-100).

Open to suggestions, but possibly a class or a named-tuple with the students/scores and graph parameters might be the way to pass the data around - one one hand to the save logic, on the other to the image generation logic in #17.

Open question whether preprocessing the data into columns eg {col1: [student_a], col2, [student_b, student_c] etc so the columns could be assembled sequentially, or straight iterating over the set and placing the avatars on the columns as one would deal cards would be the better option.

*1 Default to using student name or hash of student name (or even ROT13 cipher to keep it simple in the first version) if no avatar/image is provided for a student. This will definitely be the case until logic to take and process images is in place.

*2 Borrowed from mathblaster.com.

toonarmycaptain commented 5 years ago

From #18: The plan is to store the scores and parameters for each graph in a file within class_data/graph_data, so that a data set can be edited, reused, or a new graph created. The format in which the data is saved is out of the scope of this issue (#16), but might be considered.