As a long time user of Hapara Teacher Dashboard, I thought I should document how you can update classes on a daily basis from Captia SIMS - the most common MIS in the UK and the one we use.
Step 1 - Generate a suitable students report (same one I use for syncing Google Classroom - see another blog post...)
Step 2 - Set this report to run on a schedule and output to a network share on a Virtual machine that is online all the time. You do this with the "commandreporter" on your SIMS server. An example command that lives in a batch file that runs as a scheduled task (the username and password is a SIMS user with sufficient privileges to run the report):
"C:\Program Files\SIMS\SIMS .net\commandreporter" /user:USERNAME /password:PASSWORD /report:"haparastudents" /OUTPUT:\\Win10man\gam\hapara\hapara.csv /QUIET
Step 3 - Write a script to reformat the csv file to an acceptable Hapara format. So key things:
Convert "/"'s into "-" as you cannot have "/"'s in group names.
Remove "CLS " in tutor groups.
Remove any funny classes you don't want.
The way I do this is to call a sequence of vbs scripts in one main batch file, create some tempory files and then delete the temp files. To replace a certain string with another the basic script is:
Set objFS = CreateObject("Scripting.FileSystemObject")
strFile = "c:\GAM\hapara\hapara.csv"
Set objFile = objFS.OpenTextFile(strFile)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
If InStr(strLine,"/")> 0 Then
strLine = Replace(strLine,"/","-")
End If
WScript.Echo strLine
Loop
This one replaces all the "/"'s with "-"'s.
We have a load of classes that have an ":" in the name and are timetable items for individual students so don't need a class creating. I remove them using the following command:
findstr /v ":" students4 > students.csv
The whole lot can be put into one batch script and run as a scheduled task.
cscript /nologo myreplace.vbs > students
cscript /nologo myreplace2.vbs > students1
cscript /nologo myreplace3.vbs > students2
cscript /nologo myreplace4.vbs > students3
cscript /nologo myreplace5.vbs > students4
del students.csv
findstr /v ":" students4 > students.csv
del students
del students1
del students2
del students3
del students4
curl -F "passkey=YOURDOMAINKEY" -F "uploadFile=@C:\GAM\hapara\students.csv" https://td-setup.appspot.com/YOURDOMAIN/csvupload
The five vbs scripts at the start replace one string with another. The all the classes with ":" are removed. Then the temporary files are removed. The final command uploads the file to Teacher Dashboard using Curl. Curl is an open source tool to upload data to external sites via https. Hapara provides the domainkey for you.
That's it. Once setup, this will run on whatever schedule you set until you stop it. I sync students every day now. My next blog post will describe how you can sync SIMS to Google Classroom using scheduled SIMS reports and the GAM commandline tool.
Step 1 - Generate a suitable students report (same one I use for syncing Google Classroom - see another blog post...)
Step 2 - Set this report to run on a schedule and output to a network share on a Virtual machine that is online all the time. You do this with the "commandreporter" on your SIMS server. An example command that lives in a batch file that runs as a scheduled task (the username and password is a SIMS user with sufficient privileges to run the report):
"C:\Program Files\SIMS\SIMS .net\commandreporter" /user:USERNAME /password:PASSWORD /report:"haparastudents" /OUTPUT:\\Win10man\gam\hapara\hapara.csv /QUIET
Step 3 - Write a script to reformat the csv file to an acceptable Hapara format. So key things:
Convert "/"'s into "-" as you cannot have "/"'s in group names.
Remove "CLS " in tutor groups.
Remove any funny classes you don't want.
The way I do this is to call a sequence of vbs scripts in one main batch file, create some tempory files and then delete the temp files. To replace a certain string with another the basic script is:
Set objFS = CreateObject("Scripting.FileSystemObject")
strFile = "c:\GAM\hapara\hapara.csv"
Set objFile = objFS.OpenTextFile(strFile)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
If InStr(strLine,"/")> 0 Then
strLine = Replace(strLine,"/","-")
End If
WScript.Echo strLine
Loop
This one replaces all the "/"'s with "-"'s.
We have a load of classes that have an ":" in the name and are timetable items for individual students so don't need a class creating. I remove them using the following command:
findstr /v ":" students4 > students.csv
The whole lot can be put into one batch script and run as a scheduled task.
cscript /nologo myreplace.vbs > students
cscript /nologo myreplace2.vbs > students1
cscript /nologo myreplace3.vbs > students2
cscript /nologo myreplace4.vbs > students3
cscript /nologo myreplace5.vbs > students4
del students.csv
findstr /v ":" students4 > students.csv
del students
del students1
del students2
del students3
del students4
curl -F "passkey=YOURDOMAINKEY" -F "uploadFile=@C:\GAM\hapara\students.csv" https://td-setup.appspot.com/YOURDOMAIN/csvupload
The five vbs scripts at the start replace one string with another. The all the classes with ":" are removed. Then the temporary files are removed. The final command uploads the file to Teacher Dashboard using Curl. Curl is an open source tool to upload data to external sites via https. Hapara provides the domainkey for you.
That's it. Once setup, this will run on whatever schedule you set until you stop it. I sync students every day now. My next blog post will describe how you can sync SIMS to Google Classroom using scheduled SIMS reports and the GAM commandline tool.
Comments
Post a Comment