private void userAssignmentDetailRefresh() { StudentAssignmentM sa = StudentAssignmentM.Load(studentID, assignmentId); if (sa != null) { txtGrade.Text = sa.OverallGrade; txtComments.Text = sa.GradeComments; lblDateSubmitted.Text = Server.HtmlEncode(sa.LastSubmitDate.ToShortDateString() + " " + sa.LastSubmitDate.ToShortTimeString()); //Populate Auto-Compile Section lblCompileDate.Text = sa.LastUpdatedDate.ToShortDateString() + " " + sa.LastUpdatedDate.ToShortTimeString(); txtCompileDetails.Text = sa.BuildDetails; lblCompileResult.Text = Server.HtmlEncode(sa.BuildResultCode); //Populate Auto-Grade Section txtAutoGradeDate.Text = sa.LastUpdatedDate.ToShortDateString() + " " + sa.LastUpdatedDate.ToShortTimeString(); txtAutoGradeDetails.Text = sa.CheckDetails; txtAutoGradeResult.Text = sa.CheckResultCode; //Grab assignment information based on loaded assignmentID AssignmentM assign = AssignmentM.Load(assignmentId); if (assign.IsValid) { lblAssignment.Text = Server.HtmlEncode(assign.ShortName); } else { string[] AssignmentID = new string[] { assignmentId.ToString() }; throw new Exception(SharedSupport.GetLocalizedString("FacultyGradeSubmission_InvalidAssignmentID", AssignmentID)); } //Grab user information based on loaded userID UserM user = UserM.Load(studentID); if (user.IsValid) { this.lblStudent.Text = Server.HtmlEncode(user.LastName + SharedSupport.GetLocalizedString("FacultyGradeSubmission_Comma") + user.FirstName); } else { Nav1.Feedback.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_NoUserIDFound"); //"No UserID found. "; } } }
public void btnAutoCompile_Click(object sender, System.EventArgs e) { try { if (!SharedSupport.SecurityIsAllowed(courseId, SecurityAction.USERASSIGNMENT_EDIT)) { throw new Exception(SharedSupport.GetLocalizedString("Global_Unauthorized")); } StudentAssignmentM sa = StudentAssignmentM.Load(studentID, assignmentId); sa.SendActionToQueue(true, false); userAssignmentDetailRefresh(); Nav1.Feedback.Text = SharedSupport.GetLocalizedString("FacultySubmissions_BuildSubmitSuccessful"); } catch { Nav1.Feedback.Text = SharedSupport.GetLocalizedString("FacultyGradeSubmission_InvalidUserAssignmentID"); } }
public void btnSaveGrade_Click(object sender, System.EventArgs e) { try { // Check permissions. if (!SharedSupport.SecurityIsAllowed(courseId, SecurityAction.USERASSIGNMENT_EDIT)) { throw new Exception(SharedSupport.GetLocalizedString("Global_Unauthorized")); } Nav1.Feedback.Text = String.Empty; if (studentID != 0) { StudentAssignmentM assignment = StudentAssignmentM.Load(studentID, assignmentId); if (assignment != null) { assignment.GradeComments = txtComments.Text.ToString(); assignment.OverallGrade = txtGrade.Text.ToString(); assignment.LastUpdatedDate = DateTime.Now; //Save the updated User Assignment assignment.Update(); Response.Redirect("Submissions.aspx?CourseID=" + Request.QueryString.Get("CourseID") + "&AssignmentID=" + Request.QueryString.Get("AssignmentID"), false); } } else { throw new Exception(SharedSupport.GetLocalizedString("FacultyGradeSubmission_InvalidUserAssignmentID") + Request.QueryString.Get("UserAssignmentID").ToString()); } } catch (System.Exception ex) { Nav1.Feedback.Text = ex.Message.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { try { AssignmentManager.Common.Functions func = new AssignmentManager.Common.Functions(); int courseId = func.ValidateNumericQueryStringParameter(this.Request, "CourseID"); if (!SharedSupport.SecurityIsAllowed(courseId, SecurityAction.ASSIGNMENT_VIEW)) { // Note that Redirect ends page execution. Response.Redirect(@"../Error.aspx?ErrorDetail=" + "Global_Unauthorized"); } //Cleanup temporary files after project downloads. Page does not need to load. if (Request.QueryString.Get("Action").ToLower() == "cleanupdirectory") { CleanupTempDirectory(); } Nav1.Feedback.Text = String.Empty; Nav1.SideTabId = AssignmentManager.Common.constants.SIDE_NAV_COURSE_MANAGEMENT; Nav1.TopTabId = AssignmentManager.Common.constants.TOP_NAV_COURSE_ASSIGNMENTS; if (Request.QueryString.Get("Action").ToLower() == "uploadstarter") { Nav1.Title = SharedSupport.GetLocalizedString("UploadDownload_Upload_Starter_Title");//"Upload Starter"; } if (Request.QueryString.Get("Action").ToLower() == "downloadsubmission") { Nav1.Title = SharedSupport.GetLocalizedString("UploadDownload_Download_Faculty_Title");//"Download Student Submission"; } Nav1.relativeURL = @"../"; if (Request.QueryString.Get("Action").ToLower() == "uploadstarter") { GoBack1.GoBack_HelpUrl = SharedSupport.HelpRedirect("vstskUpdatingStarterProject"); } else { GoBack1.GoBack_HelpUrl = SharedSupport.HelpRedirect("vsoriUsingAssignmentManager"); } GoBack1.GoBackIncludeBack = true; GoBack1.GoBack_left = "295px"; GoBack1.GoBack_top = "22px"; if (Request.UrlReferrer.ToString() != "") { GoBack1.GoBack_BackURL = Request.UrlReferrer.ToString(); } else { GoBack1.GoBack_BackURL = "Assignments.aspx?" + Request.QueryString.ToString(); } //Give the client the upload and download locations if (SharedSupport.UsingSsl) { txtUploadLocation.Value = "https://" + Request.ServerVariables.Get("HTTP_HOST") + Constants.ASSIGNMENTMANAGER_UPLOAD_DIRECTORY; txtDownloadFolderLocation.Value = "https://" + Request.ServerVariables.Get("HTTP_HOST") + Constants.ASSIGNMENTMANAGER_DOWNLOAD_DIRECTORY; } else { txtUploadLocation.Value = "http://" + Request.ServerVariables.Get("HTTP_HOST") + Constants.ASSIGNMENTMANAGER_UPLOAD_DIRECTORY; txtDownloadFolderLocation.Value = "http://" + Request.ServerVariables.Get("HTTP_HOST") + Constants.ASSIGNMENTMANAGER_DOWNLOAD_DIRECTORY; } txtMaxUploadSize.Value = SharedSupport.GetSetting(AssignmentManager.Constants.MAX_PROJECT_SETTING).ToString(); btnDownload.Value = UploadDownload_Download_Text; string dir = SharedSupport.AddBackSlashToDirectory(System.Web.HttpContext.Current.Request.MapPath(String.Empty, Constants.ASSIGNMENTMANAGER_DOWNLOAD_DIRECTORY, true)); if (Directory.Exists(dir)) { txtDirSize.Value = SharedSupport.GetSetting(AssignmentManager.Constants.MAX_PROJECT_SETTING).ToString(); } int studentID = func.ValidateNumericQueryStringParameter(this.Request, "StudentID"); int assignmentId = func.ValidateNumericQueryStringParameter(this.Request, "AssignmentID"); if (!IsPostBack) { // // Evals true first time browser hits the page // if (Request.QueryString.Get("Action").ToLower() == "uploadstarter") { chkRemoveStudentCode.Visible = true; lblRemoveCode.Visible = true; } else { chkRemoveStudentCode.Visible = false; lblRemoveCode.Visible = false; } txtExistingStarterProject.Value = ""; lblRemoveCode.Text = UploadDownload_RemoveCode_Text; lblSelectProject.Text = UploadDownload_SelectProject; lblAssignmentName.Text = UploadDownload_AssignmentName; lblUploadSubTitle.Text = UploadDownload_UploadSubTitle; lblUploadDescription.Text = UploadDownload_UploadDescription; lblDownloadFacultyTitle.Text = UploadDownload_Download_Faculty_Title; lblDownloadLocationForFiles.Text = UploadDownload_Location_For_Download_Files_Text; lblStudentName.Text = UploadDownload_StudentName; lblAssignmentNameDownload.Text = UploadDownload_AssignmentName; if (!assignmentId.Equals(0)) { AssignmentM assign = AssignmentM.Load(assignmentId); if (assign.IsValid) { if (assign.StarterProjectFlag) { txtExistingStarterProject.Value = "1"; } txtAssignmentName.ReadOnly = true; txtAssignmentName.Enabled = false; txtAssignmentName.Text = assign.ShortName; } } //Download of student Submission if (Request.QueryString.Get("Action").ToLower() == "downloadsubmission") { AssignmentM assignment = AssignmentM.Load(assignmentId); if (assignment.IsValid) { if (assignment.StarterProjectFlag) { txtExistingStarterProject.Value = "1"; } txtAssignmentName.ReadOnly = true; txtAssignmentName.Enabled = false; txtAssignmentName.Text = assignment.ShortName; txtAssignmentNameDownload.ReadOnly = true; txtAssignmentNameDownload.Enabled = false; txtAssignmentNameDownload.Text = assignment.ShortName; } UserM user = UserM.Load(studentID); if (user.IsValid) { txtStudentName.ReadOnly = true; txtStudentName.Text = Server.HtmlEncode(user.LastName.Trim() + SharedSupport.GetLocalizedString("UploadDownload_comma") + " " + user.FirstName.Trim() + " " + user.MiddleName.Trim()); } txtSolutionName.Value = SharedSupport.AddBackSlashToDirectory(assignment.ShortName); System.Guid guid = System.Guid.NewGuid(); StudentAssignmentM studentAssign = StudentAssignmentM.Load(studentID, assignmentId); txtDownloadFilesXML.Value = studentAssign.AssignmentFilesXML(guid.ToString(), assignment); txtNewGUID.Value = guid.ToString(); } else { txtNewGUID.Value = System.Guid.NewGuid().ToString(); } } else { //If this is coming back from the client see what the action //is on the query string and perform accordingly //Faculty Submitting Starter Project if (Request.QueryString.Get("Action").ToLower() == "uploadstarter") { string xmlFileList = txtFilesUploadedXML.Value.ToString(); AssignmentM assign = AssignmentM.Load(assignmentId); assign.SubmitStarter(xmlFileList, txtNewGUID.Value.ToString()); Response.Redirect("Assignments.aspx?CourseID=" + Request.QueryString.Get("CourseID"), false); } } } catch (Exception ex) { Nav1.Feedback.Text = ex.Message.ToString(); } }
protected void Page_Load(object sender, System.EventArgs e) { try { // grab CourseID parameter from the querystring AssignmentManager.Common.Functions func = new AssignmentManager.Common.Functions(); courseId = func.ValidateNumericQueryStringParameter(this.Request, "CourseID"); UserM user = UserM.Load(SharedSupport.GetUserIdentity()); if (!user.IsInCourse(courseId)) { Response.Redirect(@"../Error.aspx?ErrorDetail=" + "Global_Unauthorized"); } // Do not cache this page Response.Cache.SetNoStore(); Nav1.Feedback.Text = String.Empty; Nav1.SideTabId = AssignmentManager.Common.constants.SIDE_NAV_STUDENT_COURSE; Nav1.TopTabId = AssignmentManager.Common.constants.TOP_NAV_STUDENT_COURSE_ASSIGNMENTS; Nav1.relativeURL = @"../"; //GoBack1.GoBack_HelpUrl = SharedSupport.HelpRedirect("vstskCheckingAssignmentStatus"); GoBack1.GoBack_HelpUrl = SharedSupport.HelpRedirect("tskUsingAssignmentManagerToCheckAssignmentStatus"); GoBack1.GoBackIncludeBack = true; GoBack1.GoBack_BackURL = "Assignments.aspx?" + Request.QueryString.ToString(); GoBack1.GoBack_left = "-105px"; if (Request.QueryString.Get("Exp") == "1") { txtDescription.CssClass = "infoTextDisabled"; } else { txtDescription.CssClass = "invisible"; } if (courseId > 0) { //returns the course name to be displayed in the Nav bar title CourseM course = CourseM.Load(courseId); Nav1.Title = Server.HtmlEncode(course.Name); } else { Nav1.Feedback.Text = SharedSupport.GetLocalizedString("Global_MissingParameter"); } // grab assignmentId from querystring assignmentId = func.ValidateNumericQueryStringParameter(this.Request, "assignmentId"); if (!IsPostBack) { // // Evals true first time browser hits the page // } int userID = SharedSupport.GetUserIdentity(); LocalizeLabels(); //checks that assignmentId is not empty then loops through if (assignmentId.Equals(null)) { Nav1.Feedback.Text = SharedSupport.GetLocalizedString("GradeDetail_InvalidassignmentIdError"); } else { AssignmentM assign = AssignmentM.Load(assignmentId); if (assign.IsValid) { txtDescription.Text = assign.Description; lblAssignment.Text = Server.HtmlEncode(assign.ShortName); lblDueDateValue.Text = assign.DueDate.ToShortDateString(); hlAssignmentWebPage.NavigateUrl = assign.AssignmentURL; hlAssignmentWebPage.Text = Server.HtmlEncode(assign.AssignmentURL); } StudentAssignmentM stuAssign = StudentAssignmentM.Load(userID, assignmentId); if (stuAssign == null) { this.lblAssignment.Text = SharedSupport.GetLocalizedString("GradeDetail_NoDetailsAvailable"); } else { //if data is returned, regardless of the Detail Type the LocalizeGeneralLabels //generates text for the header labels. LocalizeGeneralLabels(stuAssign); LocalizeAutoBuildLabels(stuAssign); LocalizeAutoGradeLabels(stuAssign); } } } catch (Exception ex) { Nav1.Feedback.Text = ex.Message.ToString(); } }