public void RetrieveElements() { try { sourceLocation = string.Empty; projectFileLocation = string.Empty; projectName = String.Empty; processTime = 0; buildType = String.Empty; buildPath = String.Empty; AssignmentM assign = AssignmentM.Load(studentAssignment.AssignmentID); sourceLocation = assign.StorageDirectory + studentAssignment.UserID; sourceLocation = SharedSupport.AddBackSlashToDirectory(sourceLocation.Trim()); //Get the allowable time to compile processTime = Convert.ToInt32(SharedSupport.GetSetting(Constants.MAX_PROCESS_SETTING)); // get project file location and project name ProjectInfo objPI = new ProjectInfo(sourceLocation); projectFileLocation = objPI.ProjectFile.Trim(); projectName = objPI.ProjectName.Trim(); buildType = objPI.ConfigName.Trim(); buildPath = objPI.BuildPath.Trim(); //Copy UserAssignment files to temp location ServerAction.CopyDirectories(sourceLocation, workingDirectory, true, true); // get the projectFile from the path string projectFile = Path.GetFileName(projectFileLocation); // change the projectFileLocation because we copied to the working directory projectFileLocation = SharedSupport.AddBackSlashToDirectory(workingDirectory) + projectFile; } catch (Exception ex) { SharedSupport.HandleError(ex); } }
public void RetrieveElements() { try { AssignmentM assign = AssignmentM.Load(studentAssignment.AssignmentID); processTime = Convert.ToInt32(SharedSupport.GetSetting(Constants.MAX_PROCESS_SETTING)); // student source location sourceLocation = assign.StorageDirectory + studentAssignment.UserID; // get compiled file name (already built by build process) ProjectInfo objPI = new ProjectInfo(sourceLocation); compiledFileName = objPI.OutputFile; inputFileLocation = assign.InputFile; expectedOutputFileLocation = assign.OutputFile; actualOutputFile = expectedOutputFileLocation; commandLineParams = assign.CommandLineArgs; compiledFileLocation = SharedSupport.AddBackSlashToDirectory(workingDirectory) + compiledFileName; expectedOutputFileLocation = assign.StorageDirectory + expectedOutputFileLocation; //change to use inputFileLocation in tempworkarea inputFileLocation = SharedSupport.AddBackSlashToDirectory(assign.StorageDirectory) + inputFileLocation; //Get the user's submission folder location string userSubmissionRootFolder = SharedSupport.AddBackSlashToDirectory(sourceLocation); //Copy all files under the student's submission directory, to the working area. ServerAction.CopyDirectories(userSubmissionRootFolder, workingDirectory, true, true); } catch (Exception ex) { SharedSupport.HandleError(ex); } }