-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
2,294 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,3 +54,5 @@ harness/var/goleveldb_data/LOCK | |
|
||
harness/var/goleveldb_data/LOG | ||
|
||
|
||
*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"github.com/nats-io/nats-streaming-server/server" | ||
"github.com/nsip/nias2/naprr" | ||
"log" | ||
"net" | ||
"os" | ||
// "os/exec" | ||
// "os/signal" | ||
// "runtime" | ||
// "time" | ||
) | ||
|
||
var rewrite = flag.Bool("rewrite", false, "rewrite regenerates all reports without re-loading data") | ||
|
||
func main() { | ||
|
||
flag.Parse() | ||
|
||
wd, _ := os.Getwd() | ||
log.Println("working directory:", wd) | ||
|
||
if !*rewrite { | ||
log.Println("removing old files...") | ||
clearNSSWorkingDirectory() | ||
} | ||
|
||
log.Println("Launching stream server...") | ||
ss := launchNatsStreamingServer() | ||
defer ss.Shutdown() | ||
|
||
if !*rewrite { | ||
log.Println("Starting data ingest...") | ||
|
||
di := naprr.NewDataIngest() | ||
di.Run() | ||
|
||
log.Println("Generating report data...") | ||
rb := naprr.NewReportBuilder() | ||
rb.Run() | ||
} | ||
|
||
log.Println("Writing report files...") | ||
rw := naprr.NewReportWriter() | ||
rw.Run() | ||
|
||
log.Println("Done.") | ||
|
||
// runtime.Goexit() | ||
} | ||
|
||
func clearNSSWorkingDirectory() { | ||
|
||
// remove existing logs and recreate the directory | ||
err := os.RemoveAll("nss") | ||
err = os.Mkdir("nss", os.ModePerm) | ||
if err != nil { | ||
log.Println("Error trying to remove nss working directory") | ||
} | ||
} | ||
|
||
func launchNatsStreamingServer() *server.StanServer { | ||
|
||
stanOpts := server.GetDefaultOptions() | ||
|
||
stanOpts.ID = "nap-rr" | ||
stanOpts.MaxChannels = 30000 | ||
stanOpts.MaxMsgs = 2000000 | ||
stanOpts.MaxBytes = 0 //unlimited | ||
stanOpts.MaxSubscriptions = 10000 | ||
|
||
stanOpts.StoreType = "FILE" | ||
stanOpts.FilestoreDir = "nss" | ||
// stanOpts.Debug = true | ||
|
||
ss := server.RunServerWithOpts(stanOpts, nil) | ||
|
||
return ss | ||
|
||
} | ||
|
||
// getAvailPort asks the OS for an unused port. | ||
// There's a race here, where the port could be grabbed by someone else | ||
// before the caller gets to Listen on it, but in practice such races | ||
// are rare. Uses net.Listen("tcp", ":0") to determine a free port, then | ||
// releases it back to the OS with Listener.Close(). | ||
func getAvailPort() int { | ||
l, _ := net.Listen("tcp", ":0") | ||
r := l.Addr() | ||
l.Close() | ||
return r.(*net.TCPAddr).Port | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{- "Test Name"}}, | ||
{{- "Test Type"}}, | ||
{{- "Test Level"}}, | ||
{{- "Domain"}}, | ||
{{- "Item ID"}}, | ||
{{- "Item Subdomain"}}, | ||
{{- "Item Max. Score"}}, | ||
{{- "Item Correct Ans."}}, | ||
{{- "Item Descriptor"}}, | ||
{{- "Item Examplar Link"}}, | ||
{{- "Item Difficulty"}}, | ||
{{- "Item Type"}}, | ||
{{- "Item Weight"}}, | ||
{{- "Item Marking Type"}}, | ||
{{- "Item loc. in Testlet"}}, | ||
{{- "Testlet Node"}}, | ||
{{- "Testlet loc. in Test"}}, | ||
{{- "Testlet Name"}}, | ||
{{- "Testlet ID"}}, | ||
{{- "Testlet Max. Score"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{ printf "\"%s\"" .Test.TestContent.TestName}}, | ||
{{- .Test.TestContent.TestType}}, | ||
{{- .Test.TestContent.TestLevel}}, | ||
{{- .Test.TestContent.TestDomain}}, | ||
{{- .Item.TestItemContent.NAPTestItemLocalId}}, | ||
{{- .Item.TestItemContent.Subdomain}}, | ||
{{- .Item.TestItemContent.MaximumScore}}, | ||
{{- .Item.TestItemContent.CorrectAnswer}}, | ||
{{- .Item.TestItemContent.ItemDescriptor}}, | ||
{{- .Item.TestItemContent.ExemplarURL}}, | ||
{{- .Item.TestItemContent.ItemDifficulty}}, | ||
{{- .Item.TestItemContent.ItemType}}, | ||
{{- "Item Weight"}}, | ||
{{- .Item.TestItemContent.MarkingType}}, | ||
{{- .GetItemLocationInTestlet .Item.ItemID}}, | ||
{{- .Testlet.TestletContent.Node}}, | ||
{{- .Testlet.TestletContent.LocationInStage}}, | ||
{{- .Testlet.TestletContent.TestletName}}, | ||
{{- .Testlet.TestletContent.LocalId}}, | ||
{{- .Testlet.TestletContent.TestletMaximumScore}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{{- "Test Name"}}, | ||
{{- "Test Type"}}, | ||
{{- "Test Level"}}, | ||
{{- "Domain"}}, | ||
{{- "Item ID"}}, | ||
{{- "Item Subdomain"}}, | ||
{{- "Item Max. Score"}}, | ||
{{- "Item Correct Ans."}}, | ||
{{- "Item Descriptor"}}, | ||
{{- "Item Examplar Link"}}, | ||
{{- "Item Difficulty"}}, | ||
{{- "Item Type"}}, | ||
{{- "Item Weight"}}, | ||
{{- "Item Marking Type"}}, | ||
{{- "Item loc. in Testlet"}}, | ||
{{- "Testlet Node"}}, | ||
{{- "Testlet loc. in Test"}}, | ||
{{- "Testlet Name"}}, | ||
{{- "Testlet ID"}}, | ||
{{- "Testlet Max. Score"}}, | ||
{{- "Genre"}}, | ||
{{- "Stimulus"}}, | ||
{{- "Descriptor"}}, | ||
{{- "Audience Descriptor"}}, | ||
{{- "Audience Max"}}, | ||
{{- "Ch./Sett. Descriptor"}}, | ||
{{- "Ch./Sett. Max"}}, | ||
{{- "Cohesion Descriptor"}}, | ||
{{- "Cohesion Max"}}, | ||
{{- "Ideas Descriptor"}}, | ||
{{- "Ideas Max"}}, | ||
{{- "Para. Descriptor"}}, | ||
{{- "Para. Max"}}, | ||
{{- "Persuasive Devices Descriptor"}}, | ||
{{- "Persuasive Devices Max"}}, | ||
{{- "Punctuation Descriptor"}}, | ||
{{- "Punctuation Max"}}, | ||
{{- "Sentence Structure Descriptor"}}, | ||
{{- "Sentence Structure Max"}}, | ||
{{- "Spelling Descriptor"}}, | ||
{{- "Spelling Max"}}, | ||
{{- "Text Structure Descriptor"}}, | ||
{{- "Text Structure Max"}}, | ||
{{- "Vocabulary Descriptor"}}, | ||
{{- "Vocabulary Max"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{{ printf "\"%s\"" .Test.TestContent.TestName}}, | ||
{{- .Test.TestContent.TestType}}, | ||
{{- .Test.TestContent.TestLevel}}, | ||
{{- .Test.TestContent.TestDomain}}, | ||
{{- .Item.TestItemContent.NAPTestItemLocalId}}, | ||
{{- .Item.TestItemContent.Subdomain}}, | ||
{{- .Item.TestItemContent.MaximumScore}}, | ||
{{- .Item.TestItemContent.CorrectAnswer}}, | ||
{{- .Item.TestItemContent.ItemDescriptor}}, | ||
{{- .Item.TestItemContent.ExemplarURL}}, | ||
{{- .Item.TestItemContent.ItemDifficulty}}, | ||
{{- .Item.TestItemContent.ItemType}}, | ||
{{- "Item Weight"}}, | ||
{{- .Item.TestItemContent.MarkingType}}, | ||
{{- .GetItemLocationInTestlet .Item.ItemID}}, | ||
{{- .Testlet.TestletContent.Node}}, | ||
{{- .Testlet.TestletContent.LocationInStage}}, | ||
{{- .Testlet.TestletContent.TestletName}}, | ||
{{- .Testlet.TestletContent.LocalId}}, | ||
{{- .Testlet.TestletContent.TestletMaximumScore}}, | ||
{{- .Item.TestItemContent.WritingGenre}}, | ||
{{- "Writing Stimulus"}}, | ||
{{- "Text Descriptor"}}, | ||
{{- .GetWritingRubricDescriptor "Audience"}}, | ||
{{- .GetWritingRubricMax "Audience"}}, | ||
{{- .GetWritingRubricDescriptor "Character and Setting"}}, | ||
{{- .GetWritingRubricMax "Character and Setting"}}, | ||
{{- .GetWritingRubricDescriptor "Cohesion"}}, | ||
{{- .GetWritingRubricMax "Cohesion"}}, | ||
{{- .GetWritingRubricDescriptor "Ideas"}}, | ||
{{- .GetWritingRubricMax "Ideas"}}, | ||
{{- .GetWritingRubricDescriptor "Paragraphing"}}, | ||
{{- .GetWritingRubricMax "Paragraphing"}}, | ||
{{- .GetWritingRubricDescriptor "Persuasive Devices"}}, | ||
{{- .GetWritingRubricMax "Persuasive Devices"}}, | ||
{{- .GetWritingRubricDescriptor "Punctuation"}}, | ||
{{- .GetWritingRubricMax "Punctuation"}}, | ||
{{- .GetWritingRubricDescriptor "Sentence Structure"}}, | ||
{{- .GetWritingRubricMax "Sentence Structure"}}, | ||
{{- .GetWritingRubricDescriptor "Spelling"}}, | ||
{{- .GetWritingRubricMax "Spelling"}}, | ||
{{- .GetWritingRubricDescriptor "Text Structure"}}, | ||
{{- .GetWritingRubricMax "Text Structure"}}, | ||
{{- .GetWritingRubricDescriptor "Vocabulary"}}, | ||
{{- .GetWritingRubricMax "Vocabulary"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{- "Test Name"}}, | ||
{{- "PSI"}}, | ||
{{- "Scaled Score Value"}}, | ||
{{- "Raw Score"}}, | ||
{{- "Scaled Score Stnadard Error"}}, | ||
{{- "Student Domain Band"}}, | ||
{{- "Student Proficiency"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{ printf "\"%s\"" .Test.TestContent.TestName}}, | ||
{{- .Response.PSI}}, | ||
{{- .Response.DomainScore.ScaledScoreValue}}, | ||
{{- .Response.DomainScore.RawScore}}, | ||
{{- .Response.DomainScore.ScaledScoreStandardError}}, | ||
{{- .Response.DomainScore.StudentDomainBand}}, | ||
{{- .Response.DomainScore.StudentProficiency}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{{- "DOB"}}, | ||
{{- "Sex"}}, | ||
{{- "Ind. Status"}}, | ||
{{- "LBOTE"}}, | ||
{{- "YearLevel"}}, | ||
{{- "ASL School ID"}}, | ||
{{- "HomeSchooled"}}, | ||
{{- "Parent1 School Education"}}, | ||
{{- "Parent1 NonSchool Education"}}, | ||
{{- "Parent 1 Occupation"}}, | ||
{{- "Parent2 School Education"}}, | ||
{{- "Parent2 NonSchool Education"}}, | ||
{{- "Parent2Occupation"}}, | ||
{{- "PlatformID"}}, | ||
{{- "School Name"}}, | ||
{{- "School Postcode"}}, | ||
{{- "School State"}}, | ||
{{- "School Suburb"}}, | ||
{{- "School Geolocation"}}, | ||
{{- "SchoolSector"}}, | ||
{{- "Writing"}}, | ||
{{- "Reading"}}, | ||
{{- "Spelling"}}, | ||
{{- "Grammar and Punctuation"}}, | ||
{{- "Numeracy"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{{ .Student.BirthDate}}, | ||
{{- .Student.Sex}}, | ||
{{- .Student.IndigenousStatus}}, | ||
{{- .Student.LBOTE}}, | ||
{{- .Student.YearLevel}}, | ||
{{- .Student.ASLSchoolId}}, | ||
{{- .Student.HomeSchooledStudent}}, | ||
{{- .Student.Parent1SchoolEducation}}, | ||
{{- .Student.Parent1NonSchoolEducation}}, | ||
{{- .Student.Parent1Occupation}}, | ||
{{- .Student.Parent2SchoolEducation}}, | ||
{{- .Student.Parent2NonSchoolEducation}}, | ||
{{- .Student.Parent2Occupation}}, | ||
{{- .Student.GetOtherId "NAPPlatformStudentId"}}, | ||
{{- printf "\"%s\"" .School.SchoolName}}, | ||
{{- with $sci := index .School.SchoolContactList.SchoolContact 0 }} | ||
{{- $sci.ContactInfo.Address.PostalCode}}, | ||
{{- $sci.ContactInfo.Address.StateProvince}}, | ||
{{- $sci.ContactInfo.Address.City}}, | ||
{{- end}} | ||
{{- .School.SchoolGeographicLocation}}, | ||
{{- .School.SchoolSector}}, | ||
{{- index .Summary "Writing"}}, | ||
{{- index .Summary "Reading"}}, | ||
{{- index .Summary "Spelling"}}, | ||
{{- index .Summary "Grammar and Punctuation"}}, | ||
{{- index .Summary "Numeracy"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{- "Test Name"}}, | ||
{{- "ASL School ID"}}, | ||
{{- "Domain National Average"}}, | ||
{{- "Domain School Average"}}, | ||
{{- "Domain Jurisdiction Average"}}, | ||
{{- "Domain Top National 60%"}}, | ||
{{- "Domain Bottom National 60%"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{ printf "\"%s\"" .Test.TestContent.TestName}}, | ||
{{- .Summ.SchoolACARAId}}, | ||
{{- .Summ.DomainNationalAverage}}, | ||
{{- .Summ.DomainSchoolAverage}}, | ||
{{- .Summ.DomainJurisdictionAverage}}, | ||
{{- .Summ.DomainTopNational60Percent}}, | ||
{{- .Summ.DomainBottomNational60Percent}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
package main | ||
|
||
import ( | ||
"github.com/nsip/nias2/lib" | ||
"github.com/nsip/nias2/napval" | ||
"log" | ||
"runtime" | ||
|
Oops, something went wrong.