Auto Upload Scripts Update

This section has 2 parts… the Core Export & Upload and the Results Export & Upload. Once set up you no longer need to do regular exports from KAMAR to upload into Assay, as it is all done automatically. The only times you’ll need to upload data is to load historical data eg: in Jan to load the final NCEA results from the previous years or when initially setting up.

Note 1: these instructions assume you have your FileMaker Server running on Windows… if you are running your FileMaker server on a different type of server let me know.

Note 2: If you need support with this please email us: [email protected] and we can give you a hand, as it is important you get this set up correctly. KAMAR has said they are happy for us to set this up, but don’t want to provide support for it, so if you need support ask us, not KAMAR.

Note 3: If you are hosting assay3 yourself you will also need to set up the autoprocess script

Note 4: The powershell scripts require the command “Invoke-RestMethod”.
PowerShell 2.0 (server 2008 R2) doesn’t even know what this command is, so will require updating the Powershell to Version 3. If you can’t do that contact me and I can sort out some vbs scripts for you, but these are not as reliable or you will need to download and install Net 4.5 framework (if not already) and Windows management framework  https://www.microsoft.com/en-nz/download/details.aspx?id=34595

Once finished you should end up with a folder that looks like this for Core Files (1 Powershell scipt and assayexport core data):

 

Have 2 new FileMaker schedules:

And 1 new Task Scheduler schedules:

 

Core Export & Upload

The Upload Core script allows KAMAR to do a bulk of the exporting and upload it to assay automatically.

Set-up KAMAR Core Export

Under “Printing” on KAMAR go to “Export” go in and create a search for “All” students (as shown in the screenshot below), but before you press find give it a name on the left (AssaySearch with no spaces works well)

And then copy the list of fields from the Admin -> Upload Data section on Assay, and paste the list of fields (do not look for them manually… just do a copy from assay and a paste into the “Export Order” on KAMAR, but before you press export give it a name on the left (AssayExport with no spaces works well)

Press Export.

 

We then need to set up the script so it exports the results automatically. Go to schedules, and the click on the button in the top right and “Create a Schedule”

  • FileMaker script
  • Select KAMAR_SERVER.fmp12  and  Input Account Name and Password. Please contact [email protected] for the Account Name and Password to use in Core Export Schedule
  • Select the Student Data Export
  • JW,AssaySearch,AssayExport,filewin:/E:/Exports/assayexport.csv

JW is the user – note: this is the teacher code, not the login username (may be different)

AssaySearch is the saved search

AssayExport is the saved export

filewin:/E:/Exports/assayexport.csv is the location

       The time limit should probably be quite long… 120 minutes is not a bad idea.

  • Suggest you run at 5am every day, otherwise it can interfere with KAMAR updating. see screenshot below

The final script settings will look like this:

You can then run the script to make sure it works (can take a bit of time depending on the size of your school) … a school of 1500 takes around 20 minutes depending on server specs. It will show in the scheduler when finished.

Set-up Assay Core Upload

You then can set up the uploadcore.ps1 script.

You should download this from:

https://hosted.assay.co.nz/demo/uploadcore.ps1

You should save this in the same folder as the exports are going to.

If you right click on the file you can click edit.

You will need to edit the 3 lines at the top:

The $Url is the url to your copy of assay plus the “uploadcore2.php”

The $file is the file that you set up to export

The $authentication needs to match your authentication on your copy of assay (Admin -> Config).

Press the run button (green triangle) at the top of the screen to run it to confirm it is working.

It should output something like

Max Size: 256
515593
Uploaded

 

Once you have confirmed it is working you can then set this up as a scheduled task as well using the Windows Task Scheduler (screenshots below for the Results upload if you are unsure of the steps)

Make sure:

On the General Tab give the task a name and set it to run if logged in or not and run with highest privileges

Click OK.

 

On the Triggers tab create a new trigger… set time to 6:25am, Repeat Daily, Stop the task if it runs for more than 1 hour and make sure it is enabled.

Click OK.

 

This should give you a triggers tab that looks like this (time different)

Click OK.

 

On the “Actions” tab create a new action:

In the program/script you want to run Powershell.exe

In  the Add arguments section you want to add

-ExecutionPolicy Bypass E:\Exports\uploadcore.ps1

Click OK.

 

This should give you an “Actions” tab that looks like this:

Click OK.

 

You shouldn’t need to change anything on the conditions tab

Click OK.

 

On the “Settings” tab set the “Stop the task if it runs longer than” to “1 hour” and then press OK. This will prompt you to put in your password so it can run if you are there or not.

Click OK.

 

This will give you tasks that look like this:

 

You have the Auto Process script set up as well (this is done automatically if you are hosting with me)

 

The new Core set-up is optional

Core Auto-uploads 

The new Results set-up is required

Results Auto-uploads