private static CoreStandards ApplyPatchToCoreStandards(StandardIdentifier identifier, CoreStandards coreStandards, CoreStandardsXml standardsXml, ItemPatch patch) { string claimNumber = Regex.Match(input: patch.Claim, pattern: @"\d+").Value; if (identifier == null) { identifier = StandardIdentifier.Create(claim: claimNumber, target: patch.Target); } else { string target = (!string.IsNullOrEmpty(patch.Target)) ? patch.Target : identifier.Target; claimNumber = (!string.IsNullOrEmpty(claimNumber)) ? claimNumber : identifier.Claim; identifier = identifier.WithClaimAndTarget(claimNumber, target); } string targetDesc = (!string.IsNullOrEmpty(patch.TargetDescription)) ? patch.TargetDescription : coreStandards?.TargetDescription; string ccssDesc = (!string.IsNullOrEmpty(patch.CCSSDescription)) ? patch.CCSSDescription : coreStandards?.CommonCoreStandardsDescription; coreStandards = StandardIdentifierTranslation.CoreStandardFromIdentifier(standardsXml, identifier); coreStandards = coreStandards.WithTargetCCSSDescriptions(targetDesc, ccssDesc); return(coreStandards); }
public static StandardIdentifier ElaV1Standard(string[] parts, string publication) { return(StandardIdentifier.Create( claim: GetStandardPartOrDefault(parts, 0), target: GetStandardPartOrDefault(parts, 1), commonCoreStandard: GetStandardPartOrDefault(parts, 2), subjectCode: "ELA", publication: publication)); }
public static StandardIdentifier MaV6Standard(string[] parts, string publication) { return(StandardIdentifier.Create( claim: GetStandardPartOrDefault(parts, 0), target: GetStandardPartOrDefault(parts, 3), contentCategory: GetStandardPartOrDefault(parts, 1), targetSet: GetStandardPartOrDefault(parts, 2), subjectCode: "MATH", publication: publication)); }
/* * Locate and parse the standard, claim, and target from the metadata * * Claim and target are specified in one of the following formats: * SBAC-ELA-v1 (there is only one alignment for ELA, this is used for delivery) * Claim|Assessment Target|Common Core Standard * SBAC-MA-v6 (Math, based on the blueprint hierarchy, primary alignment and does not go to standard level, THIS IS USED FOR DELIVERY, should be the same as SBAC-MA-v4) * Claim|Content Category|Target Set|Assessment Target * SBAC-MA-v5 (Math, based on the content specifications hierarchy secondary alignment to the standard level) * Claim|Content Domain|Target|Emphasis|Common Core Standard * SBAC-MA-v4 (Math, based on the content specifications hierarchy primary alignment to the standard level) * Claim|Content Domain|Target|Emphasis|Common Core Standard */ public static StandardIdentifier StandardStringToStandardIdentifier(string standards) { if (string.IsNullOrEmpty(standards)) { // TODO: log error return(null); } string[] publicationAndKey = standards.Split(':'); if (publicationAndKey.Length < 2) { return(null); // TODO: log error instead //throw new ArgumentException("The standards string does not contain a publication and claim spearated by a colon."); } StandardIdentifier standardIdentifier = null; string publication = publicationAndKey[0]; string[] parts = publicationAndKey[1].Split('|'); switch (publication) { case "SBAC-ELA-v1": standardIdentifier = ElaV1Standard(parts, standards); break; case "SBAC-MA-v1": standardIdentifier = MaV1Standard(parts, standards); break; case "SBAC-MA-v4": standardIdentifier = MaV4Standard(parts, standards); break; case "SBAC-MA-v5": standardIdentifier = MaV5Standard(parts, standards); break; case "SBAC-MA-v6": standardIdentifier = MaV6Standard(parts, standards); break; } if (standardIdentifier == null) { standardIdentifier = StandardIdentifier.Create( claim: parts[0]); } return(standardIdentifier); }
public static StandardIdentifier MaV5Standard(string[] parts, string publication) { return(StandardIdentifier.Create( claim: GetStandardPartOrDefault(parts, 0), target: GetStandardPartOrDefault(parts, 2), contentDomain: GetStandardPartOrDefault(parts, 1), emphasis: GetStandardPartOrDefault(parts, 3), commonCoreStandard: GetStandardPartOrDefault(parts, 4), subjectCode: "MATH", publication: publication)); }
public static StandardIdentifier ElaCoreStandardToTarget(string[] parts) { if (parts == null || parts.Length != 2) { return(null); } return(StandardIdentifier.Create( claim: parts[0], target: parts[1], subjectCode: "ELA")); }
public static StandardIdentifier MathCoreStandardToTarget(string[] parts) { if (parts == null || parts.Length != 3) { return(null); } return(StandardIdentifier.Create( claim: parts[0], target: parts[2], contentDomain: parts[1], subjectCode: "MATH")); }
private StandardIdentifier DefaultWith( string subjectCode, string claim = null, string target = null, string contentDomain = null, string contentCategory = null, string emphasis = null, string commonCoreStandard = null) { return(StandardIdentifier.Create( subjectCode: subjectCode, claim: claim ?? claim1, contentDomain: contentDomain ?? contentDomain1, contentCategory: contentCategory ?? contentDomain1, target: target ?? target1, emphasis: emphasis ?? emphasis1, commonCoreStandard: commonCoreStandard ?? Ccss1 )); }