Ejemplo n.º 1
0
        public void btnAutoCompile_Click(object sender, System.EventArgs e)
        {
            try
            {
                //make sure the user is allowed to do this
                if (!SharedSupport.SecurityIsAllowed(courseId, SecurityAction.USERASSIGNMENT_EDIT))
                {
                    // Note that Redirect ends page execution.
                    Response.Redirect(@"../Error.aspx?ErrorDetail=" + "Global_Unauthorized");
                }

                int[] userAssignmentIds = getCheckedUserAssignmentIdsFromDataList();

                if (userAssignmentIds.Length < 1)
                {
                    Nav1.Feedback.Text = SharedSupport.GetLocalizedString("Submissions_NoSelectionMade");
                    return;
                }

                //call Auto Compile for each UserAssignmentID
                for (int i = 0; i < userAssignmentIds.Length; i++)
                {
                    StudentAssignmentM.SendActionToQueue(userAssignmentIds[i], true, false);
                }

                // refresh user assignments data list
                userAssignmentsRefresh();

                Nav1.Feedback.Text = SharedSupport.GetLocalizedString("FacultySubmissions_BuildSubmitSuccessful");
            }
            catch (Exception ex)
            {
                Nav1.Feedback.Text = ex.Message;
            }
        }
        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");
            }
        }