Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Apr 27, 2017
2 parents 38425c0 + 2f9be05 commit c8e3c16
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 26 deletions.
5 changes: 3 additions & 2 deletions app/naprr/naprr.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package main

import (
"flag"
"github.com/nats-io/nats-streaming-server/server"
"github.com/nsip/nias2/naprr"
"log"
"net"
"os"

"github.com/nats-io/nats-streaming-server/server"
"github.com/nsip/nias2/naprr"
// "os/exec"
// "os/signal"
"runtime"
Expand Down
1 change: 1 addition & 0 deletions app/naprr/public/js/naprr.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var participationData = [];
var domainscoresData = [];
var codeframeData = [];
var schoolinfoData = {};
var debug =true;

var currentASLId;

Expand Down
2 changes: 1 addition & 1 deletion app/naprr/public/js/naprr_graphs.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function createScoreSummaryGraph(ssdata)
attributes['Value'] = +ssdata.Summ.DomainBottomNational60Percent;
data.push(attributes);

console.log(data);
// console.log(data);

var orderMeasures = [
'Bottom National 60%',
Expand Down
42 changes: 25 additions & 17 deletions app/naprr/public/js/naprr_schoolinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ function createSchoolInfoReport()

// console.log(schoolinfoData);

var contactInfo = schoolinfoData.SchoolContactList.SchoolContact[0].ContactInfo;

$("#si-header").empty();
$("#si-contact").empty();
$("#si-establishment").empty();
Expand All @@ -43,19 +41,26 @@ function createSchoolInfoReport()
$("#si-header").append("<h5 class=''>" +
schoolinfoData.SchoolName + "</h5>");

$("#si-contact").append("<p>" + contactInfo.Address.Street.Line1 +
", " + contactInfo.Address.City +
", " + contactInfo.Address.StateProvince +
", " + contactInfo.Address.PostalCode +
".</p>");
var contactExists = schoolinfoData.SchoolContactList.SchoolContact !== null ? true : false
if (contactExists)
{
contactInfo = schoolinfoData.SchoolContactList.SchoolContact[0].ContactInfo;
$("#si-contact").append("<p>" + contactInfo.Address.Street.Line1 +
", " + contactInfo.Address.City +
", " + contactInfo.Address.StateProvince +
", " + contactInfo.Address.PostalCode +
".</p>");

$("#si-contact").append("<p>Principal: " + schoolinfoData.PrincipalInfo.ContactName.FullName +
".</p>");
$("#si-contact").append("<p>Principal: " + schoolinfoData.PrincipalInfo.ContactName.FullName +
".</p>");

$("#si-contact").append("<p>Contact: " + contactInfo.Name.FullName + "<br/>" +
"Phone: " + contactInfo.PhoneNumberList.PhoneNumber[0].Number +
" Ext.: " + contactInfo.PhoneNumberList.PhoneNumber[0].Extension +
".</p>");

}

$("#si-contact").append("<p>Contact: " + contactInfo.Name.FullName + "<br/>" +
"Phone: " + contactInfo.PhoneNumberList.PhoneNumber[0].Number +
" Ext.: " + contactInfo.PhoneNumberList.PhoneNumber[0].Extension +
".</p>");

$("#si-establishment").append("<p>ACARA (ASL) Id: " + schoolinfoData.ACARAId + "<br/>" +
"Local Id: " + schoolinfoData.LocalId + "<br/>" +
Expand All @@ -76,10 +81,13 @@ function createSchoolInfoReport()
"LGA: " + schoolinfoData.LocalGovernmentArea + "<br/>" +
"Federal Electorate: " + schoolinfoData.FederalElectorate + "<br/>" +
"Religious Affiliation: " + schoolinfoData.ReligiousAffiliation + "<br/>" +
"Geographic Location: " + schoolinfoData.SchoolGeographicLocation + "<br/>" +
"Grid Location: " + contactInfo.Address.GridLocation.Latitude +
", " + contactInfo.Address.GridLocation.Longitude + "<br/>" +
".</p>");
"Geographic Location: " + schoolinfoData.SchoolGeographicLocation + "<br/></p>");

if (contactExists)
{
$("#si-extended").append("<p>Grid Location: " + contactInfo.Address.GridLocation.Latitude +
", " + contactInfo.Address.GridLocation.Longitude + "<br/></p>");
}



Expand Down
30 changes: 30 additions & 0 deletions app/naprr/public/js/naprr_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ function initSchoolChooserHandler()
scoresummaryData = data;
console.log("score summary data downloaded for " + acaraid +
" elements: " + scoresummaryData.length);

if (debug)
{
console.log(scoresummaryData);
}

// display on screen while other reports download
hideReport();
createScoreSummaryReport();
Expand All @@ -169,6 +175,12 @@ function initSchoolChooserHandler()
domainscoresData = data;
console.log("domain scores data downloaded for " + acaraid +
" elements: " + domainscoresData.length);

if (debug)
{
console.log(domainscoresData);
}

});

