Skip to content

Commit

Permalink
Output of Yr3W status to text file
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Apr 27, 2017
1 parent 59071a6 commit 38425c0
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 6 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ In Windows, `gonias.bat` launches the required processes for an examination year

The web interface to the validator can be accessed at `http://localhost:1325` by default; you can configure the Web Server Port in `nias.toml`

## Running NAPlan Results & Reporting modules

Separate executables are run to process NAPLAN Results and Reporting processing; see [NAPRR readme](./naprr/README.md)

# Code Structure

NIAS2 relies on the following infrastructure:
Expand Down
17 changes: 16 additions & 1 deletion naprr/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
The naprr executable runs as a single binary, and launches its own streaming server instance within the application.
# NAPLAN Result and Reporting code

## NAPLAN Results and Reporting processing

The `naprr` executable runs as a single binary, and launches its own streaming server instance within the application.

The unzipped binary files should have the `naprr` executable, an `/in` directory and a `/templates` directory. The `/templates` directory contains templates for the various report formats, in [Golang's template language](https://golang.org/pkg/text/template/). The `/in` directory contains zipped XML files to be processed by the `naprr` executable; the zip distribution comes packaged with `/in/master_nap.xml.zip` as a test xml results file. This will get processed automatically when the executable is run.

Expand All @@ -22,3 +26,14 @@ All reports have been generated as requested, except for `codeframe_writing.csv`
To test the reporting engine only, as opposed to data parsing, delete the `/out` directory then run the `naprr` executable with the flag `-rewrite`. This will simply regenerate the reports without reloading the data.

Report formats are all governed by templates so they can be modified, but will be better once a UI is in place.

## NAPLAN Year 3 Writing preprocessing code

The `napyr3w` executable runs as a single binary. It processes both Pearson format and FujiXerox format files for Year 3 Writing results, and converts them into SIF/XML files consistent with those received from the NAPLAN Online Assessment Platform.

* Any Pearson format files are expected to be in the `in/Pearson` directory, as fixed format txt files.
* Any FujiXerox format files are expected to be in the `in/FujiXerox` directory, as csv format files.
* The program generates a report of which students are matched between the Pearson or FujiXerox files, and any XML files received from the platform. For that reason, the `/in` directory is still expected to contain a zipped XML file of results.

* The SIF/XML output is generated to the file `yr3w/codeframe_writing.xml`. This includes a dummy Year 3 Writing codeframe, to which test results are attached.
* A report of matches and mismatches between the students in the Pearson/FujiXerox files and the SIF/XML results file is generated to the file `yr3w/codeframe_report.txt`.
29 changes: 24 additions & 5 deletions naprr/streamreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ package naprr

import (
"encoding/gob"
"fmt"
"github.com/nats-io/go-nats-streaming"
"github.com/nsip/nias2/lib"
"github.com/nsip/nias2/xml"
"log"
"os"
)

type StreamReader struct {
Expand Down Expand Up @@ -489,11 +491,28 @@ func (sr *StreamReader) remapStudents(srd *StudentAndResultsData, student_ids ma
yr3wmatches.Matches = append(yr3wmatches.Matches, k)
}
log.Printf("%v\n", yr3wmatches)
payload, err := sr.ge.Encode(yr3wmatches)
if err != nil {
log.Println("unable to encode yr 3 writing status report: ", err)
}
sr.sc.Publish(REPORTS_YR3W_STATUS, payload)
/*
payload, err := sr.ge.Encode(yr3wmatches)
if err != nil {
log.Println("unable to encode yr 3 writing status report: ", err)
}
*/
//sr.sc.Publish(REPORTS_YR3W_STATUS, payload)
// create directory for the school
fpath := "yr3w/"
err := os.MkdirAll(fpath, os.ModePerm)
check(err)

// create the report data file in the output directory
// delete any ecisting files and create empty new one
fname := fpath + "codeframe_report.txt"
err = os.RemoveAll(fname)
f, err := os.Create(fname)
check(err)
defer f.Close()
payload := fmt.Sprintf("Matches: %v\nYr3W only: %v\nXML only: %v\n",
yr3wmatches.Matches, yr3wmatches.Yr3w_mismatches, yr3wmatches.Xml_mismatches)
f.WriteString(payload)

srd.Students = newStudents
return srd
Expand Down

0 comments on commit 38425c0

Please sign in to comment.