public void Submit(int assignmentID, int courseID, string xmlFileList, string pathGUID) { try { bool bBuildAssignment = false; // indicates if build indicated by faculty for this assignment bool bCheckAssignment = false; // indicates if check indicated by faculty for this assignment //For each file uploaded - move to secure directory this._assignmentID = assignmentID; this._userID = SharedSupport.GetUserIdentity(); //Check to see if the user has already submitted an assignment and if the assignment allows for multiple submissions. //If not allowed, and the user has already submitted an assignment for this assignment then throw error. AssignmentM assign = AssignmentM.Load(assignmentID); if (assign.IsValid) { // build / check indicated for this assignment? bBuildAssignment = assign.AutoCompileFlag; bCheckAssignment = assign.AutoGradeFlag; if (!assign.MultipleSubmitsFlag) { if (this.HasSubmitted) { throw new ApplicationException(SharedSupport.GetLocalizedString("StudentAssignment_NoMultipleSubmits")); } } } else { throw new ApplicationException(SharedSupport.GetLocalizedString("StudentAssignment_NoCourseOfferingAssignment_Error")); } // delete any previous submissions this.ClearSubmissions(); if (bBuildAssignment) { this._autoCompileStatus = Constants.AUTOCOMPILE_PENDING_STATUS; } else { this._autoCompileStatus = Constants.AUTOCOMPILE_NOTAPPLICABLE_STATUS; } if (bCheckAssignment) { this._autoGradeStatus = Constants.AUTOGRADE_PENDING_STATUS; } else { this._autoGradeStatus = Constants.AUTOGRADE_NOTAPPLICABLE_STATUS; } this._lastSubmitDate = DateTime.Now; this._lastUpdatedDate = DateTime.Now; this.SaveToDatabase(StoredProcType.New); this.saveFileList(xmlFileList, pathGUID); // queue action requests if (bBuildAssignment || bCheckAssignment) { try { SendActionToQueue(this._userAssignmentID, bBuildAssignment, bCheckAssignment); } catch (Exception ex) { // this is the student submitting, so log it and continue SharedSupport.LogMessage(ex.Message, this.ToString(), System.Diagnostics.EventLogEntryType.Warning); } } } catch (Exception ex) { SharedSupport.HandleError(ex); } }