Created by Joseph Kopecky with the help of Aayush Koora.
- Download a release from Github (this should include a jar file and a json file)
- Place those two files in a folder on your computer
- I recommend this be in the
C:Users/YOURNAME/Documents/MathMindsOutput
folder for ease of use
- I recommend this be in the
- Make sure you have a compatible version of the Java Runtime Environment installed.
- Builds were probably made with JRE 18, so you should be good to use that.
- Run the jar file
- If running in the file explorer does not work, use the command line.
- First, navigate to the directory that the jar and json files are in.
- For me, this is done with
cd Documents/MathMindsOutput
, because my command line defaults to putting me in theUsers/Jmkop
directory.
- For me, this is done with
- Then, run the following command:
java -jar MathMindsTestGen.jar
- Magic.
- In the text box, input the name of the test you wish to generate.
- Click the generate button.
- Check in the
C:Users/YOURNAME/Documents/MathMindsOutput
folder for the pdf file. - Rinse and repeat.
- The question templates are managed primarily within the JSON file.
- However, when you add a new template or otherwise change the fields or calculation for an existing template, the Java code must also be modified.
- If you are creating a new template, you must create a new method in the TemplateSolvers java class.
- The following is an example of the requisite code:
public static double placeholderSolve(HashMap<String, Double> fields) {
System.out.println("placeholdersolve running");
//fields: "_int:1-5_", "_int:6-10_"
return fields.get("_int:1-5_") + fields.get("_int:6-10_");
}
- The non-name parts of the method signature
public static double
and(HashMap<String, Double> fields)
should be the same. - The name of the method MUST match exactly the
keymethod
field in the JSON file. - The
return
line is where you can calculate and return the result of that question. - Use
fields.get("fieldcode")
to retrieve the value of a field from the problem.fieldcode
should match exactly that which is contained in the JSON file.- It should also be in the format of
_int:lower-upper_
or_double:lower-upper
, with lower being the lowest possible value for that field and upper being the greatest possible value.
- The
System.out.println();
line is optional but good for debugging. If you are using it, change 'placeholdersolve' to the name of the method.
- If you change either the JSON file or the java code, you absolutely MUST update the repository with your changes. Please!
- Additionally, you should create a new release on the repository containing the new JSON file as well as a .jar build of the code.
- If you need a tutorial on building a .jar file from a project, either use Google (if you are at all planning a career in software development you better get used to it) or contact someone in the club. A contact option is the developer of this code (Joseph Kopecky) at [email protected], in the Instagram group chat, or in person.
- There are no guarantees made that Joseph will be able to render aid. JUST USE GOOGLE SERIOUSLY IT'S NOT THAT HARD.
- Any complaints about the quality of this code can be left at the door.
- The entirety of the app UI is contained within the
AppInterface
class. If you are intending to improve the UI, that's where you should be. - The
TemplateSolvers
class is strictly for the solver methods that are used byQuestion
objects. - The
TemplateQuestion
class is a utility for storing and accessing information parsed from the JSON file. - The
TestContainer
class is yet another utility for containing test titles and an ArrayList ofQuestion
objects. - The
CreateOutput
class contains methods used to process aTestContainer
object..string()
outputs theTestContainer
information in a string, probably only useful for debugging..pdf()
generates a pdf document from theTestContainer
.- This processes a string of HTML, generated by the
.html()
method.
- This processes a string of HTML, generated by the