This morning I found that there was a bug with yesterday’s work. In
conversionExercise, if the problem was switched to another and then switched back, grade function would not work properly. This is because I did not use
jsavscore provided by JSAV and used my own because I do not like to guess what functions do. I like to be in control.
Then I implemented this wonderful DFA exercise generator, which takes input of expressions and test cases and spits out a json file that can be used by the conversion exercise I implemented yesterday. This tool is supposed to help instructors create their own exercises. A screenshot is shown below. Instructors are able to add problems, add test cases, and when they finish click get JSON button. A download link will appear for them to download the json file.
download JSON file
I am embarrassed to say that I spent most of the time implementing adding problem and adding test case functions. There are just too many details:
name attribute for radio buttons have to be different so they don’t mess up with each other. I also have to update the indices for problems and test cases etc. I am so happy it is working.
this keyword sucks! Avoid using
this at all costs. Not only does it cause huge errors depending on the context, but it also confuses future developers on the project. I spent so much time reading other people’s code for a long time trying to figure out what
this represents, because often times it is coming from another file, not to mention sometimes it is passed more than once. Naming and commenting are also so important that it can greatly influence the project. If a project is meant to be a coorperative effort, variables and comments have to be satisfying.