Esempio n. 1
0
        /// <summary>
        /// Gets a list of Submissions of an assignment by the student.
        /// </summary>
        /// <param name="sid"> Unique id of the student.</param>
        /// <param name="courseId">Unique id of the course.</param>
        /// <returns>List of Submissions.</returns>
        public static SubmissionList GetItem(string sid, string courseId)
        {
            SubmissionList mySubmissionList = null;
            using (SqlConnection myConnection = new SqlConnection(AppSettings.ConnectionString))
            {
                SqlCommand myCommand = new SqlCommand("spGetGradeGroupByAssignmentForStudent", myConnection);
                myCommand.CommandType = CommandType.StoredProcedure;
                myCommand.Parameters.AddWithValue("@SID", sid);
                myCommand.Parameters.AddWithValue("@CourseID", courseId);

                myConnection.Open();
                using (SqlDataReader myDataReader = myCommand.ExecuteReader())
                {
                    if (myDataReader.HasRows)
                    {
                        mySubmissionList = new SubmissionList();
                        while (myDataReader.Read())
                        {
                            mySubmissionList.Add(FillRecordByStudent(myDataReader));
                        }
                    }
                    myDataReader.Close();
                }
                myConnection.Close();
            }
            return mySubmissionList;
        }
Esempio n. 2
0
        /// <summary>
        /// Gets a list of Submissions of an assignment.
        /// </summary>
        /// <param name="courseId"> ID of the course.</param>
        /// <returns>List of Submissions.</returns>

        public static SubmissionList GetItemByCourse(string courseId)
        {
            SubmissionList mySubmissionList = null;

            using (SqlConnection myConnection = new SqlConnection(AppSettings.ConnectionString))
            {
                SqlCommand myCommand = new SqlCommand("spGetGradeGroupByCourse", myConnection);
                myCommand.CommandType = CommandType.StoredProcedure;
                myCommand.Parameters.AddWithValue("@courseID", courseId);
                myConnection.Open();
                using (SqlDataReader myDataReader = myCommand.ExecuteReader())
                {
                    if (myDataReader.HasRows)
                    {
                        mySubmissionList = new SubmissionList();
                        while (myDataReader.Read())
                        {
                            mySubmissionList.Add(FillRecordByCourse(myDataReader));
                        }
                    }
                    myDataReader.Close();
                }
                myConnection.Close();
            }
            return(mySubmissionList);
        }
Esempio n. 3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            SubmissionList slist = new SubmissionList();

            foreach (DataListItem item in dlGradeAssignmentByInstructor.Items)
            {
                Submission s = new Submission();
                s.Student.SId             = ((Label)item.FindControl("lblStudentID")).Text;
                s.Grade                   = Convert.ToDecimal(((TextBox)item.FindControl("txtBoxGrade")).Text);
                s.Assignment.AssignmentId = assignmentId;
                slist.Add(s);
            }
            SubmissionController.Save(slist);
            slist.Clear();
            Response.Redirect("~/Presentation/formAssignment.aspx");
        }
        public async Task OnGetAsync(int?id)
        {
            CurrentProfile = await profileDbContext.Profiles.SingleOrDefaultAsync(m => m.ID == 1);

            ID = (int)id;
            var tempList = await submissionDbContext.Submissions.ToListAsync();

            foreach (var submission in tempList)
            {
                if (submission.AssignmentID == ID)
                {
                    SubmissionList.Add(submission);
                }
            }
            SubmissionList.OrderBy(m => m.DateTime);
        }
Esempio n. 5
0
 /// <summary>
 /// Gets a list of Submissions of an assignment.
 /// </summary>
 /// <param name="assignmentId"> ID of an assignment.</param>
 /// <returns>List of Submissions.</returns>
 public static SubmissionList GetItem(int assignmentId)
 {
     SubmissionList mySubmissionList = null;
     using (SqlConnection myConnection = new SqlConnection(AppSettings.ConnectionString))
     {
         SqlCommand myCommand = new SqlCommand("spGetSubmissionAssignmentByAssignment", myConnection);
         myCommand.CommandType = CommandType.StoredProcedure;
         myCommand.Parameters.AddWithValue("@assignmentID", assignmentId);
         myConnection.Open();
         using (SqlDataReader myDataReader = myCommand.ExecuteReader())
         {
             if (myDataReader.HasRows)
             {
                 mySubmissionList = new SubmissionList();
                 while (myDataReader.Read())
                 {
                     mySubmissionList.Add(FillRecord(myDataReader));
                 }
             }
             myDataReader.Close();
         }
         myConnection.Close();
     }
     return mySubmissionList;
 }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            SubmissionList slist = new SubmissionList();
            foreach (DataListItem item in dlGradeAssignmentByInstructor.Items)
            {
                Submission s = new Submission();
                s.Student.SId = ((Label) item.FindControl("lblStudentID")).Text;
                s.Grade = Convert.ToDecimal(((TextBox) item.FindControl("txtBoxGrade")).Text);
                s.Assignment.AssignmentId = assignmentId;
                slist.Add(s);

            }
            SubmissionController.Save(slist);
            slist.Clear();
            Response.Redirect("~/Presentation/formAssignment.aspx");
        }