For each of the tables, you will be working with test cases. If you'd like to add more test case columns for your input, click on the New Column button at the top left corner of the table
If you'd like to delete a test case column that you don't need, hover over the area to the right of your test case and a delete button will show
If you'd like to place tables at specific locations on your page, make a div at that location, with a class depending on what table you want. You'll see an example for each table below:
<div class = 'JUnitTable1'></div>
<div class = 'JUnitTable1Prod'></div>
<div class = 'JUnitTable2'></div>
By default, we provide you with a find function and give functionlity to all the tables by allowing them to check if certain specs meet the requirements for this function
However, you can use your own functions as well if you would like. If you'd like to change the function being used in the tables, navigate to the AllData_Find.js file and open it up in your text editor.
You'll see that it's been named after the function we used in our demo. When changing the data in this file, make sure to make a copy of this file, but name it after the file you are using
The next thing to look for is the numTestCases variable. This defines how many columns we initially give the user. The user can always add or delete columns, but if you'd like to change the default amount, simply change the number
Next you'll see a variable header. This variable represents what you see at the very top of the demo page: The function name, code for the function, and then a short description for the user.
If you change the values, make sure they are contained within quotes.
Change the value of the title key to change the main title of the page.
For the code key, the value is the code that we will show to the user for the function you will write. Write your code as usual, but for formatting, instead of pressing return for a new line, type \n. All your code should be on one line for this value
Finally, for explanation, the value is the short description that you will be giving to the user. Assume that the entire value will eventually be wrapped in <p></p> tags. Write the html for your description. If you don't know html or would rather not use it, feel free to just type your text, with a \n wherever you want a new line.
The next value you see the allRows array. This array contains information about the partitions for your table.
The first value of this array should always be "ph", as you can see above. Don't change this value.
The values you do want to worry about are the associative arrays that follow.
Each associative array contains 4 key-value pairs:
Next is the impossibleCases array. This array contains other arrays, that represent cases that are impossible in product mode.
To create an array within impossibleCases that represents an impossible combination of partitions:
After impossibleCases, you'll see a variable functionName. As you might have guessed, this is simply the name of your function. We need this input for display purposes in the tables.
Next is the variable inputs. Inputs is an array containing associative arrays with data about what the inputs of your function should be.
The first value is always "ph". DO NOT CHANGE THIS VALUE
Within each associative array, you can have 3-4 values:
Next is the array code. Code contains an array of associative arrays with data for the code review table. Including the actual code displayed to the user, and whether or not that code is a good implementation
Each associative array contains 3 key-value pairs:
goodFunction is simply a version of the code that you typed above that you think is the best, one that other codes should be compared to.
The value is the js value from the code variable of the code you think is best
Make sure you save the file you made with a new name corresponding to the function you are using in your tables. Then in the html for your project, reference your new file with a script tag.