package org.slc.sli.test.generators;

import java.util.Random;

import org.slc.sli.test.edfi.entities.*;

public class StudentObjectiveAssessmentGenerator {
    private boolean optional;
    private Random random = new Random();

    private AssessmentReportingMethodType[] armts = AssessmentReportingMethodType.values();

    public StudentObjectiveAssessmentGenerator(boolean optional) {
        this.optional = optional;
    }

    public StudentObjectiveAssessment generate(String Id, ReferenceType studentTestAssessmentReference, ObjectiveAssessmentReferenceType objectiveAssessmentReference) {
        StudentObjectiveAssessment soa = new StudentObjectiveAssessment();

        soa.setId(Id);

        int numberOfScoreResults = 1 + random.nextInt(5);
        for (int i = 0 ; i < numberOfScoreResults; i++) {
            ScoreResult sr = new ScoreResult();
            sr.setAssessmentReportingMethod(armts[random.nextInt(armts.length)]);
            sr.setResult("result " + random.nextInt());
            soa.getScoreResults().add(sr);
        }

        soa.setStudentTestAssessmentReference(studentTestAssessmentReference);

        soa.setObjectiveAssessmentReference(objectiveAssessmentReference);

        if (optional) {
            // TODO: add PerformanceLevels
        }

        return soa;
    }

    public static StudentObjectiveAssessment generateLoFi(String Id, ReferenceType studentTestAssessmentReference, ObjectiveAssessmentReferenceType objectiveAssessmentReference) {
        StudentObjectiveAssessmentGenerator soag = new StudentObjectiveAssessmentGenerator(false);
        return soag.generate(Id, studentTestAssessmentReference, objectiveAssessmentReference);
    }
}

@@ -99,133 +99,540 @@
 ies.
-*;%0A%0Apublic class StudentObjectiveAssessmentGenerator %7B%0A    private boolean optional;%0A    private Random random = new Random()
+AssessmentReportingMethodType;%0Aimport org.slc.sli.test.edfi.entities.ObjectiveAssessmentReferenceType;%0Aimport org.slc.sli.test.edfi.entities.ReferenceType;%0Aimport org.slc.sli.test.edfi.entities.ScoreResult;%0Aimport org.slc.sli.test.edfi.entities.StudentAssessment;%0Aimport org.slc.sli.test.edfi.entities.StudentObjectiveAssessment;%0Aimport org.slc.sli.test.mappingGenerator.AssessmentMetaRelations;%0A%0Apublic class StudentObjectiveAssessmentGenerator %7B%0A    private static final Random RANDOM = new Random();%0A%0A    private boolean optional
 ;%0A%0A 
@@ -926,32 +926,44 @@
 ssmentReference,
+%0A           
  ObjectiveAssess
@@ -1151,22 +1151,22 @@
 s = 1 + 
-random
+RANDOM
 .nextInt
@@ -1192,17 +1192,16 @@
 nt i = 0
- 
 ; i %3C nu
@@ -1325,22 +1325,22 @@
 d(armts%5B
-random
+RANDOM
 .nextInt
@@ -1398,14 +1398,14 @@
 %22 + 
-random
+RANDOM
 .nex
@@ -1787,326 +1787,965 @@
 teLo
+w
 Fi(St
-ring Id, ReferenceType studentTestAssessmentReference, ObjectiveAssessmentReferenceType objectiveAssessmentReference) %7B%0A        StudentObjectiveAssessmentGenerator soag = new StudentObjectiveAssessmentGenerator(false);%0A        return soag.generate(Id, studentTestAssessmentReference, objectiveAssessmentReference)
+udentAssessment studentAssessment) %7B%0A        StudentObjectiveAssessment soa = new StudentObjectiveAssessment();%0A%0A        ScoreResult scoreResult = new ScoreResult();%0A        scoreResult.setAssessmentReportingMethod(AssessmentReportingMethodType.values()%5BRANDOM%0A                .nextInt(AssessmentReportingMethodType.values().length)%5D);%0A        scoreResult.setResult(%22score result%22);%0A        soa.getScoreResults().add(scoreResult);%0A%0A        // TODO: add performance levels%0A%0A        ReferenceType studentAssessmentReference = new ReferenceType();%0A        studentAssessmentReference.setRef(studentAssessment);%0A        soa.setStudentTestAssessmentReference(studentAssessmentReference);%0A%0A        String randomObjAssessCode = AssessmentMetaRelations.getRandomObjectiveAssessmentMeta().id;%0A        soa.setObjectiveAssessmentReference(ObjectiveAssessmentGenerator%0A                .getObjectiveAssessmentReferenceType(randomObjAssessCode));%0A%0A        return soa
 ;%0A  

create static lowfi generator