Esempio n. 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Loid,Name,Description,CourseInstanceId")] LearningOutcomes learningOutcomes)
        {
            if (id != learningOutcomes.Loid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try {
                    _context.Update(learningOutcomes);
                    await _context.SaveChangesAsync();
                } catch (DbUpdateConcurrencyException) {
                    if (!LearningOutcomesExists(learningOutcomes.Loid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CourseInstanceId"] = new SelectList(_context.CourseInstance, "CourseInstanceId", "Department", learningOutcomes.CourseInstanceId);
            return(View(learningOutcomes));
        }
        public async Task <IActionResult> Edit(int id, [Bind("LearningOutcomesID,Name,Description,CourseInstanceID")] LearningOutcomes learningOutcomes)
        {
            if (id != learningOutcomes.LearningOutcomesID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(learningOutcomes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LearningOutcomesExists(learningOutcomes.LearningOutcomesID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(learningOutcomes));
        }
        public async Task <IActionResult> Create([Bind("LearningOutcomesID,Name,Description,CourseInstanceID")] LearningOutcomes learningOutcomes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(learningOutcomes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(learningOutcomes));
        }
Esempio n. 4
0
        public async Task <IActionResult> Create([Bind("Loid,Name,Description,CourseInstanceId")] LearningOutcomes learningOutcomes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(learningOutcomes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CourseInstanceId"] = new SelectList(_context.CourseInstance, "CourseInstanceId", "Department", learningOutcomes.CourseInstanceId);
            return(View(learningOutcomes));
        }
        /// <summary>
        /// Updates the identified learning outcome's note along with the last modified date and last user
        /// modifying date.
        /// </summary>
        /// <param name="LearningOutcomeId"></param>
        /// <param name="NewNote"></param>
        /// <returns></returns>
        public JsonResult ChangeNote(int LearningOutcomeId, string NewNote)
        {
            LearningOutcomes lo = _context.LearningOutcomes.Include(l => l.LONotes)
                                  .Where(l => l.Loid == LearningOutcomeId).FirstOrDefault();

            if (lo == null)
            {
                return(Json(new { success = false }));
            }
            if (lo.LONotes.Count == 0)
            {
                lo.LONotes.Add(new LONotes());
            }
            lo.LONotes.First().Note             = NewNote;
            lo.LONotes.First().NoteModified     = DateTime.Now;
            lo.LONotes.First().NoteUserModified = User.Identity.Name;
            _context.SaveChanges();
            return(Json(new { success = true, noteContent = NewNote, modified = lo.LONotes.First().NoteModified, user = User.Identity.Name }));
        }
Esempio n. 6
0
        /// <summary>
        /// Updates the identified learning outcome's note along with the last modified date and last user
        /// modifying date.
        /// </summary>
        /// <param name="LearningOutcomeId"></param>
        /// <param name="NewNote"></param>
        /// <returns></returns>
        public JsonResult ChangeLONote(int LearningOutcomeId, string NewNote)
        {
            //Finds the associated learning outcome. The user must be an instructor and the course cannot be archived.
            LearningOutcomes lo = _context.LearningOutcomes.Where(l => l.Loid == LearningOutcomeId).Include(l => l.LONotes)
                                  .Where(l => l.CourseInstance.Instructors.Where(ins => ins.User.UserLoginEmail == User.Identity.Name).Any() &&
                                         l.CourseInstance.Status.Status != CourseStatusNames.Archived)
                                  .FirstOrDefault();

            if (lo == null)
            {
                return(Json(new { success = false }));
            }
            if (lo.LONotes.Count == 0)
            {
                lo.LONotes.Add(new LONotes());
            }
            lo.LONotes.First().Note             = NewNote;
            lo.LONotes.First().NoteModified     = DateTime.Now;
            lo.LONotes.First().NoteUserModified = User.Identity.Name;
            _context.SaveChanges();
            return(Json(new { success = true, noteContent = NewNote, modified = lo.LONotes.First().NoteModified, user = User.Identity.Name }));
        }
Esempio n. 7
0
        public async Task <IActionResult> CreateEvaluationMetric(int?courseId, int?loid, string name, string description, IFormFile assignmentFile)
        {
            if (courseId == null || loid == null || assignmentFile == null || description == null)
            {
                return(Json(new { success = false }));
            }
            //Verify instructor
            CourseInstance course = _context.CourseInstance.Include(c => c.Instructors).ThenInclude(i => i.User)
                                    .Where(c => c.CourseInstanceId == courseId).FirstOrDefault();

            if (course == null)
            {
                return(Json(new { success = false }));
            }
            Instructors inst = course.Instructors.Where(i => i.User.UserLoginEmail == User.Identity.Name).FirstOrDefault();

            if (inst == null)
            {
                return(Json(new { success = false }));
            }

            LearningOutcomes loObj = _context.LearningOutcomes.Include(l => l.CourseInstance)
                                     .Where(l => loid == l.Loid && l.CourseInstance.Instructors.Contains(inst)).FirstOrDefault();

            if (loObj == null)
            {
                return(Json(new { success = false }));
            }

            EvaluationMetrics em = new EvaluationMetrics();

            em.Name        = name;
            em.Description = description;
            em.Lo          = loObj;


            int?emid = null;

            if (assignmentFile != null)
            {
                string filename = assignmentFile.FileName;
                if (assignmentFile.Length > 0)
                {
                    using (var stream = new MemoryStream())
                    {
                        await assignmentFile.CopyToAsync(stream);

                        em.FileName    = assignmentFile.FileName;
                        em.ContentType = assignmentFile.ContentType;
                        em.FileContent = stream.ToArray();
                    }
                }

                _context.EvaluationMetrics.Add(em);
                _context.SaveChanges();
                emid = em.Emid;
            }



            return(RedirectToAction("EvaluationMetrics", new { emId = emid }));
        }
Esempio n. 8
0
        public static void Initialize(CourseContext context)
        {
            context.Database.Migrate();

            // Look for any courses.
            if (context.Courses.Any())
            {
                return;   // DB has been seeded
            }

            // Generates a sample course note for the first course in the table
            CourseNoteModel courseNote = new CourseNoteModel();

            courseNote.Note = "This course has a lot of learning outcomes";

            // Create courses
            var courses = new CourseInstance[]
            {
                new CourseInstance {
                    Dept = "CS", Number = 4540, Semester = "Spring", Year = 2019, Description = "Web Software Architexture", InstructorEmail = "*****@*****.**", Note = courseNote
                },
                new CourseInstance {
                    Dept = "CS", Number = 2420, Semester = "Spring", Year = 2020, Description = "Data Structures and Algorithms", InstructorEmail = "*****@*****.**"
                },
                new CourseInstance {
                    Dept = "CS", Number = 3500, Semester = "Spring", Year = 2019, Description = "Software Practice", InstructorEmail = "*****@*****.**"
                },
                new CourseInstance {
                    Dept = "CS", Number = 2100, Semester = "Fall", Year = 2019, Description = "Discrete Structures", InstructorEmail = "*****@*****.**"
                },
                new CourseInstance {
                    Dept = "CS", Number = 4400, Semester = "Fall", Year = 2019, Description = "Computer Systems", InstructorEmail = "*****@*****.**"
                },
                new CourseInstance {
                    Dept = "CS", Number = 3500, Semester = "Fall", Year = 2019, Description = "Software Practice", InstructorEmail = "*****@*****.**"
                },
            };

            foreach (CourseInstance s in courses)
            {
                context.Courses.Add(s);
            }
            context.SaveChanges();

            // Get Course IDs for courses
            int ID4540  = courses[0].CourseInstanceID;
            int ID2420  = courses[1].CourseInstanceID;
            int ID3500  = courses[2].CourseInstanceID;
            int ID2100  = courses[3].CourseInstanceID;
            int ID4400  = courses[4].CourseInstanceID;
            int ID35002 = courses[5].CourseInstanceID;

            // Generates a sample learning outcome note for the first learning outcome.
            LearningOutcomeNoteModel loNote = new LearningOutcomeNoteModel();

            loNote.Note = "This learning outcome needs to be updated and reviewed again";

            // Create learning outcomes
            var lo = new LearningOutcomes[]
            {
                new LearningOutcomes {
                    Name = "Logic", Description = "use symbolic logic to model real-world situations by converting informal language statements to propositional and predicate logic expressions, as well as apply formal methods to propositions and predicates (such as computing normal forms and calculating validity)", CourseInstanceID = ID2100
                },
                new LearningOutcomes {
                    Name = "Relations", Description = "analyze problems to determine underlying recurrence relations, as well as solve such relations by rephrasing as closed formulas", CourseInstanceID = ID2100
                },
                new LearningOutcomes {
                    Name = "Sets", Description = "assign practical examples to the appropriate set, function, or relation model, while employing the associated terminology and operations", CourseInstanceID = ID2100
                },
                new LearningOutcomes {
                    Name = "Permutations", Description = "map real-world applications to appropriate counting formalisms, including permutations and combinations of sets, as well as exercise the rules of combinatorics (such as sums, products, and inclusion-exclusion)", CourseInstanceID = ID2100
                },
                new LearningOutcomes {
                    Name = "Events", Description = "calculate probabilities of independent and dependent events, in addition to expectations of random variables", CourseInstanceID = ID2100
                },
                new LearningOutcomes {
                    Name = "Data Structures", Description = "implement, and analyze for efficiency, fundamental data structures (including lists, graphs, and trees) and algorithms (including searching, sorting, and hashing)", CourseInstanceID = ID2420
                },
                new LearningOutcomes {
                    Name = "BigO", Description = "employ Big-O notation to describe and compare the asymptotic complexity of algorithms, as well as perform empirical studies to validate hypotheses about running time", CourseInstanceID = ID2420
                },
                new LearningOutcomes {
                    Name = "Abstract", Description = "recognize and describe common applications of abstract data types (including stacks, queues, priority queues, sets, and maps)", CourseInstanceID = ID2420
                },
                new LearningOutcomes {
                    Name = "Real", Description = "apply algorithmic solutions to real-world data", CourseInstanceID = ID2420
                },
                new LearningOutcomes {
                    Name = "Generics", Description = "use generics to abstract over functions that differ only in their types", CourseInstanceID = ID2420
                },
                new LearningOutcomes {
                    Name = "Pairs", Description = "appreciate the collaborative nature of computer science by discussing the benefits of pair programming", CourseInstanceID = ID2420
                },
                new LearningOutcomes {
                    Name = "Large Programs", Description = "design and implement large and complex software systems (including concurrent software) through the use of process models (such as waterfall and agile), libraries (both standard and custom), and modern software development tools (such as debuggers, profilers, and revision control systems)", CourseInstanceID = ID3500
                },
                new LearningOutcomes {
                    Name = "Testing", Description = "perform input validation and error handling, as well as employ advanced testing principles and tools to systematically evaluate software", CourseInstanceID = ID3500
                },
                new LearningOutcomes {
                    Name = "MVC", Description = "apply the model-view-controller pattern and event handling fundamentals to create a graphical user interface", CourseInstanceID = ID3500
                },
                new LearningOutcomes {
                    Name = "CSM", Description = "exercise the client-server model and high-level networking APIs to build a web-based software system", CourseInstanceID = ID3500
                },
                new LearningOutcomes {
                    Name = "DB", Description = "operate a modern relational database to define relations, as well as store and retrieve data", CourseInstanceID = ID3500
                },
                new LearningOutcomes {
                    Name = "Peer", Description = "appreciate the collaborative nature of software development by discussing the benefits of peer code reviews", CourseInstanceID = ID3500
                },
                new LearningOutcomes {
                    Name = "OS", Description = "explain the objectives and functions of abstraction layers in modern computing systems, including operating systems, programming languages, compilers, and applications", CourseInstanceID = ID4400
                },
                new LearningOutcomes {
                    Name = "Mem", Description = "understand cross-layer communications and how each layer of abstraction is implemented in the next layer of abstraction (such as how C programs are translated into assembly code and how C library allocators are implemented in terms of operating system memory management)", CourseInstanceID = ID4400
                },
                new LearningOutcomes {
                    Name = "Performance", Description = "analyze how the performance characteristics of one layer of abstraction affect the layers above it (such as how caching and services of the operating system affect the performance of C programs)", CourseInstanceID = ID4400
                },
                new LearningOutcomes {
                    Name = "Os Concepts", Description = "construct applications using operating-system concepts (such as processes, threads, signals, virtual memory, I/O)", CourseInstanceID = ID4400
                },
                new LearningOutcomes {
                    Name = "Applications", Description = "synthesize operating-system and networking facilities to build concurrent, communicating applications", CourseInstanceID = ID4400
                },
                new LearningOutcomes {
                    Name = "Synchronization", Description = "implement reliable concurrent and parallel programs using appropriate synchronization constructs", CourseInstanceID = ID4400
                },
                new LearningOutcomes {
                    Name = "HTML/CSS", Description = "Construct web pages using modern HTML and CSS practices, including modern frameworks.", CourseInstanceID = ID4540, Note = loNote
                },
                new LearningOutcomes {
                    Name = "Accessability", Description = "Define accessibility and utilize techniques to create accessible web pages.", CourseInstanceID = ID4540
                },
                new LearningOutcomes {
                    Name = "MVC", Description = "Outline and utilize MVC technologies across the “full-stack” of web design (including front-end, back-end, and databases) to create interesting web applications. Deploy an application to a “Cloud” provider.", CourseInstanceID = ID4540
                },
                new LearningOutcomes {
                    Name = "Security", Description = "Describe the browser security model and HTTP; utilize techniques for data validation, secure session communication, cookies, single sign-on, and separate roles.  ", CourseInstanceID = ID4540
                },
                new LearningOutcomes {
                    Name = "JavaScript", Description = "Utilize JavaScript for simple page manipulations and AJAX for more complex/complete “single-page” applications.", CourseInstanceID = ID4540
                },
                new LearningOutcomes {
                    Name = "Pages", Description = "Demonstrate how responsive techniques can be used to construct applications that are usable at a variety of page sizes.  Define and discuss responsive, reactive, and adaptive.", CourseInstanceID = ID4540
                },
                new LearningOutcomes {
                    Name = "Web Crawler", Description = "Construct a simple web-crawler for validation of page functionality and data scraping.", CourseInstanceID = ID4540
                },
                new LearningOutcomes {
                    Name = "Large Programs", Description = "design and implement large and complex software systems (including concurrent software) through the use of process models (such as waterfall and agile), libraries (both standard and custom), and modern software development tools (such as debuggers, profilers, and revision control systems)", CourseInstanceID = ID35002
                },
                new LearningOutcomes {
                    Name = "Testing", Description = "perform input validation and error handling, as well as employ advanced testing principles and tools to systematically evaluate software", CourseInstanceID = ID35002
                },
                new LearningOutcomes {
                    Name = "MVC", Description = "apply the model-view-controller pattern and event handling fundamentals to create a graphical user interface", CourseInstanceID = ID35002
                },
                new LearningOutcomes {
                    Name = "CSM", Description = "exercise the client-server model and high-level networking APIs to build a web-based software system", CourseInstanceID = ID35002
                },
                new LearningOutcomes {
                    Name = "DB", Description = "operate a modern relational database to define relations, as well as store and retrieve data", CourseInstanceID = ID35002
                },
                new LearningOutcomes {
                    Name = "Peer", Description = "appreciate the collaborative nature of software development by discussing the benefits of peer code reviews", CourseInstanceID = ID35002
                },
            };

            foreach (LearningOutcomes c in lo)
            {
                context.Descriptions.Add(c);
            }
            context.SaveChanges();
        }