From cbb987ad330a8d0bd4aa12247366c71f15afdbca Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 6 Feb 2017 15:10:44 -0800 Subject: [PATCH] Return 'destination' only TDS Reports IRP uses TIS to analyze test scores. This change will cause TIS to return the File ID of the file it is submitting to be scored and return only a TDS Report if it is marked with the 'destination' location in the XMLRepository table. --- Common/TDSQASystemAPI/BL/XmlRepository.cs | 5 ++++ Common/TDSQASystemAPI/DAL/XmlRepository.cs | 24 ++++++++++++++++++ TDSQAService/OSS.TIS/DAL/ARTDAL.cs | 2 +- .../OSS.TIS/SQL/TISDB/1_Create_Objects.sql | Bin 111710 -> 113044 bytes .../Authorization/AuthorizeOpenAMAttribute.cs | 2 +- .../Services/TestResultController.cs | 20 ++++++++++++--- 6 files changed, 48 insertions(+), 5 deletions(-) diff --git a/Common/TDSQASystemAPI/BL/XmlRepository.cs b/Common/TDSQASystemAPI/BL/XmlRepository.cs index def32ac..1096ab2 100644 --- a/Common/TDSQASystemAPI/BL/XmlRepository.cs +++ b/Common/TDSQASystemAPI/BL/XmlRepository.cs @@ -107,6 +107,11 @@ public XmlDocument GetXmlContent(long fileId) return xmlRepositoryDAL.GetXmlContent(fileId); } + public XmlDocument GetDestinationXmlContent(long fileId) + { + return xmlRepositoryDAL.GetDestinationXmlContent(fileId); + } + public XmlDocument ProcessXmlFile(long fileId) { return xmlRepositoryDAL.ProcessXmlFile(fileId); diff --git a/Common/TDSQASystemAPI/DAL/XmlRepository.cs b/Common/TDSQASystemAPI/DAL/XmlRepository.cs index f63e0fb..3d8dafe 100644 --- a/Common/TDSQASystemAPI/DAL/XmlRepository.cs +++ b/Common/TDSQASystemAPI/DAL/XmlRepository.cs @@ -126,6 +126,30 @@ public XmlDocument GetXmlContent(long fileId) return doc; } + public XmlDocument GetDestinationXmlContent(long fileId) + { + XmlDocument doc = null; + using (DbCommand cmd = _db.GetStoredProcCommand("GetDestinationXmlContentByFileID")) + { + if (dbCommandTimeout != null) + cmd.CommandTimeout = dbCommandTimeout.Value; + _db.AddInParameter(cmd, "@FileID", DbType.Int64, fileId); + using (SqlDataReader rdr = (SqlDataReader)_db.ExecuteReader(cmd)) + { + if (rdr.Read()) + { + if (!rdr.IsDBNull(0)) + { + doc = new XmlDocument(); + doc.Load(rdr.GetSqlXml(0).CreateReader()); + } + } + } + } + + return doc; + } + public XmlDocument ProcessXmlFile(long fileId) { XmlDocument doc = null; diff --git a/TDSQAService/OSS.TIS/DAL/ARTDAL.cs b/TDSQAService/OSS.TIS/DAL/ARTDAL.cs index 7e5c811..14a7e19 100644 --- a/TDSQAService/OSS.TIS/DAL/ARTDAL.cs +++ b/TDSQAService/OSS.TIS/DAL/ARTDAL.cs @@ -52,7 +52,7 @@ public XmlDocument GetStudentPackageXML(string ssid, string stateAbbrviation, bo HttpResponseMessage response = Get(ssid, stateAbbrviation, oauthToken, useAlternateStudentId); - if ((response.StatusCode == HttpStatusCode.Unauthorized || response.StatusCode == HttpStatusCode.Forbidden) && authTokenFoundInCache) + if ((response.StatusCode == HttpStatusCode.Unauthorized || response.StatusCode == HttpStatusCode.Forbidden || response.StatusCode == HttpStatusCode.BadRequest) && authTokenFoundInCache) { // try again with a fresh token; may have expired OAuth.RemoveFromCache(artService.Authorization, oauthToken); diff --git a/TDSQAService/OSS.TIS/SQL/TISDB/1_Create_Objects.sql b/TDSQAService/OSS.TIS/SQL/TISDB/1_Create_Objects.sql index 57729120fb8808d076dbf2ce52cdf8a1412bdaba..903ed46d1b129cf50d8f74a8d4bdc68cf09ec0bb 100644 GIT binary patch delta 416 zcmccjf^EuYwuUW?W-QYeFfy`&=nHV*vpJQbFgM$W&pl}I;A%h-J3(y`Q zI~7b8Gk^`7UdYU-%L-O9`RISm$yvwL#EpPjAU1I__%ryy44AC=N0_;U!Du>T8l$Qx zLWv_#i3?Z}L~8Pd6oKhN?2J;poIoeS