$.get("/naprr/participation/" + acaraid, function(data, status)
Expand All @@ -177,6 +189,12 @@ function initSchoolChooserHandler()
participationData = data;
console.log("participation data downloaded for " + acaraid +
" elements: " + participationData.length);

if (debug)
{
console.log(participationData);
}

});

$.get("/naprr/schoolinfo/" + acaraid, function(data, status)
Expand All @@ -185,13 +203,25 @@ function initSchoolChooserHandler()
schoolinfoData = data;
console.log("school info data downloaded for " + acaraid);

if (debug)
{
console.log(schoolinfoData);
}


});

$.get("/naprr/codeframe", function(data, status)
{
codeframeData = {};
codeframeData = data;
console.log("codeframe data downloaded.");

if (debug)
{
console.log(codeframeData);
}

});

});
Expand Down
9 changes: 6 additions & 3 deletions naprr/contractor_csvdata_ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ package naprr
import (
"bufio"
//ms "github.com/mitchellh/mapstructure"
"github.com/nats-io/nuid"
"strconv"

"github.com/nats-io/nuid"
//"github.com/nats-io/go-nats-streaming"
"fmt"
"log"
"path/filepath"

"github.com/nsip/nias2/lib"
nxml "github.com/nsip/nias2/xml"
"github.com/twinj/uuid"
"log"
"path/filepath"

//"sync"
"github.com/wildducktheories/go-csv"
"os"
Expand Down
2 changes: 1 addition & 1 deletion naprr/naprr_webserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (rrs *ResultsReportingServer) Run() {
//
e.GET("/naprr/codeframe", func(c echo.Context) error {

cfds := rrs.sr.GetCodeFrameData("report.cframe")
cfds := rrs.sr.GetCodeFrameData(REPORTS_CODEFRAME)

return c.JSON(http.StatusAccepted, cfds)
})
Expand Down
4 changes: 3 additions & 1 deletion naprr/reportgenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
package naprr

import (
"log"

"github.com/nats-io/go-nats-streaming"
"github.com/nsip/nias2/lib"
"log"
)

type ReportGenerator struct {
Expand Down Expand Up @@ -238,6 +239,7 @@ func (rg *ReportGenerator) GenerateParticipationData(nd *NAPLANData, sd *SchoolD
for _, ei := range pds.EventInfos {
pds.Summary[ei.Test.TestContent.TestDomain] = ei.Event.ParticipationCode
}

payload, err := rg.ge.Encode(pds)
if err != nil {
log.Println("unable to encode pds: ", err)
Expand Down
1 change: 0 additions & 1 deletion naprr/reportwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func (rw *ReportWriter) Run() {
rw.writeSchoolLevelReports(schools)
rw.writeAggregateSchoolReports(schools)
rw.writeTestLevelReports()
//rw.writeYr3WReports()

log.Println("All reports written\n")
}
Expand Down

0 comments on commit c8e3c16

Please sign in to comment.