import { SCORE_MODE, SCORE_RESULT_TYPE } from "../model/constants"; export class SoapEnvelope { public static getObject(usernameTag: string, pwTag: string, sourceId: any, ctrXml: any) { return { 'soap:Envelope': { $: { "xmlns:soap": "http://schemas.xmlsoap.org/soap/envelope/", "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", "xmlns:xsd": "http://www.w3.org/2001/XMLSchema", "xmlns:wsa": "http://schemas.xmlsoap.org/ws/2004/03/addressing", "xmlns:wsse": "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "xmlns:wsu": "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" }, 'soap:Header': { 'wsse:Security': { $: { "xmlns:wsse": "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "soap:mustUnderstand": "1" }, 'wsse:UsernameToken': { $: { "xmlns:wsu": "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", "wsu:Id": "UsernameToken-800879608" }, 'wsse:Username': usernameTag, 'wsse:Password': { $: { "Type": "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText" }, _: pwTag }, } } }, 'soap:Body': { 'PostCandidateResults': { $: { "xmlns": "http://webservice.skmweb.ets.org" }, 'sourceId': sourceId, 'ctrXml': ctrXml } } } }; } } export class SourceId { public static getObject(processType: string, programCode: string, testCode: string): any { return { 'qti_result_report': { $: { "xsi:schemaLocation": "http://www.imsglobal.org/xsd/ims_qtiresv1p2 ims_qtiresv1p2_ets1p0_eSKM.xsd", "xmlns:eskm": "http://eskm.ets.org/schema/eskm_sm", "xmlns": "http://www.imsglobal.org/xsd/ims_qtiresv1p2", "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance" }, 'result': { 'context': { 'generic_identifier': [ { 'type_label': "WorkFlowType", 'identifier_string': "XML_CTR" }, { 'type_label': "ProcessType", 'identifier_string': processType }, { 'type_label': "ProgramCode", 'identifier_string': programCode }, { 'type_label': "TestCode", 'identifier_string': testCode } ] }, 'summary_result': {} } } }; } } export class CtrXml { public static getObject(registSystemId: string, adminCode: string, etsCandidateId: string, apuid: string, testPackageId: string, subformCode: string) { return { 'qti_result_report': { $: { "xsi:schemaLocation": "http://www.imsglobal.org/xsd/ims_qtiresv1p2 ims_qtiresv1p2_ets1p0_eSKM.xsd", "xmlns:eskm": "http://eskm.ets.org/schema/eskm_sm", "xmlns": "http://www.imsglobal.org/xsd/ims_qtiresv1p2", "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", "xmlns:cr": "http://eskm.ets.org/schema/eskm_crScoring" }, 'result': { 'context': { 'generic_identifier': [ { 'type_label': "RegistrationSystemId", 'identifier_string': registSystemId }, { 'type_label': "AdminCode", 'identifier_string': adminCode }, { 'type_label': "candid", 'identifier_string': etsCandidateId }, { 'type_label': "apuid", 'identifier_string': apuid } ], 'extension_context': { 'itemsSentToRatingSystem': { "eskm:item": [] } } }, 'assessment_result': { $: { "ident_ref": testPackageId, "asi_title": "TEST_PKG" }, 'section_result': { $: { "asi_title": "SESSION", "presented": "Yes" }, "asi_metadata": { 'asi_metadatafield': [ ] }, 'section_result': { $: { "asi_title": "SUBFORM", "ident_ref": subformCode, "presented": "Yes" }, "asi_metadata": { 'asi_metadatafield': [ ] }, 'section_result': [] } } } } } }; } } export class RescoreCtrXml { public static getObject(registSystemId: string, oppRegistSystemId: string, oppId: string, ctrId: string, adminCode: string, transId: string, testPackageId: string, subformCode: string, accnum: string, statusDate: string) { return { "qti_result_report": { "$": { "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", "xmlns:xsd": "http://www.w3.org/2001/XMLSchema", "xmlns": "http://www.imsglobal.org/xsd/ims_qtiresv1p2" }, "result": { "context": { "generic_identifier": [ { "type_label": [ { "_": "StatusDate", "$": { "source": "APMOD" } } ], "identifier_string": [ statusDate ] }, { "type_label": [ { "_": "OpportunityRegSysId", "$": { "source": "APMOD" } } ], "identifier_string": [ oppRegistSystemId ] }, { "type_label": [ { "_": "OpportunityIds", "$": { "source": "APMOD" } } ], "identifier_string": [ oppId ] }, { "type_label": [ { "_": "RescoreType", "$": { "source": "APMOD" } } ], "identifier_string": [ "AD_INIT_RESCORE" ] }, { "type_label": [ { "_": "RegistrationSystemId", "$": { "source": "APMOD" } } ], "identifier_string": [ registSystemId ] }, { "type_label": [ { "_": "CTRID", "$": { "source": "APMOD" } } ], "identifier_string": [ ctrId ] }, { "type_label": [ { "_": "AdminCode", "$": { "source": "APMOD" } } ], "identifier_string": [ adminCode ] }, { "type_label": [ { "_": "TransactionId", "$": { "source": "APMOD" } } ], "identifier_string": [ transId ] } ] }, "assessment_result": { "$": { "ident_ref": testPackageId, "asi_title": "TEST_PKG" }, "section_result": [ { "$": { "asi_title": "SUBFORM", "ident_ref": subformCode, "presented": "Yes" }, "item_result": [ { "$": { "asi_title": "ITEM", "ident_ref": accnum, "presented": "Yes" } } ] } ] } } } } } }; export class RescoreAltCtrXml { public static getObject(registSystemId: string, ctrId: string, adminCode: string, transId: string, testPackageId: string, subformCode: string, accnum: string) { return { "qti_result_report": { "$": { "xmlns": "http://www.imsglobal.org/xsd/ims_qtiresv1p2", "xmlns:eskm": "http://eskm.ets.org/schema/eskm_sm", "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", "xsi:schemaLocation": "http://www.imsglobal.org/xsd/ims_qtiresv1p2 ims_qtiresv1p2_ets1p0_eSKM.xsd" }, "result": { "context": { "generic_identifier": [ { "type_label": [ { "_": "RescoreType", "$": { "source": "IMS" } } ], "identifier_string": [ "AD_INIT_RESCORE" ] }, { "type_label": [ { "_": "TransactionId", "$": { "source": "IMS" } } ], "identifier_string": [ transId ] }, { "type_label": [ { "_": "RegistrationSystemId", "$": { "source": "IMS" } } ], "identifier_string": [ registSystemId ] }, { "type_label": [ { "_": "CTRID", "$": { "source": "IMS" } } ], "identifier_string": [ ctrId ] }, { "type_label": [ { "_": "AdminCode", "$": { "source": "IMS" } } ], "identifier_string": [ adminCode ] } ] }, "assessment_result": { "$": { "ident_ref": testPackageId, "asi_title": "TEST_PKG" }, "section_result": [ { "$": { "asi_title": "SUBFORM", "ident_ref": subformCode, "presented": "Yes" }, "item_result": [ { "$": { "asi_title": "ITEM", "ident_ref": accnum, "presented": "Yes" } } ] } ] } } } } } } export class Score { public static getObject(scoreValue: string, scoreModeCode: string, vartype: string, scoreCompletionDate: string) { return { $: { 'status': 'Valid', 'varname': SCORE_MODE[scoreModeCode] || '', 'vartype': vartype }, 'score_value': scoreValue, // 'score_interpretation':"", 'extension_score': { 'OSNResponseScoreInfo': { 'osn:ScoreCompletionDate': scoreCompletionDate, 'osn:overallCrInfo': {}, 'osn:Scores': [] as any[] } } }; } } export class Scores { public static getObject(scorerId: string, scoringCenter: string, scoreDate: string, scoreModeCode: string, scoreResultTypeCode: string, scorerComment: string[], scoreValue: string, scoreDomainCode: string) { return { 'osn:ScorerInfo': { 'osn:ScorerId': scorerId, 'osn:ScoringCenter': scoringCenter }, 'osn:ScoreDate': scoreDate, 'osn:ScoreMode': { $: { 'ModeCode': scoreModeCode, 'ModeName': SCORE_MODE[scoreModeCode] || '' } }, 'osn:ScoreResultType': { $: { 'ResultTypeCode': scoreResultTypeCode, 'ResultTypeName': SCORE_RESULT_TYPE[scoreResultTypeCode] || '' } }, 'osn:ScorerComment': scorerComment, 'osn:ScoreDomainValue': { $: { 'OSNScoreValue': scoreValue, 'ScoreDomainCode': scoreDomainCode, 'ScoreDomainName': scoreDomainCode //may need to update in the future } }, }; } } export class OverallCrInfo { public static getObject(resultTypeCode: string, raterScore: string) { return { 'osn:resultTypeCode': resultTypeCode, 'osn:raterScore': raterScore }; } }