├── README.md ├── SmartLMS ├── Views │ ├── _ViewStart.cshtml │ ├── Manage │ │ └── Index.cshtml │ ├── StudentDashboard │ │ ├── Lectures.cshtml │ │ ├── _ChoicePartial.cshtml │ │ ├── Index.cshtml │ │ ├── Enroll.cshtml │ │ ├── _VideoPartial.cshtml │ │ ├── _QuestionPartial.cshtml │ │ ├── QuizHistory.cshtml │ │ ├── TakeQuiz.cshtml │ │ ├── SeeQuiz.cshtml │ │ ├── Assignments.cshtml │ │ ├── CourseDetails.cshtml │ │ ├── Courses.cshtml │ │ └── SeeLectures.cshtml │ ├── Home │ │ ├── About.cshtml │ │ ├── Contact.cshtml │ │ ├── Index.cshtml │ │ └── Course.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _AdminPartial.cshtml │ │ ├── _LoginPartial.cshtml │ │ ├── _LecturerPartial.cshtml │ │ ├── _StudentPartial.cshtml │ │ └── _Layout.cshtml │ ├── LecturerDashboard │ │ └── Index.cshtml │ ├── Categories │ │ ├── Details.cshtml │ │ ├── Delete.cshtml │ │ ├── Index.cshtml │ │ ├── Create.cshtml │ │ └── Edit.cshtml │ ├── Questions │ │ ├── Details.cshtml │ │ ├── Delete.cshtml │ │ ├── Index.cshtml │ │ ├── Create.cshtml │ │ └── Edit.cshtml │ ├── Courses │ │ ├── Delete.cshtml │ │ ├── Index.cshtml │ │ └── Details.cshtml │ ├── Lectures │ │ ├── Details.cshtml │ │ ├── Delete.cshtml │ │ └── Index.cshtml │ ├── Account │ │ ├── ForgotPassword.cshtml │ │ ├── Register.cshtml │ │ └── RegisterAsLecturer.cshtml │ ├── Quizs │ │ ├── Index.cshtml │ │ └── Details.cshtml │ ├── AnswerChoices │ │ ├── Index.cshtml │ │ └── Create.cshtml │ ├── Assignments │ │ ├── Index.cshtml │ │ └── Details.cshtml │ └── Web.config ├── favicon.ico ├── Scripts │ └── _references.js ├── Global.asax ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── Areas │ ├── HelpPage │ │ ├── Views │ │ │ ├── Help │ │ │ │ ├── DisplayTemplates │ │ │ │ │ ├── ImageSample.cshtml │ │ │ │ │ ├── TextSample.cshtml │ │ │ │ │ ├── SimpleTypeModelDescription.cshtml │ │ │ │ │ ├── ComplexTypeModelDescription.cshtml │ │ │ │ │ ├── CollectionModelDescription.cshtml │ │ │ │ │ ├── InvalidSample.cshtml │ │ │ │ │ ├── KeyValuePairModelDescription.cshtml │ │ │ │ │ ├── DictionaryModelDescription.cshtml │ │ │ │ │ ├── EnumTypeModelDescription.cshtml │ │ │ │ │ ├── Samples.cshtml │ │ │ │ │ ├── ModelDescriptionLink.cshtml │ │ │ │ │ ├── ApiGroup.cshtml │ │ │ │ │ ├── Parameters.cshtml │ │ │ │ │ └── HelpPageApiModel.cshtml │ │ │ │ ├── ResourceModel.cshtml │ │ │ │ ├── Api.cshtml │ │ │ │ └── Index.cshtml │ │ │ ├── _ViewStart.cshtml │ │ │ ├── Shared │ │ │ │ └── _Layout.cshtml │ │ │ └── Web.config │ │ ├── ModelDescriptions │ │ │ ├── SimpleTypeModelDescription.cs │ │ │ ├── DictionaryModelDescription.cs │ │ │ ├── CollectionModelDescription.cs │ │ │ ├── ParameterAnnotation.cs │ │ │ ├── EnumValueDescription.cs │ │ │ ├── KeyValuePairModelDescription.cs │ │ │ ├── IModelDocumentationProvider.cs │ │ │ ├── ModelDescription.cs │ │ │ ├── ComplexTypeModelDescription.cs │ │ │ ├── EnumTypeModelDescription.cs │ │ │ ├── ModelNameAttribute.cs │ │ │ ├── ParameterDescription.cs │ │ │ └── ModelNameHelper.cs │ │ ├── SampleGeneration │ │ │ ├── SampleDirection.cs │ │ │ ├── TextSample.cs │ │ │ ├── InvalidSample.cs │ │ │ └── ImageSample.cs │ │ ├── HelpPageAreaRegistration.cs │ │ ├── ApiDescriptionExtensions.cs │ │ └── Controllers │ │ │ └── HelpController.cs │ └── Admin │ │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── Users │ │ │ ├── Roles.cshtml │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ └── _Layout.cshtml │ │ └── web.config │ │ ├── Models │ │ ├── CreateUserModel.cs │ │ └── EditUserModel.cs │ │ ├── AdminAreaRegistration.cs │ │ └── Controllers │ │ └── UsersController.cs ├── Content │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── bootstrap │ │ ├── mixins │ │ │ ├── center-block.less │ │ │ ├── size.less │ │ │ ├── opacity.less │ │ │ ├── text-emphasis.less │ │ │ ├── text-overflow.less │ │ │ ├── background-variant.less │ │ │ ├── labels.less │ │ │ ├── resize.less │ │ │ ├── progress-bar.less │ │ │ ├── nav-divider.less │ │ │ ├── reset-filter.less │ │ │ ├── alerts.less │ │ │ ├── tab-focus.less │ │ │ ├── nav-vertical-align.less │ │ │ ├── responsive-visibility.less │ │ │ ├── border-radius.less │ │ │ ├── reset-text.less │ │ │ ├── pagination.less │ │ │ ├── panels.less │ │ │ ├── hide-text.less │ │ │ ├── list-group.less │ │ │ ├── clearfix.less │ │ │ ├── table-row.less │ │ │ ├── image.less │ │ │ └── buttons.less │ │ ├── wells.less │ │ ├── breadcrumbs.less │ │ ├── responsive-embed.less │ │ ├── component-animations.less │ │ ├── close.less │ │ ├── thumbnails.less │ │ ├── utilities.less │ │ ├── pager.less │ │ ├── media.less │ │ ├── mixins.less │ │ ├── labels.less │ │ ├── jumbotron.less │ │ ├── badges.less │ │ ├── bootstrap.less │ │ ├── code.less │ │ ├── grid.less │ │ ├── alerts.less │ │ ├── progress-bars.less │ │ └── pagination.less │ ├── bootstrap-datetimepicker-build.less │ └── Site.css ├── Infrastructure │ ├── Enums │ │ └── AlertType.cs │ ├── BaseTypes │ │ └── SaveableModel.cs │ ├── Mapping │ │ └── AutoMapperConfiguration.cs │ └── Video │ │ └── VideoResult.cs ├── App_Start │ ├── FilterConfig.cs │ ├── RouteConfig.cs │ ├── WebApiConfig.cs │ ├── BundleConfig.cs │ └── NinjectWebCommon.cs ├── Models │ ├── Subscribe.cs │ ├── StudentAssignment.cs │ ├── StudentQuiz.cs │ ├── Category.cs │ ├── Contact.cs │ ├── ADLog.cs │ ├── AnswerChoice.cs │ ├── Question.cs │ ├── Rating.cs │ ├── Certificate.cs │ ├── Lecture.cs │ ├── Assignment.cs │ ├── StudentCourse.cs │ ├── Quiz.cs │ ├── Core │ │ └── IdentityGenerator.cs │ └── Course.cs ├── Startup.cs ├── ViewModels │ ├── CategoryViewModel.cs │ ├── SeeLectureViewModel.cs │ ├── QuizTakingVM.cs │ ├── ExamTakingModel.cs │ └── CourseViewModel.cs ├── Data │ └── Repository │ │ ├── ISmartLMSData.cs │ │ ├── IRepository.cs │ │ └── CommonRepository.cs ├── Controllers │ ├── LecturerDashboardController.cs │ ├── ValuesController.cs │ ├── HomeController.cs │ ├── ManageController.cs │ └── BaseController.cs ├── Global.asax.cs ├── Migrations │ └── 201702180812115_inital_create_db.Designer.cs ├── Results │ └── ChallengeResult.cs ├── Web.Debug.config ├── Web.Release.config └── Properties │ └── AssemblyInfo.cs ├── .gitattributes ├── SmartLMS.Tests ├── Controllers │ ├── HomeControllerTest.cs │ └── ValuesControllerTest.cs ├── Properties │ └── AssemblyInfo.cs ├── packages.config └── App_Start │ └── NinjectWebCommon.cs ├── LICENSE └── SmartLMS.sln /README.md: -------------------------------------------------------------------------------- 1 | # SmartLMS 2 | Learning Management System 3 | -------------------------------------------------------------------------------- /SmartLMS/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /SmartLMS/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arifgit12/SmartLMS/HEAD/SmartLMS/favicon.ico -------------------------------------------------------------------------------- /SmartLMS/Scripts/_references.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arifgit12/SmartLMS/HEAD/SmartLMS/Scripts/_references.js -------------------------------------------------------------------------------- /SmartLMS/Views/Manage/Index.cshtml: -------------------------------------------------------------------------------- 1 | 2 | @{ 3 | ViewBag.Title = "Index"; 4 | } 5 | 6 |

Index

7 | 8 | -------------------------------------------------------------------------------- /SmartLMS/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="SmartLMS.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /SmartLMS/Views/StudentDashboard/Lectures.cshtml: -------------------------------------------------------------------------------- 1 | 2 | @{ 3 | ViewBag.Title = "Lectures"; 4 | } 5 | 6 |

Lectures

7 | 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.cs linguist-language=csharp 2 | 3 | SmartLMS/Content/* linguist-vendored 4 | SmartLMS/Scripts/* linguist-vendored 5 | -------------------------------------------------------------------------------- /SmartLMS/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arifgit12/SmartLMS/HEAD/SmartLMS/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /SmartLMS/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arifgit12/SmartLMS/HEAD/SmartLMS/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /SmartLMS/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arifgit12/SmartLMS/HEAD/SmartLMS/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /SmartLMS/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arifgit12/SmartLMS/HEAD/SmartLMS/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/DisplayTemplates/ImageSample.cshtml: -------------------------------------------------------------------------------- 1 | @using SmartLMS.Areas.HelpPage 2 | @model ImageSample 3 | 4 | -------------------------------------------------------------------------------- /SmartLMS/Areas/Admin/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | //Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; 3 | Layout = "~/Views/Shared/_Layout.cshtml"; 4 | } -------------------------------------------------------------------------------- /SmartLMS/Content/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arifgit12/SmartLMS/HEAD/SmartLMS/Content/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /SmartLMS/Content/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arifgit12/SmartLMS/HEAD/SmartLMS/Content/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /SmartLMS/Content/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arifgit12/SmartLMS/HEAD/SmartLMS/Content/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /SmartLMS/Content/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arifgit12/SmartLMS/HEAD/SmartLMS/Content/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/DisplayTemplates/TextSample.cshtml: -------------------------------------------------------------------------------- 1 | @using SmartLMS.Areas.HelpPage 2 | @model TextSample 3 | 4 |
5 | @Model.Text
6 | 
-------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/DisplayTemplates/SimpleTypeModelDescription.cshtml: -------------------------------------------------------------------------------- 1 | @using SmartLMS.Areas.HelpPage.ModelDescriptions 2 | @model SimpleTypeModelDescription 3 | @Model.Documentation -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/center-block.less: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | .center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | // Change the Layout path below to blend the look and feel of the help page with your existing web pages 3 | Layout = "~/Views/Shared/_Layout.cshtml"; 4 | } -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/ModelDescriptions/SimpleTypeModelDescription.cs: -------------------------------------------------------------------------------- 1 | namespace SmartLMS.Areas.HelpPage.ModelDescriptions 2 | { 3 | public class SimpleTypeModelDescription : ModelDescription 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/size.less: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | .size(@width; @height) { 4 | width: @width; 5 | height: @height; 6 | } 7 | 8 | .square(@size) { 9 | .size(@size; @size); 10 | } 11 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/DisplayTemplates/ComplexTypeModelDescription.cshtml: -------------------------------------------------------------------------------- 1 | @using SmartLMS.Areas.HelpPage.ModelDescriptions 2 | @model ComplexTypeModelDescription 3 | @Html.DisplayFor(m => m.Properties, "Parameters") -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/opacity.less: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | .opacity(@opacity) { 4 | opacity: @opacity; 5 | // IE8 filter 6 | @opacity-ie: (@opacity * 100); 7 | filter: ~"alpha(opacity=@{opacity-ie})"; 8 | } 9 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/text-emphasis.less: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | .text-emphasis-variant(@color) { 4 | color: @color; 5 | a&:hover, 6 | a&:focus { 7 | color: darken(@color, 10%); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/ModelDescriptions/DictionaryModelDescription.cs: -------------------------------------------------------------------------------- 1 | namespace SmartLMS.Areas.HelpPage.ModelDescriptions 2 | { 3 | public class DictionaryModelDescription : KeyValuePairModelDescription 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /SmartLMS/Views/StudentDashboard/_ChoicePartial.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.Models.AnswerChoice 2 | 3 | @Html.RadioButtonFor(modelItem => Model.Choices, Model.AnswerChoiceId)   4 | @Html.DisplayFor(modelItem => Model.Choices)  -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/text-overflow.less: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | .text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/background-variant.less: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | .bg-variant(@color) { 4 | background-color: @color; 5 | a&:hover, 6 | a&:focus { 7 | background-color: darken(@color, 10%); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/labels.less: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | .label-variant(@color) { 4 | background-color: @color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken(@color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/resize.less: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | .resizable(@direction) { 4 | resize: @direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /SmartLMS/Views/StudentDashboard/Index.cshtml: -------------------------------------------------------------------------------- 1 | 2 | @{ 3 | ViewBag.Title = "Dashboard"; 4 | } 5 | 6 |
7 |
8 |

@ViewBag.Title

9 |
10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /SmartLMS/Areas/Admin/Models/CreateUserModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace SmartLMS.Areas.Admin.Models 7 | { 8 | public class CreateUserModel 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /SmartLMS/Views/StudentDashboard/Enroll.cshtml: -------------------------------------------------------------------------------- 1 | 2 | @{ 3 | ViewBag.Title = "Enroll Course"; 4 | } 5 | 6 |
7 |
8 |

@ViewBag.Title

9 |
10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/ModelDescriptions/CollectionModelDescription.cs: -------------------------------------------------------------------------------- 1 | namespace SmartLMS.Areas.HelpPage.ModelDescriptions 2 | { 3 | public class CollectionModelDescription : ModelDescription 4 | { 5 | public ModelDescription ElementDescription { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/progress-bar.less: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | .progress-bar-variant(@color) { 4 | background-color: @color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | #gradient > .striped(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/DisplayTemplates/CollectionModelDescription.cshtml: -------------------------------------------------------------------------------- 1 | @using SmartLMS.Areas.HelpPage.ModelDescriptions 2 | @model CollectionModelDescription 3 | @if (Model.ElementDescription is ComplexTypeModelDescription) 4 | { 5 | @Html.DisplayFor(m => m.ElementDescription) 6 | } -------------------------------------------------------------------------------- /SmartLMS/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | 2 | @{ 3 | ViewBag.Title = "About"; 4 | } 5 | 6 |
7 |
8 |

@ViewBag.Title.

9 |
10 | 11 |

Use this area to provide additional information.

12 |
13 |
14 | 15 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/nav-divider.less: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | .nav-divider(@color: #e5e5e5) { 6 | height: 1px; 7 | margin: ((@line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: @color; 10 | } 11 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/reset-filter.less: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | .reset-filter() { 7 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); 8 | } 9 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/SampleGeneration/SampleDirection.cs: -------------------------------------------------------------------------------- 1 | namespace SmartLMS.Areas.HelpPage 2 | { 3 | /// 4 | /// Indicates whether the sample is used for request or response 5 | /// 6 | public enum SampleDirection 7 | { 8 | Request = 0, 9 | Response 10 | } 11 | } -------------------------------------------------------------------------------- /SmartLMS/Infrastructure/Enums/AlertType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace SmartLMS.Infrastructure.Enums 7 | { 8 | public enum AlertType 9 | { 10 | Success, 11 | Info, 12 | Warning, 13 | Danger 14 | } 15 | } -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/ModelDescriptions/ParameterAnnotation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SmartLMS.Areas.HelpPage.ModelDescriptions 4 | { 5 | public class ParameterAnnotation 6 | { 7 | public Attribute AnnotationAttribute { get; set; } 8 | 9 | public string Documentation { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /SmartLMS/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | 2 | @{ 3 | ViewBag.Title = "Contact"; 4 | } 5 | 6 |
7 |
8 |

@ViewBag.Title

9 |
10 | 11 |
12 | arifali.mondal@gmail.com 13 |
14 |
15 |
16 | 17 | -------------------------------------------------------------------------------- /SmartLMS/Views/StudentDashboard/_VideoPartial.cshtml: -------------------------------------------------------------------------------- 1 | @model string 2 | @{ 3 | var basepath = "~/Content/Uploads/Lecturers/"; 4 | } 5 | 6 | 9 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/ModelDescriptions/EnumValueDescription.cs: -------------------------------------------------------------------------------- 1 | namespace SmartLMS.Areas.HelpPage.ModelDescriptions 2 | { 3 | public class EnumValueDescription 4 | { 5 | public string Documentation { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public string Value { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /SmartLMS/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace SmartLMS 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @ViewBag.Title 7 | @RenderSection("scripts", required: false) 8 | 9 | 10 | @RenderBody() 11 | 12 | -------------------------------------------------------------------------------- /SmartLMS/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 |
9 |

Error.

10 |

An error occurred while processing your request.

11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/DisplayTemplates/InvalidSample.cshtml: -------------------------------------------------------------------------------- 1 | @using SmartLMS.Areas.HelpPage 2 | @model InvalidSample 3 | 4 | @if (HttpContext.Current.IsDebuggingEnabled) 5 | { 6 |
7 |

@Model.ErrorMessage

8 |
9 | } 10 | else 11 | { 12 |

Sample not available.

13 | } -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/ModelDescriptions/KeyValuePairModelDescription.cs: -------------------------------------------------------------------------------- 1 | namespace SmartLMS.Areas.HelpPage.ModelDescriptions 2 | { 3 | public class KeyValuePairModelDescription : ModelDescription 4 | { 5 | public ModelDescription KeyModelDescription { get; set; } 6 | 7 | public ModelDescription ValueModelDescription { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SmartLMS/Models/Subscribe.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace SmartLMS.Models 8 | { 9 | public class Subscribe 10 | { 11 | [Key] 12 | [Required] 13 | public string Email { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/ModelDescriptions/IModelDocumentationProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | 4 | namespace SmartLMS.Areas.HelpPage.ModelDescriptions 5 | { 6 | public interface IModelDocumentationProvider 7 | { 8 | string GetDocumentation(MemberInfo member); 9 | 10 | string GetDocumentation(Type type); 11 | } 12 | } -------------------------------------------------------------------------------- /SmartLMS/Views/Shared/_AdminPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using SmartLMS.Models 2 | 3 | @if (User.IsInRole(UserRoles.Administrator.ToString())) 4 | { 5 |
  • @Html.ActionLink("Home", "Index", "Home", new { Area = "" }, new { })
  • 6 |
  • @Html.ActionLink("Courses", "Course", "Home", new { Area = "" }, new { })
  • 7 |
  • @Html.ActionLink("Categories", "Index", "Categories", new { Area = "" }, new { })
  • 8 | } 9 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/tab-focus.less: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | .tab-focus() { 4 | // WebKit-specific. Other browsers will keep their default outline style. 5 | // (Initially tried to also force default via `outline: initial`, 6 | // but that seems to erroneously remove the outline in Firefox altogether.) 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /SmartLMS/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Microsoft.Owin; 5 | using Owin; 6 | 7 | [assembly: OwinStartup(typeof(SmartLMS.Startup))] 8 | 9 | namespace SmartLMS 10 | { 11 | public partial class Startup 12 | { 13 | public void Configuration(IAppBuilder app) 14 | { 15 | ConfigureAuth(app); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SmartLMS/ViewModels/CategoryViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace SmartLMS.ViewModels 5 | { 6 | public class CategoryViewModel 7 | { 8 | [Display(Name = "Category")] 9 | public int CategoryId { get; set; } 10 | 11 | [Required] 12 | [Display(Name = "Category Name")] 13 | public string CategoryName { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/ModelDescriptions/ModelDescription.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SmartLMS.Areas.HelpPage.ModelDescriptions 4 | { 5 | /// 6 | /// Describes a type model. 7 | /// 8 | public abstract class ModelDescription 9 | { 10 | public string Documentation { get; set; } 11 | 12 | public Type ModelType { get; set; } 13 | 14 | public string Name { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/nav-vertical-align.less: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | .navbar-vertical-align(@element-height) { 7 | margin-top: ((@navbar-height - @element-height) / 2); 8 | margin-bottom: ((@navbar-height - @element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /SmartLMS/Models/StudentAssignment.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace SmartLMS.Models 7 | { 8 | public class StudentAssignment 9 | { 10 | public string StudentId { get; set; } 11 | public ApplicationUser Student { get; set; } 12 | public int AssignmentId { get; set; } 13 | public Assignment Assignment { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/DisplayTemplates/KeyValuePairModelDescription.cshtml: -------------------------------------------------------------------------------- 1 | @using SmartLMS.Areas.HelpPage.ModelDescriptions 2 | @model KeyValuePairModelDescription 3 | Pair of @Html.DisplayFor(m => Model.KeyModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.KeyModelDescription }) [key] 4 | and @Html.DisplayFor(m => Model.ValueModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ValueModelDescription }) [value] -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/DisplayTemplates/DictionaryModelDescription.cshtml: -------------------------------------------------------------------------------- 1 | @using SmartLMS.Areas.HelpPage.ModelDescriptions 2 | @model DictionaryModelDescription 3 | Dictionary of @Html.DisplayFor(m => Model.KeyModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.KeyModelDescription }) [key] 4 | and @Html.DisplayFor(m => Model.ValueModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ValueModelDescription }) [value] -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/responsive-visibility.less: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | .responsive-visibility() { 6 | display: block !important; 7 | table& { display: table !important; } 8 | tr& { display: table-row !important; } 9 | th&, 10 | td& { display: table-cell !important; } 11 | } 12 | 13 | .responsive-invisibility() { 14 | display: none !important; 15 | } 16 | -------------------------------------------------------------------------------- /SmartLMS/Models/StudentQuiz.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace SmartLMS.Models 7 | { 8 | public class StudentQuiz 9 | { 10 | public int QuizId { get; set; } 11 | public virtual Quiz Quiz { get; set; } 12 | public string StudentId { get; set; } 13 | public ApplicationUser Student { get; set; } 14 | public double Marks { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /SmartLMS/Models/Category.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace SmartLMS.Models 8 | { 9 | public class Category 10 | { 11 | [Key] 12 | [Required] 13 | public int CategoryId { get; set; } 14 | [Required] 15 | public string CategoryName { get; set; } 16 | public Category ParentCategory { get; set; } = null; 17 | } 18 | } -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/ModelDescriptions/ComplexTypeModelDescription.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace SmartLMS.Areas.HelpPage.ModelDescriptions 4 | { 5 | public class ComplexTypeModelDescription : ModelDescription 6 | { 7 | public ComplexTypeModelDescription() 8 | { 9 | Properties = new Collection(); 10 | } 11 | 12 | public Collection Properties { get; private set; } 13 | } 14 | } -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/ModelDescriptions/EnumTypeModelDescription.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.ObjectModel; 3 | 4 | namespace SmartLMS.Areas.HelpPage.ModelDescriptions 5 | { 6 | public class EnumTypeModelDescription : ModelDescription 7 | { 8 | public EnumTypeModelDescription() 9 | { 10 | Values = new Collection(); 11 | } 12 | 13 | public Collection Values { get; private set; } 14 | } 15 | } -------------------------------------------------------------------------------- /SmartLMS/Infrastructure/BaseTypes/SaveableModel.cs: -------------------------------------------------------------------------------- 1 | using SmartLMS.Infrastructure.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | using System.Linq; 6 | using System.Web; 7 | 8 | namespace SmartLMS.Infrastructure.BaseTypes 9 | { 10 | public abstract class SaveableModel 11 | { 12 | [NotMapped] 13 | public string SaveMessage { get; set; } 14 | [NotMapped] 15 | public AlertType MessageType { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /SmartLMS/Models/Contact.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace SmartLMS.Models 8 | { 9 | public class Contact 10 | { 11 | 12 | [Required] 13 | public string ContactName { get; set; } 14 | 15 | [Key] 16 | [Required] 17 | public string ContactEmail { get; set; } 18 | [Required] 19 | public string ContactMessage { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap-datetimepicker-build.less: -------------------------------------------------------------------------------- 1 | // Import bootstrap variables including default color palette and fonts 2 | @import "bootstrap/less/variables.less"; 3 | 4 | // Import datepicker component 5 | @import "_bootstrap-datetimepicker.less"; 6 | 7 | //this is here so the compiler doesn't complain about a missing bootstrap mixin 8 | .sr-only { 9 | position: absolute; 10 | width: 1px; 11 | height: 1px; 12 | margin: -1px; 13 | padding: 0; 14 | overflow: hidden; 15 | clip: rect(0,0,0,0); 16 | border: 0; 17 | } 18 | -------------------------------------------------------------------------------- /SmartLMS/Models/ADLog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace SmartLMS.Models 8 | { 9 | public class ADLog 10 | { 11 | [Required] 12 | public string FullName { get; set; } 13 | [Key] 14 | public string Email { get; set; } 15 | [Required] 16 | public string Password { get; set; } 17 | [Required] 18 | public string RetypePassword { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /SmartLMS/Models/AnswerChoice.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace SmartLMS.Models 5 | { 6 | public class AnswerChoice 7 | { 8 | [Key] 9 | [Required] 10 | public int AnswerChoiceId { get; set; } 11 | [Required] 12 | public string Choices { get; set; } 13 | [Required] 14 | public bool IsCorrect { get; set; } 15 | [Required] 16 | public int QuestionId { get; set; } 17 | public virtual Question Question { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /SmartLMS/Data/Repository/ISmartLMSData.cs: -------------------------------------------------------------------------------- 1 | using SmartLMS.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SmartLMS.Data.Repository 9 | { 10 | public interface ISmartLMSData 11 | { 12 | IRepository Users { get; } 13 | IRepository Lectures { get; } 14 | IRepository Categories { get; } 15 | IRepository Courses { get; } 16 | int SaveChanges(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SmartLMS/Models/Question.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | 5 | namespace SmartLMS.Models 6 | { 7 | public class Question 8 | { 9 | [Key] 10 | public int QuestionId { get; set; } 11 | 12 | [Required] 13 | public string QuestionText { get; set; } 14 | 15 | [Required] 16 | public int QuizId { get; set; } 17 | public virtual Quiz Quiz { get; set; } 18 | public virtual List AnswerChoices { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /SmartLMS/Models/Rating.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace SmartLMS.Models 8 | { 9 | public class Rating 10 | { 11 | [Key] 12 | public int RatingId { get; set; } 13 | public int CourseId { get; set; } 14 | public Course Course { get; set; } 15 | public int stars { get; set; } 16 | public string UserId { get; set; } 17 | public ApplicationUser User { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/border-radius.less: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | .border-top-radius(@radius) { 4 | border-top-right-radius: @radius; 5 | border-top-left-radius: @radius; 6 | } 7 | .border-right-radius(@radius) { 8 | border-bottom-right-radius: @radius; 9 | border-top-right-radius: @radius; 10 | } 11 | .border-bottom-radius(@radius) { 12 | border-bottom-right-radius: @radius; 13 | border-bottom-left-radius: @radius; 14 | } 15 | .border-left-radius(@radius) { 16 | border-bottom-left-radius: @radius; 17 | border-top-left-radius: @radius; 18 | } 19 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/reset-text.less: -------------------------------------------------------------------------------- 1 | .reset-text() { 2 | font-family: @font-family-base; 3 | // We deliberately do NOT reset font-size. 4 | font-style: normal; 5 | font-weight: normal; 6 | letter-spacing: normal; 7 | line-break: auto; 8 | line-height: @line-height-base; 9 | text-align: left; // Fallback for where `start` is not supported 10 | text-align: start; 11 | text-decoration: none; 12 | text-shadow: none; 13 | text-transform: none; 14 | white-space: normal; 15 | word-break: normal; 16 | word-spacing: normal; 17 | word-wrap: normal; 18 | } 19 | -------------------------------------------------------------------------------- /SmartLMS/Models/Certificate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace SmartLMS.Models 8 | { 9 | public class Certificate 10 | { 11 | [Key] 12 | [Required] 13 | public int CertificateId { get; set; } 14 | [Required] 15 | public string ApplicationUserID { get; set; } 16 | public ApplicationUser User { get; set; } 17 | [Required] 18 | public int CourseId { get; set; } 19 | public Course Course { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/pagination.less: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 4 | > li { 5 | > a, 6 | > span { 7 | padding: @padding-vertical @padding-horizontal; 8 | font-size: @font-size; 9 | line-height: @line-height; 10 | } 11 | &:first-child { 12 | > a, 13 | > span { 14 | .border-left-radius(@border-radius); 15 | } 16 | } 17 | &:last-child { 18 | > a, 19 | > span { 20 | .border-right-radius(@border-radius); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/panels.less: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) { 4 | border-color: @border; 5 | 6 | & > .panel-heading { 7 | color: @heading-text-color; 8 | background-color: @heading-bg-color; 9 | border-color: @heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: @border; 13 | } 14 | .badge { 15 | color: @heading-bg-color; 16 | background-color: @heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: @border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/ModelDescriptions/ModelNameAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SmartLMS.Areas.HelpPage.ModelDescriptions 4 | { 5 | /// 6 | /// Use this attribute to change the name of the generated for a type. 7 | /// 8 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum, AllowMultiple = false, Inherited = false)] 9 | public sealed class ModelNameAttribute : Attribute 10 | { 11 | public ModelNameAttribute(string name) 12 | { 13 | Name = name; 14 | } 15 | 16 | public string Name { get; private set; } 17 | } 18 | } -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/ModelDescriptions/ParameterDescription.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.ObjectModel; 3 | 4 | namespace SmartLMS.Areas.HelpPage.ModelDescriptions 5 | { 6 | public class ParameterDescription 7 | { 8 | public ParameterDescription() 9 | { 10 | Annotations = new Collection(); 11 | } 12 | 13 | public Collection Annotations { get; private set; } 14 | 15 | public string Documentation { get; set; } 16 | 17 | public string Name { get; set; } 18 | 19 | public ModelDescription TypeDescription { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid @well-border; 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /SmartLMS/Areas/Admin/AdminAreaRegistration.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | 3 | namespace SmartLMS.Areas.Admin 4 | { 5 | public class AdminAreaRegistration : AreaRegistration 6 | { 7 | public override string AreaName 8 | { 9 | get 10 | { 11 | return "Admin"; 12 | } 13 | } 14 | 15 | public override void RegisterArea(AreaRegistrationContext context) 16 | { 17 | context.MapRoute( 18 | "Admin_default", 19 | "Admin/{controller}/{action}/{id}", 20 | new { action = "Index", id = UrlParameter.Optional } 21 | ); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /SmartLMS/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace SmartLMS 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/ResourceModel.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Web.Http 2 | @using SmartLMS.Areas.HelpPage.ModelDescriptions 3 | @model ModelDescription 4 | 5 | 6 |
    7 | 14 |

    @Model.Name

    15 |

    @Model.Documentation

    16 |
    17 | @Html.DisplayFor(m => Model) 18 |
    19 |
    20 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/hide-text.less: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (has been removed in v4) 10 | .hide-text() { 11 | font: ~"0/0" a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | .text-hide() { 20 | .hide-text(); 21 | } 22 | -------------------------------------------------------------------------------- /SmartLMS/Models/Lecture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace SmartLMS.Models 8 | { 9 | public class Lecture 10 | { 11 | [Key] 12 | public int LectureId { get; set; } 13 | 14 | [Required] 15 | public string LectureName { get; set; } 16 | 17 | public int CourseId { get; set; } 18 | public Course Course { get; set; } 19 | 20 | [StringLength(255)] 21 | public string FileName { get; set; } 22 | public string ApplicationUserID { get; set; } 23 | public ApplicationUser User { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/list-group.less: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | .list-group-item-variant(@state; @background; @color) { 4 | .list-group-item-@{state} { 5 | color: @color; 6 | background-color: @background; 7 | 8 | a&, 9 | button& { 10 | color: @color; 11 | 12 | .list-group-item-heading { 13 | color: inherit; 14 | } 15 | 16 | &:hover, 17 | &:focus { 18 | color: @color; 19 | background-color: darken(@background, 5%); 20 | } 21 | &.active, 22 | &.active:hover, 23 | &.active:focus { 24 | color: #fff; 25 | background-color: @color; 26 | border-color: @color; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SmartLMS.Tests/Controllers/HomeControllerTest.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | using SmartLMS; 4 | using SmartLMS.Controllers; 5 | 6 | namespace SmartLMS.Tests.Controllers 7 | { 8 | [TestClass] 9 | public class HomeControllerTest 10 | { 11 | [TestMethod] 12 | public void Index() 13 | { 14 | // Arrange 15 | HomeController controller = new HomeController(); 16 | 17 | // Act 18 | ViewResult result = controller.Index() as ViewResult; 19 | 20 | // Assert 21 | Assert.IsNotNull(result); 22 | Assert.AreEqual("Home Page", result.ViewBag.Title); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/responsive-embed.less: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object, 16 | video { 17 | position: absolute; 18 | top: 0; 19 | left: 0; 20 | bottom: 0; 21 | height: 100%; 22 | width: 100%; 23 | border: 0; 24 | } 25 | } 26 | 27 | // Modifier class for 16:9 aspect ratio 28 | .embed-responsive-16by9 { 29 | padding-bottom: 56.25%; 30 | } 31 | 32 | // Modifier class for 4:3 aspect ratio 33 | .embed-responsive-4by3 { 34 | padding-bottom: 75%; 35 | } 36 | -------------------------------------------------------------------------------- /SmartLMS/Views/LecturerDashboard/Index.cshtml: -------------------------------------------------------------------------------- 1 | 2 | @{ 3 | ViewBag.Title = "Dashboard"; 4 | } 5 | 6 |
    7 |
    8 |

    @ViewBag.Title

    9 |
    10 |
    11 |
    12 |
    13 |
    14 |
    15 | Total Number of Users: @ViewData["user"] 16 |
    17 |
    18 | Total Number of Courses: @ViewData["course"] 19 |
    20 |
    21 | Total Number of Lectures: @ViewData["Lecture"] 22 |
    23 |
    24 |
    25 |
    26 | 27 |
    28 |
    29 | 30 |
    31 | 32 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/Api.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Web.Http 2 | @using SmartLMS.Areas.HelpPage.Models 3 | @model HelpPageApiModel 4 | 5 | @{ 6 | var description = Model.ApiDescription; 7 | ViewBag.Title = description.HttpMethod.Method + " " + description.RelativePath; 8 | } 9 | 10 | 11 |
    12 | 19 |
    20 | @Html.DisplayForModel() 21 |
    22 |
    23 | -------------------------------------------------------------------------------- /SmartLMS/Controllers/LecturerDashboardController.cs: -------------------------------------------------------------------------------- 1 | using SmartLMS.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Web; 6 | using System.Web.Mvc; 7 | 8 | namespace SmartLMS.Controllers 9 | { 10 | [Authorize(Roles = "Lecturer")] 11 | public class LecturerDashboardController : Controller 12 | { 13 | ApplicationDbContext db = new ApplicationDbContext(); 14 | // GET: LecturerDashboard 15 | public ActionResult Index() 16 | { 17 | ViewData["user"] = db.Users.ToList().Count(); 18 | ViewData["course"] = db.Courses.ToList().Count(); 19 | ViewData["Lecture"] = db.Lectures.ToList().Count(); 20 | return View(); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /SmartLMS/Models/Assignment.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace SmartLMS.Models 8 | { 9 | public class Assignment 10 | { 11 | [Key] 12 | public int AssignmentId { get; set; } 13 | [Required] 14 | public string AssignmentName { get; set; } 15 | [Required] 16 | public DateTime LastDate { get; set; } 17 | 18 | [StringLength(255)] 19 | public string FileName { get; set; } 20 | 21 | [Required] 22 | public int CourseId { get; set; } 23 | public virtual Course Course { get; set; } 24 | public ICollection Students { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/HelpPageAreaRegistration.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | using System.Web.Mvc; 3 | 4 | namespace SmartLMS.Areas.HelpPage 5 | { 6 | public class HelpPageAreaRegistration : AreaRegistration 7 | { 8 | public override string AreaName 9 | { 10 | get 11 | { 12 | return "HelpPage"; 13 | } 14 | } 15 | 16 | public override void RegisterArea(AreaRegistrationContext context) 17 | { 18 | context.MapRoute( 19 | "HelpPage_Default", 20 | "Help/{action}/{apiId}", 21 | new { controller = "Help", action = "Index", apiId = UrlParameter.Optional }); 22 | 23 | HelpPageConfig.Register(GlobalConfiguration.Configuration); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /SmartLMS/Views/Categories/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.ViewModels.CategoryViewModel 2 | 3 | @{ 4 | ViewBag.Title = "Category Details"; 5 | } 6 | 7 |
    8 |
    9 |

    @ViewBag.Title

    10 | 11 |
    12 |
    13 |
    14 |
    15 |
    16 |
    17 |
    18 | @Html.DisplayNameFor(model => model.CategoryName) 19 |
    20 | 21 |
    22 | @Html.DisplayFor(model => model.CategoryName) 23 |
    24 | 25 |
    26 |
    27 |

    28 | @Html.ActionLink("Edit", "Edit", new { id = Model.CategoryId }) | 29 | @Html.ActionLink("Back to List", "Index") 30 |

    31 |
    32 | -------------------------------------------------------------------------------- /SmartLMS/Views/StudentDashboard/_QuestionPartial.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.Models.Question 2 | 3 |
    4 |
    5 |

    6 | Questions: @Model.QuestionText 7 |

    8 |
    9 | @{ 10 | foreach (var question in Model.AnswerChoices) 11 | { 12 | @Html.Partial("_ChoicePartial", question) 13 | @Html.Raw(" ") 14 | } 15 | } 16 | @*@{ 17 | int counter = 1; 18 | foreach(var question in Model.AnswerChoices) 19 | { 20 | @Html.Raw(@counter) 21 | @Html.Raw(". ") 22 | @Html.Partial("_ChoicePartial", question) 23 | @Html.Raw("
    ") 24 | counter++; 25 | } 26 | }*@ 27 |
    28 | 29 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/DisplayTemplates/EnumTypeModelDescription.cshtml: -------------------------------------------------------------------------------- 1 | @using SmartLMS.Areas.HelpPage.ModelDescriptions 2 | @model EnumTypeModelDescription 3 | 4 |

    Possible enumeration values:

    5 | 6 | 7 | 8 | 9 | 10 | 11 | @foreach (EnumValueDescription value in Model.Values) 12 | { 13 | 14 | 15 | 18 | 21 | 22 | } 23 | 24 |
    NameValueDescription
    @value.Name 16 |

    @value.Value

    17 |
    19 |

    @value.Documentation

    20 |
    -------------------------------------------------------------------------------- /SmartLMS/Views/Categories/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.ViewModels.CategoryViewModel 2 | 3 | @{ 4 | ViewBag.Title = "Delete"; 5 | } 6 | 7 |

    Delete

    8 | 9 |

    Are you sure you want to delete this?

    10 |
    11 |

    Category

    12 |
    13 |
    14 |
    15 | @Html.DisplayNameFor(model => model.CategoryName) 16 |
    17 | 18 |
    19 | @Html.DisplayFor(model => model.CategoryName) 20 |
    21 | 22 |
    23 | 24 | @using (Html.BeginForm()) { 25 | @Html.AntiForgeryToken() 26 | 27 |
    28 | | 29 | @Html.ActionLink("Back to List", "Index") 30 |
    31 | } 32 |
    33 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | 21 | &.in { display: block; } 22 | tr&.in { display: table-row; } 23 | tbody&.in { display: table-row-group; } 24 | } 25 | 26 | .collapsing { 27 | position: relative; 28 | height: 0; 29 | overflow: hidden; 30 | .transition-property(~"height, visibility"); 31 | .transition-duration(.35s); 32 | .transition-timing-function(ease); 33 | } 34 | -------------------------------------------------------------------------------- /SmartLMS/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 |
    2 |

    Smart LMS

    3 |

    Smart LMS is a free web based LMS framework for building great online courses.

    4 |

    Learn more »

    5 |
    6 |
    7 |
    8 |

    Courses

    9 |

    Take the best online courses.

    10 |

    @Html.ActionLink("Courses", "Course", "Home", new { Area = "" }, new { @class= "btn btn-default" })

    11 |
    12 |
    13 |

    Manage Course

    14 |

    Instructor can manage courses.

    15 |
    16 |
    17 |

    Take Course

    18 |

    You can easily find and register a course. Thats all. Knowledge is Power.

    19 |
    20 |
    21 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/table-row.less: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | .table-row-variant(@state; @background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.@{state}, 10 | > th.@{state}, 11 | &.@{state} > td, 12 | &.@{state} > th { 13 | background-color: @background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.@{state}:hover, 21 | > th.@{state}:hover, 22 | &.@{state}:hover > td, 23 | &:hover > .@{state}, 24 | &.@{state}:hover > th { 25 | background-color: darken(@background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SmartLMS/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using SmartLMS.Infrastructure.Mapping; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Web; 6 | using System.Web.Http; 7 | using System.Web.Mvc; 8 | using System.Web.Optimization; 9 | using System.Web.Routing; 10 | 11 | namespace SmartLMS 12 | { 13 | public class WebApiApplication : System.Web.HttpApplication 14 | { 15 | protected void Application_Start() 16 | { 17 | AreaRegistration.RegisterAllAreas(); 18 | GlobalConfiguration.Configure(WebApiConfig.Register); 19 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 20 | RouteConfig.RegisterRoutes(RouteTable.Routes); 21 | BundleConfig.RegisterBundles(BundleTable.Bundles); 22 | 23 | AutoMapperConfiguration.RegisterMaps(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SmartLMS/Infrastructure/Mapping/AutoMapperConfiguration.cs: -------------------------------------------------------------------------------- 1 | using SmartLMS.Models; 2 | using SmartLMS.ViewModels; 3 | 4 | namespace SmartLMS.Infrastructure.Mapping 5 | { 6 | public class AutoMapperConfiguration 7 | { 8 | public static void RegisterMaps() 9 | { 10 | AutoMapper.Mapper.Initialize(config => 11 | { 12 | config.CreateMap(); 13 | config.CreateMap(); 14 | 15 | config.CreateMap(); 16 | config.CreateMap(); 17 | 18 | config.CreateMap() 19 | .ForMember(c => c.LecturerUserName, 20 | opt => opt.MapFrom(x => x.User.UserName)); 21 | }); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /SmartLMS/Areas/Admin/Views/Users/Roles.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.Areas.Admin.Models.EditUserModel 2 | @{ 3 | ViewBag.Title = "Listof Roles"; 4 | } 5 | 6 |
    7 |
    8 |

    9 | @ViewBag.Title 10 |

    11 |
    12 |
    13 |
    14 |
    15 | @foreach (string role in Model.Roles) 16 | { 17 | 18 | @role   19 | 20 | 21 | 22 |   23 | } 24 | @if (Model.Roles.Count == 0) 25 | { 26 |

    The user has not been added to any roles yet.

    27 | 28 | } 29 |
    30 | -------------------------------------------------------------------------------- /SmartLMS/ViewModels/SeeLectureViewModel.cs: -------------------------------------------------------------------------------- 1 | using SmartLMS.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | 6 | namespace SmartLMS.ViewModels 7 | { 8 | public class SeeLectureViewModel 9 | { 10 | [Key] 11 | [Display(Name = "Course")] 12 | public int CourseId { get; set; } 13 | 14 | [Display(Name = "Course Code")] 15 | public string CourseCode { get; set; } 16 | 17 | [Required] 18 | [Display(Name = "Course Name")] 19 | public string CourseName { get; set; } 20 | 21 | [Display(Name = "Start Date")] 22 | public DateTime? StartDate { get; set; } 23 | 24 | [Display(Name = "Lecturer UserName")] 25 | public string LecturerUserName { get; set; } 26 | public ICollection Lectures { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /SmartLMS/Models/StudentCourse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Linq; 6 | using System.Web; 7 | 8 | namespace SmartLMS.Models 9 | { 10 | public enum EnrollStatus 11 | { 12 | Rejected = 0, 13 | Pending = 1, 14 | Accepted = 2 15 | } 16 | public class StudentCourse 17 | { 18 | [Display(Name = "Status")] 19 | [DefaultValue(EnrollStatus.Accepted)] 20 | public EnrollStatus Status { get; set; } 21 | 22 | [Key] 23 | [Required] 24 | public int CourseId { get; set; } 25 | public virtual Course Course { get; set; } 26 | 27 | [Key] 28 | [Required] 29 | public string StudentId { get; set; } 30 | public virtual ApplicationUser Student { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /SmartLMS/Models/Quiz.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | 5 | namespace SmartLMS.Models 6 | { 7 | public class Quiz 8 | { 9 | [Key] 10 | [Required] 11 | public int QuizId { get; set; } 12 | [Required] 13 | public string QuizName { get; set; } 14 | public int CourseId { get; set; } 15 | public virtual Course Course { get; set; } 16 | 17 | [Required] 18 | public DateTime? StartTime { get; set; } 19 | [Required] 20 | public TimeSpan? Duration { get; set; } 21 | [Required] 22 | public DateTime? EndTime { get; set; } 23 | [Required] 24 | public int Score { get; set; } 25 | 26 | public ICollection Question { get; set; } 27 | public ICollection Students { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /SmartLMS/Data/Repository/IRepository.cs: -------------------------------------------------------------------------------- 1 | using SmartLMS.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Linq.Expressions; 6 | 7 | namespace SmartLMS.Data.Repository 8 | { 9 | public interface IRepository where T : class 10 | { 11 | IQueryable All(); 12 | 13 | IEnumerable SearchFor(Expression> predicate); 14 | IEnumerable SearchFor(Expression> predicate, string includeProperties = ""); 15 | 16 | T Find(params object[] keys); 17 | T Find(Expression> predicate); 18 | T Find(Expression> predicate, string includeProperties = ""); 19 | 20 | T Add(T t); 21 | void Update(T t); 22 | 23 | void Delete(object id); 24 | void Delete(T t); 25 | void Detach(T entity); 26 | void Save(); 27 | int Count(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /SmartLMS/ViewModels/QuizTakingVM.cs: -------------------------------------------------------------------------------- 1 | using SmartLMS.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace SmartLMS.ViewModels 8 | { 9 | public class QuizTakingVM 10 | { 11 | public Question Question 12 | { 13 | get 14 | { 15 | if (QuestionId != 0) 16 | { 17 | var eManager = new ApplicationDbContext(); 18 | 19 | return eManager.Questions.Find(QuestionId); 20 | } 21 | return null; 22 | } 23 | } 24 | 25 | public int QuestionId { get; set; } 26 | public int Choice { get; set; } 27 | 28 | public QuizTakingVM() 29 | { 30 | 31 | var eManager = new ApplicationDbContext(); 32 | 33 | eManager.Questions.Find(QuestionId); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile 27 | button& { 28 | padding: 0; 29 | cursor: pointer; 30 | background: transparent; 31 | border: 0; 32 | -webkit-appearance: none; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | &:extend(.img-responsive); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /SmartLMS/ViewModels/ExamTakingModel.cs: -------------------------------------------------------------------------------- 1 | using SmartLMS.Data.BLL; 2 | using SmartLMS.Models; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Web; 7 | 8 | namespace SmartLMS.ViewModels 9 | { 10 | public class ExamTakingModel 11 | { 12 | public Question Question 13 | { 14 | get 15 | { 16 | if (QuestionId != 0) 17 | { 18 | var eManager = new QuizSetManager(); 19 | 20 | return eManager.GetQuestionByID(QuestionId); 21 | } 22 | return null; 23 | } 24 | } 25 | 26 | public int QuestionId { get; set; } 27 | public int Choice { get; set; } 28 | 29 | public ExamTakingModel() 30 | { 31 | 32 | var eManager = new QuizSetManager(); 33 | 34 | eManager.GetQuestionByID(QuestionId); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /SmartLMS/Controllers/ValuesController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using System.Net.Http; 6 | using System.Web.Http; 7 | 8 | namespace SmartLMS.Controllers 9 | { 10 | [Authorize] 11 | public class ValuesController : ApiController 12 | { 13 | // GET api/values 14 | public IEnumerable Get() 15 | { 16 | return new string[] { "value1", "value2" }; 17 | } 18 | 19 | // GET api/values/5 20 | public string Get(int id) 21 | { 22 | return "value"; 23 | } 24 | 25 | // POST api/values 26 | public void Post([FromBody]string value) 27 | { 28 | } 29 | 30 | // PUT api/values/5 31 | public void Put(int id, [FromBody]string value) 32 | { 33 | } 34 | 35 | // DELETE api/values/5 36 | public void Delete(int id) 37 | { 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /SmartLMS/Migrations/201702180812115_inital_create_db.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace SmartLMS.Migrations 3 | { 4 | using System.CodeDom.Compiler; 5 | using System.Data.Entity.Migrations; 6 | using System.Data.Entity.Migrations.Infrastructure; 7 | using System.Resources; 8 | 9 | [GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")] 10 | public sealed partial class inital_create_db : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(inital_create_db)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201702180812115_inital_create_db"; } 17 | } 18 | 19 | string IMigrationMetadata.Source 20 | { 21 | get { return null; } 22 | } 23 | 24 | string IMigrationMetadata.Target 25 | { 26 | get { return Resources.GetString("Target"); } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | } 48 | 49 | 50 | // For Affix plugin 51 | // ------------------------- 52 | 53 | .affix { 54 | position: fixed; 55 | } 56 | -------------------------------------------------------------------------------- /SmartLMS/Views/Questions/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.Models.Question 2 | 3 | @{ 4 | ViewBag.Title = "Question Details"; 5 | } 6 | 7 |
    8 |
    9 |

    @ViewBag.Title

    10 |

    @Model.Quiz.Course.CourseName

    11 |
    12 |
    13 |
    14 | 15 |
    16 |
    17 |
    18 | @Html.DisplayNameFor(model => model.Quiz.QuizName) 19 |
    20 | 21 |
    22 | @Html.DisplayFor(model => model.Quiz.QuizName) 23 |
    24 | 25 |
    26 | @Html.DisplayNameFor(model => model.QuestionText) 27 |
    28 | 29 |
    30 | @Html.DisplayFor(model => model.QuestionText) 31 |
    32 | 33 |
    34 |
    35 |
    36 |

    37 | @Html.ActionLink("Edit", "Edit", new { id = Model.QuestionId }) | 38 | @Html.ActionLink("Back to List", "Index") 39 |

    40 |
    -------------------------------------------------------------------------------- /SmartLMS/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net.Http; 5 | using System.Web.Http; 6 | using Microsoft.Owin.Security.OAuth; 7 | using Newtonsoft.Json.Serialization; 8 | 9 | namespace SmartLMS 10 | { 11 | public static class WebApiConfig 12 | { 13 | public static void Register(HttpConfiguration config) 14 | { 15 | // Web API configuration and services 16 | // Configure Web API to use only bearer token authentication. 17 | config.SuppressDefaultHostAuthentication(); 18 | config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType)); 19 | 20 | // Web API routes 21 | config.MapHttpAttributeRoutes(); 22 | 23 | config.Routes.MapHttpRoute( 24 | name: "DefaultApi", 25 | routeTemplate: "api/{controller}/{id}", 26 | defaults: new { id = RouteParameter.Optional } 27 | ); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SmartLMS/Views/Courses/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.ViewModels.CourseViewModel 2 | 3 | @{ 4 | ViewBag.Title = "Delete"; 5 | } 6 | 7 |

    Delete

    8 | 9 |

    Are you sure you want to delete this?

    10 |
    11 |

    Course

    12 |
    13 |
    14 |
    15 | @Html.DisplayNameFor(model => model.Category.CategoryName) 16 |
    17 | 18 |
    19 | @Html.DisplayFor(model => model.Category.CategoryName) 20 |
    21 | 22 |
    23 | @Html.DisplayNameFor(model => model.CourseName) 24 |
    25 | 26 |
    27 | @Html.DisplayFor(model => model.CourseName) 28 |
    29 | 30 |
    31 | 32 | @using (Html.BeginForm()) { 33 | @Html.AntiForgeryToken() 34 | 35 |
    36 | | 37 | @Html.ActionLink("Back to List", "Index") 38 |
    39 | } 40 |
    41 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/DisplayTemplates/Samples.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Net.Http.Headers 2 | @model Dictionary 3 | 4 | @{ 5 | // Group the samples into a single tab if they are the same. 6 | Dictionary samples = Model.GroupBy(pair => pair.Value).ToDictionary( 7 | pair => String.Join(", ", pair.Select(m => m.Key.ToString()).ToArray()), 8 | pair => pair.Key); 9 | var mediaTypes = samples.Keys; 10 | } 11 |
    12 | @foreach (var mediaType in mediaTypes) 13 | { 14 |

    @mediaType

    15 |
    16 | Sample: 17 | @{ 18 | var sample = samples[mediaType]; 19 | if (sample == null) 20 | { 21 |

    Sample not available.

    22 | } 23 | else 24 | { 25 | @Html.DisplayFor(s => sample); 26 | } 27 | } 28 |
    29 | } 30 |
    -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/SampleGeneration/TextSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SmartLMS.Areas.HelpPage 4 | { 5 | /// 6 | /// This represents a preformatted text sample on the help page. There's a display template named TextSample associated with this class. 7 | /// 8 | public class TextSample 9 | { 10 | public TextSample(string text) 11 | { 12 | if (text == null) 13 | { 14 | throw new ArgumentNullException("text"); 15 | } 16 | Text = text; 17 | } 18 | 19 | public string Text { get; private set; } 20 | 21 | public override bool Equals(object obj) 22 | { 23 | TextSample other = obj as TextSample; 24 | return other != null && Text == other.Text; 25 | } 26 | 27 | public override int GetHashCode() 28 | { 29 | return Text.GetHashCode(); 30 | } 31 | 32 | public override string ToString() 33 | { 34 | return Text; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /SmartLMS/Views/StudentDashboard/QuizHistory.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "Quiz History"; 5 | } 6 | 7 |
    8 |
    9 |

    10 | @ViewBag.Title 11 |

    12 |
    13 |
    14 |
    15 | 16 |
    17 | 18 | 19 | 22 | 25 | 26 | 27 | @foreach (var item in Model) 28 | { 29 | 30 | 33 | 36 | 37 | } 38 | 39 |
    20 | @Html.DisplayNameFor(model => model.Quiz.QuizName) 21 | 23 | @Html.DisplayNameFor(model => model.Marks) 24 |
    31 | @Html.DisplayFor(modelItem => item.Quiz.QuizName) 32 | 34 | @Html.DisplayFor(modelItem => item.Marks) 35 |
    40 |
    41 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/DisplayTemplates/ModelDescriptionLink.cshtml: -------------------------------------------------------------------------------- 1 | @using SmartLMS.Areas.HelpPage.ModelDescriptions 2 | @model Type 3 | @{ 4 | ModelDescription modelDescription = ViewBag.modelDescription; 5 | if (modelDescription is ComplexTypeModelDescription || modelDescription is EnumTypeModelDescription) 6 | { 7 | if (Model == typeof(Object)) 8 | { 9 | @:Object 10 | } 11 | else 12 | { 13 | @Html.ActionLink(modelDescription.Name, "ResourceModel", "Help", new { modelName = modelDescription.Name }, null) 14 | } 15 | } 16 | else if (modelDescription is CollectionModelDescription) 17 | { 18 | var collectionDescription = modelDescription as CollectionModelDescription; 19 | var elementDescription = collectionDescription.ElementDescription; 20 | @:Collection of @Html.DisplayFor(m => elementDescription.ModelType, "ModelDescriptionLink", new { modelDescription = elementDescription }) 21 | } 22 | else 23 | { 24 | @Html.DisplayFor(m => modelDescription) 25 | } 26 | } -------------------------------------------------------------------------------- /SmartLMS/Results/ChallengeResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using System.Net.Http; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | using System.Web.Http; 9 | 10 | namespace SmartLMS.Results 11 | { 12 | public class ChallengeResult : IHttpActionResult 13 | { 14 | public ChallengeResult(string loginProvider, ApiController controller) 15 | { 16 | LoginProvider = loginProvider; 17 | Request = controller.Request; 18 | } 19 | 20 | public string LoginProvider { get; set; } 21 | public HttpRequestMessage Request { get; set; } 22 | 23 | public Task ExecuteAsync(CancellationToken cancellationToken) 24 | { 25 | Request.GetOwinContext().Authentication.Challenge(LoginProvider); 26 | 27 | HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.Unauthorized); 28 | response.RequestMessage = Request; 29 | return Task.FromResult(response); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | &:extend(.clearfix all); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pager-bg; 19 | border: 1px solid @pager-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pager-bg; 51 | cursor: @cursor-disabled; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Arif A Mondal 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/SampleGeneration/InvalidSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SmartLMS.Areas.HelpPage 4 | { 5 | /// 6 | /// This represents an invalid sample on the help page. There's a display template named InvalidSample associated with this class. 7 | /// 8 | public class InvalidSample 9 | { 10 | public InvalidSample(string errorMessage) 11 | { 12 | if (errorMessage == null) 13 | { 14 | throw new ArgumentNullException("errorMessage"); 15 | } 16 | ErrorMessage = errorMessage; 17 | } 18 | 19 | public string ErrorMessage { get; private set; } 20 | 21 | public override bool Equals(object obj) 22 | { 23 | InvalidSample other = obj as InvalidSample; 24 | return other != null && ErrorMessage == other.ErrorMessage; 25 | } 26 | 27 | public override int GetHashCode() 28 | { 29 | return ErrorMessage.GetHashCode(); 30 | } 31 | 32 | public override string ToString() 33 | { 34 | return ErrorMessage; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /SmartLMS/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNet.Identity 2 | @if (Request.IsAuthenticated) 3 | { 4 | using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right", @style = "margin-right:15px;" })) 5 | { 6 | @Html.AntiForgeryToken() 7 | 8 | 14 | } 15 | } 16 | else 17 | { 18 | 23 | } 24 | -------------------------------------------------------------------------------- /SmartLMS/Views/Lectures/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.Models.Lecture 2 | 3 | @{ 4 | ViewBag.Title = "Lecture Details"; 5 | } 6 | 7 |
    8 |
    9 |

    @ViewBag.Title

    10 |
    11 |
    12 |
    13 | 14 |
    15 |
    16 |
    17 | @Html.DisplayNameFor(model => model.Course.CourseName) 18 |
    19 | 20 |
    21 | @Html.DisplayFor(model => model.Course.CourseName) 22 |
    23 | 24 |
    25 | @Html.DisplayNameFor(model => model.User.Email) 26 |
    27 | 28 |
    29 | @Html.DisplayFor(model => model.User.Email) 30 |
    31 | 32 |
    33 | @Html.DisplayNameFor(model => model.LectureName) 34 |
    35 | 36 |
    37 | @Html.DisplayFor(model => model.LectureName) 38 |
    39 |
    File Name
    40 |
    @ViewData["lecture"]
    41 |
    42 |
    43 |

    44 | @Html.ActionLink("Edit", "Edit", new { id = Model.LectureId }) | 45 | @Html.ActionLink("Back to List", "Index") 46 |

    47 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/media.less: -------------------------------------------------------------------------------- 1 | .media { 2 | // Proper spacing between instances of .media 3 | margin-top: 15px; 4 | 5 | &:first-child { 6 | margin-top: 0; 7 | } 8 | } 9 | 10 | .media, 11 | .media-body { 12 | zoom: 1; 13 | overflow: hidden; 14 | } 15 | 16 | .media-body { 17 | width: 10000px; 18 | } 19 | 20 | .media-object { 21 | display: block; 22 | 23 | // Fix collapse in webkit from max-width: 100% and display: table-cell. 24 | &.img-thumbnail { 25 | max-width: none; 26 | } 27 | } 28 | 29 | .media-right, 30 | .media > .pull-right { 31 | padding-left: 10px; 32 | } 33 | 34 | .media-left, 35 | .media > .pull-left { 36 | padding-right: 10px; 37 | } 38 | 39 | .media-left, 40 | .media-right, 41 | .media-body { 42 | display: table-cell; 43 | vertical-align: top; 44 | } 45 | 46 | .media-middle { 47 | vertical-align: middle; 48 | } 49 | 50 | .media-bottom { 51 | vertical-align: bottom; 52 | } 53 | 54 | // Reset margins on headings for tighter default spacing 55 | .media-heading { 56 | margin-top: 0; 57 | margin-bottom: 5px; 58 | } 59 | 60 | // Media list variation 61 | // 62 | // Undo default ul/ol styles 63 | .media-list { 64 | padding-left: 0; 65 | list-style: none; 66 | } 67 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/image.less: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | .img-responsive(@display: block) { 10 | display: @display; 11 | max-width: 100%; // Part 1: Set a maximum relative to the parent 12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 13 | } 14 | 15 | 16 | // Retina image 17 | // 18 | // Short retina mixin for setting background-image and -size. Note that the 19 | // spelling of `min--moz-device-pixel-ratio` is intentional. 20 | .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { 21 | background-image: url("@{file-1x}"); 22 | 23 | @media 24 | only screen and (-webkit-min-device-pixel-ratio: 2), 25 | only screen and ( min--moz-device-pixel-ratio: 2), 26 | only screen and ( -o-min-device-pixel-ratio: 2/1), 27 | only screen and ( min-device-pixel-ratio: 2), 28 | only screen and ( min-resolution: 192dpi), 29 | only screen and ( min-resolution: 2dppx) { 30 | background-image: url("@{file-2x}"); 31 | background-size: @width-1x @height-1x; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SmartLMS/Views/Account/ForgotPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.Models.ForgotPasswordViewModel 2 | @{ 3 | ViewBag.Title = "Forgot your password?"; 4 | } 5 | 6 |
    7 |
    8 |

    @ViewBag.Title

    9 |
    10 |
    11 |
    12 |
    13 | @using (Html.BeginForm("ForgotPassword", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 14 | { 15 | @Html.AntiForgeryToken() 16 |

    Enter your email.

    17 |
    18 | @Html.ValidationSummary("", new { @class = "text-danger" }) 19 |
    20 | @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) 21 |
    22 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) 23 |
    24 |
    25 |
    26 |
    27 | 28 |
    29 |
    30 | } 31 |
    32 | 33 | @section Scripts { 34 | @Scripts.Render("~/bundles/jqueryval") 35 | } 36 | 37 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/SampleGeneration/ImageSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SmartLMS.Areas.HelpPage 4 | { 5 | /// 6 | /// This represents an image sample on the help page. There's a display template named ImageSample associated with this class. 7 | /// 8 | public class ImageSample 9 | { 10 | /// 11 | /// Initializes a new instance of the class. 12 | /// 13 | /// The URL of an image. 14 | public ImageSample(string src) 15 | { 16 | if (src == null) 17 | { 18 | throw new ArgumentNullException("src"); 19 | } 20 | Src = src; 21 | } 22 | 23 | public string Src { get; private set; } 24 | 25 | public override bool Equals(object obj) 26 | { 27 | ImageSample other = obj as ImageSample; 28 | return other != null && Src == other.Src; 29 | } 30 | 31 | public override int GetHashCode() 32 | { 33 | return Src.GetHashCode(); 34 | } 35 | 36 | public override string ToString() 37 | { 38 | return Src; 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /SmartLMS/Views/Shared/_LecturerPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using SmartLMS.Models 2 | 3 | @if (User.IsInRole(UserRoles.Lecturer.ToString())) 4 | { 5 |
  • @Html.ActionLink("Home", "Index", "Home", new { Area = "" }, new { })
  • 6 |
  • @Html.ActionLink("Courses", "Index", "Courses", new { Area = "" }, new { })
  • 7 | 21 | } 22 | -------------------------------------------------------------------------------- /SmartLMS/Areas/Admin/Views/Users/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | @{ 3 | ViewBag.Title = "List of Users"; 4 | } 5 | 6 |
    7 |
    8 |

    9 | @ViewBag.Title 10 |

    11 |
    12 |
    13 |
    14 |
    15 | 16 | 17 | 20 | 23 | 24 | 25 | 26 | @foreach (var item in Model) 27 | { 28 | 29 | 32 | 35 | 38 | 39 | } 40 | 41 |
    18 | @Html.DisplayNameFor(model => model.UserName) 19 | 21 | @Html.DisplayNameFor(model => model.Email) 22 |
    30 | @Html.DisplayFor(modelItem => item.UserName) 31 | 33 | @Html.DisplayFor(modelItem => item.Email) 34 | 36 | @Html.ActionLink("Roles", "Users", new { Area = "Admin" }, new { id = item.Id, @class = "btn btn-sm btn-success" }) 37 |
    42 |
    43 | 44 | -------------------------------------------------------------------------------- /SmartLMS/Views/Shared/_StudentPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using SmartLMS.Models 2 | 3 | @if (User.IsInRole(UserRoles.User.ToString())) 4 | { 5 |
  • @Html.ActionLink("Home", "Index", "Home", new { Area = "" }, new { })
  • 6 | 20 |
  • @Html.ActionLink("Courses", "Course", "Home", new { Area = "" }, new { })
  • 21 | } -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/Index.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Web.Http 2 | @using System.Web.Http.Controllers 3 | @using System.Web.Http.Description 4 | @using System.Collections.ObjectModel 5 | @using SmartLMS.Areas.HelpPage.Models 6 | @model Collection 7 | 8 | @{ 9 | ViewBag.Title = "ASP.NET Web API Help Page"; 10 | 11 | // Group APIs by controller 12 | ILookup apiGroups = Model.ToLookup(api => api.ActionDescriptor.ControllerDescriptor); 13 | } 14 | 15 | 16 |
    17 |
    18 |
    19 |

    @ViewBag.Title

    20 |
    21 |
    22 |
    23 |
    24 | 32 |
    33 | @foreach (var group in apiGroups) 34 | { 35 | @Html.DisplayFor(m => group, "ApiGroup") 36 | } 37 |
    38 |
    39 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text.less"; 6 | @import "mixins/opacity.less"; 7 | @import "mixins/image.less"; 8 | @import "mixins/labels.less"; 9 | @import "mixins/reset-filter.less"; 10 | @import "mixins/resize.less"; 11 | @import "mixins/responsive-visibility.less"; 12 | @import "mixins/size.less"; 13 | @import "mixins/tab-focus.less"; 14 | @import "mixins/reset-text.less"; 15 | @import "mixins/text-emphasis.less"; 16 | @import "mixins/text-overflow.less"; 17 | @import "mixins/vendor-prefixes.less"; 18 | 19 | // Components 20 | @import "mixins/alerts.less"; 21 | @import "mixins/buttons.less"; 22 | @import "mixins/panels.less"; 23 | @import "mixins/pagination.less"; 24 | @import "mixins/list-group.less"; 25 | @import "mixins/nav-divider.less"; 26 | @import "mixins/forms.less"; 27 | @import "mixins/progress-bar.less"; 28 | @import "mixins/table-row.less"; 29 | 30 | // Skins 31 | @import "mixins/background-variant.less"; 32 | @import "mixins/border-radius.less"; 33 | @import "mixins/gradients.less"; 34 | 35 | // Layout 36 | @import "mixins/clearfix.less"; 37 | @import "mixins/center-block.less"; 38 | @import "mixins/nav-vertical-align.less"; 39 | @import "mixins/grid-framework.less"; 40 | @import "mixins/grid.less"; 41 | -------------------------------------------------------------------------------- /SmartLMS/Views/Categories/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "List of Categories"; 5 | } 6 | 7 |
    8 |
    9 |

    10 | @ViewBag.Title 11 | @Html.ActionLink("Add New Categories", "Create", null, new { @class = "btn btn-success btn-sm pull-right" }) 12 |

    13 |
    14 |
    15 |
    16 | 17 |
    18 | 19 | 20 | 23 | 24 | 25 | 26 | @foreach (var item in Model) 27 | { 28 | 29 | 32 | 37 | 38 | } 39 | 40 |
    21 | @Html.DisplayNameFor(model => model.CategoryName) 22 |
    30 | @Html.DisplayFor(modelItem => item.CategoryName) 31 | 33 | @Html.ActionLink("Edit", "Edit", new { id = item.CategoryId }) | 34 | @Html.ActionLink("Details", "Details", new { id = item.CategoryId }) | 35 | @Html.ActionLink("Delete", "Delete", new { id = item.CategoryId }) 36 |
    41 |
    -------------------------------------------------------------------------------- /SmartLMS/ViewModels/CourseViewModel.cs: -------------------------------------------------------------------------------- 1 | using SmartLMS.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Linq; 6 | using System.Web; 7 | 8 | namespace SmartLMS.ViewModels 9 | { 10 | public class CourseViewModel 11 | { 12 | [Display(Name = "Course")] 13 | public int CourseId { get; set; } 14 | 15 | [Required] 16 | [Display(Name = "Course Name")] 17 | public string CourseName { get; set; } 18 | 19 | [Required(ErrorMessage = "The module must have a description!")] 20 | [Display(Name = "Description")] 21 | public string Description { get; set; } 22 | 23 | [Required] 24 | [Display(Name = "Category")] 25 | public int CategoryId { get; set; } 26 | public Category Category { get; set; } 27 | 28 | [Display(Name = "Start Date")] 29 | public DateTime? StartDate { get; set; } 30 | 31 | [ScaffoldColumn(false)] 32 | public int Rating { get; set; } 33 | 34 | public virtual ApplicationUser User { get; set; } 35 | public virtual ICollection Enrollments { get; set; } 36 | public virtual ICollection Lectures { get; set; } 37 | public virtual ICollection Assignments { get; set; } 38 | } 39 | } -------------------------------------------------------------------------------- /SmartLMS/Infrastructure/Video/VideoResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Web.Mvc; 4 | 5 | namespace SmartLMS.Infrastructure.Video 6 | { 7 | public class VideoResult : ActionResult 8 | { 9 | private string _path; 10 | public VideoResult(string path) 11 | { 12 | _path = path; 13 | } 14 | /// 15 | /// The below method will respond with the Video file 16 | /// 17 | /// 18 | public override void ExecuteResult(ControllerContext context) 19 | { 20 | //The File Path 21 | var videoFilePath = Path.GetFullPath(_path); 22 | //The header information 23 | context.HttpContext.Response.AddHeader("Content-Disposition", "attachment; filename=" + Path.GetFileName(_path)); 24 | var file = new FileInfo(videoFilePath); 25 | //Check the file exist, it will be written into the response 26 | if (file.Exists) 27 | { 28 | var stream = file.OpenRead(); 29 | var bytesinfile = new byte[stream.Length]; 30 | stream.Read(bytesinfile, 0, (int)file.Length); 31 | context.HttpContext.Response.BinaryWrite(bytesinfile); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /SmartLMS/Views/Lectures/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.Models.Lecture 2 | 3 | @{ 4 | ViewBag.Title = "Delete"; 5 | } 6 | 7 |
    8 |
    9 |

    @ViewBag.Title

    10 |
    11 |

    Are you sure you want to delete this?

    12 |
    13 |
    14 | 15 | 16 |
    17 |
    18 |
    19 | @Html.DisplayNameFor(model => model.Course.CourseName) 20 |
    21 | 22 |
    23 | @Html.DisplayFor(model => model.Course.CourseName) 24 |
    25 | 26 |
    27 | @Html.DisplayNameFor(model => model.User.Email) 28 |
    29 | 30 |
    31 | @Html.DisplayFor(model => model.User.Email) 32 |
    33 | 34 |
    35 | @Html.DisplayNameFor(model => model.LectureName) 36 |
    37 | 38 |
    39 | @Html.DisplayFor(model => model.LectureName) 40 |
    41 | 42 |
    43 | 44 | @using (Html.BeginForm()) { 45 | @Html.AntiForgeryToken() 46 | 47 |
    48 | | 49 | @Html.ActionLink("Back to List", "Index") 50 |
    51 | } 52 |
    53 | -------------------------------------------------------------------------------- /SmartLMS/Views/Questions/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.Models.Question 2 | 3 | @{ 4 | ViewBag.Title = "Delete"; 5 | } 6 | 7 |
    8 |
    9 |

    @ViewBag.Title

    10 |

    Are you sure you want to delete this?

    11 |
    12 |
    13 |
    14 | 15 | 16 |
    17 |
    18 |
    19 | @Html.DisplayNameFor(model => model.Quiz.Course.CourseName) 20 |
    21 | 22 |
    23 | @Html.DisplayFor(model => model.Quiz.Course.CourseName) 24 |
    25 |
    26 | @Html.DisplayNameFor(model => model.Quiz.QuizName) 27 |
    28 | 29 |
    30 | @Html.DisplayFor(model => model.Quiz.QuizName) 31 |
    32 | 33 |
    34 | @Html.DisplayNameFor(model => model.QuestionText) 35 |
    36 | 37 |
    38 | @Html.DisplayFor(model => model.QuestionText) 39 |
    40 | 41 |
    42 | 43 | @using (Html.BeginForm()) { 44 | @Html.AntiForgeryToken() 45 | 46 |
    47 | | 48 | @Html.ActionLink("Back to List", "Index") 49 |
    50 | } 51 |
    52 | -------------------------------------------------------------------------------- /SmartLMS/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SmartLMS/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace SmartLMS 5 | { 6 | public class BundleConfig 7 | { 8 | // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 12 | "~/Scripts/jquery-{version}.js")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 15 | "~/Scripts/jquery.validate*")); 16 | 17 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 18 | // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. 19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 20 | "~/Scripts/modernizr-*")); 21 | 22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 23 | "~/Scripts/bootstrap.js", 24 | "~/Scripts/respond.js")); 25 | 26 | bundles.Add(new StyleBundle("~/Content/css").Include( 27 | "~/Content/bootstrap-flaty.min.css", 28 | "~/Content/site.css")); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | a& { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/DisplayTemplates/ApiGroup.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Web.Http 2 | @using System.Web.Http.Controllers 3 | @using System.Web.Http.Description 4 | @using SmartLMS.Areas.HelpPage 5 | @using SmartLMS.Areas.HelpPage.Models 6 | @model IGrouping 7 | 8 | @{ 9 | var controllerDocumentation = ViewBag.DocumentationProvider != null ? 10 | ViewBag.DocumentationProvider.GetDocumentation(Model.Key) : 11 | null; 12 | } 13 | 14 |

    @Model.Key.ControllerName

    15 | @if (!String.IsNullOrEmpty(controllerDocumentation)) 16 | { 17 |

    @controllerDocumentation

    18 | } 19 | 20 | 21 | 22 | 23 | 24 | @foreach (var api in Model) 25 | { 26 | 27 | 28 | 38 | 39 | } 40 | 41 |
    APIDescription
    @api.HttpMethod.Method @api.RelativePath 29 | @if (api.Documentation != null) 30 | { 31 |

    @api.Documentation

    32 | } 33 | else 34 | { 35 |

    No documentation available.

    36 | } 37 |
    -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding-top: @jumbotron-padding; 8 | padding-bottom: @jumbotron-padding; 9 | margin-bottom: @jumbotron-padding; 10 | color: @jumbotron-color; 11 | background-color: @jumbotron-bg; 12 | 13 | h1, 14 | .h1 { 15 | color: @jumbotron-heading-color; 16 | } 17 | 18 | p { 19 | margin-bottom: (@jumbotron-padding / 2); 20 | font-size: @jumbotron-font-size; 21 | font-weight: 200; 22 | } 23 | 24 | > hr { 25 | border-top-color: darken(@jumbotron-bg, 10%); 26 | } 27 | 28 | .container &, 29 | .container-fluid & { 30 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 31 | padding-left: (@grid-gutter-width / 2); 32 | padding-right: (@grid-gutter-width / 2); 33 | } 34 | 35 | .container { 36 | max-width: 100%; 37 | } 38 | 39 | @media screen and (min-width: @screen-sm-min) { 40 | padding-top: (@jumbotron-padding * 1.6); 41 | padding-bottom: (@jumbotron-padding * 1.6); 42 | 43 | .container &, 44 | .container-fluid & { 45 | padding-left: (@jumbotron-padding * 2); 46 | padding-right: (@jumbotron-padding * 2); 47 | } 48 | 49 | h1, 50 | .h1 { 51 | font-size: @jumbotron-heading-font-size; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /SmartLMS/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /SmartLMS/Models/Core/IdentityGenerator.cs: -------------------------------------------------------------------------------- 1 | namespace SmartLMS.Models.Core 2 | { 3 | using System; 4 | public static class IdentityGenerator 5 | { 6 | 7 | /// 8 | /// This algorithm generates secuential GUIDs across system boundaries 9 | /// 10 | /// sequential GUID 11 | public static Guid SequentialGuid() 12 | { 13 | byte[] uid = Guid.NewGuid().ToByteArray(); 14 | byte[] binDate = BitConverter.GetBytes(DateTime.UtcNow.Ticks); 15 | 16 | byte[] secuentialGuid = new byte[uid.Length]; 17 | 18 | secuentialGuid[0] = uid[0]; 19 | secuentialGuid[1] = uid[1]; 20 | secuentialGuid[2] = uid[2]; 21 | secuentialGuid[3] = uid[3]; 22 | secuentialGuid[4] = uid[4]; 23 | secuentialGuid[5] = uid[5]; 24 | secuentialGuid[6] = uid[6]; 25 | secuentialGuid[7] = (byte)(0xc0 | (0xf & uid[7])); 26 | secuentialGuid[9] = binDate[0]; 27 | secuentialGuid[8] = binDate[1]; 28 | secuentialGuid[15] = binDate[2]; 29 | secuentialGuid[14] = binDate[3]; 30 | secuentialGuid[13] = binDate[4]; 31 | secuentialGuid[12] = binDate[5]; 32 | secuentialGuid[11] = binDate[6]; 33 | secuentialGuid[10] = binDate[7]; 34 | 35 | return new Guid(secuentialGuid); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /SmartLMS/Views/StudentDashboard/TakeQuiz.cshtml: -------------------------------------------------------------------------------- 1 | @model List 2 | 3 | @{ 4 | ViewBag.Title = "Take Quiz"; 5 | var qId = ViewData["quizId"]; 6 | } 7 | 8 |
    9 |
    10 |

    11 | @ViewBag.Title 12 |

    13 |
    14 |
    15 |
    16 | 17 |
    18 | @using (Html.BeginForm("TakeQuiz", "StudentDashboard", new { quizId = @qId }, FormMethod.Post)) 19 | { 20 | for(int i = 0; i < Model.Count(); i++) 21 | { 22 |
    23 | @Html.HiddenFor(modelItem => Model[i].QuestionId) 24 | @Html.DisplayTextFor(modelItem => Model[i].Question.QuestionText) 25 |
      26 | @for(int j = 0; j < Model[i].Question.AnswerChoices.Count(); j++) 27 | { 28 |
    1. @Html.DisplayTextFor(m => Model[i].Question.AnswerChoices[j].Choices) 29 | @Html.RadioButtonFor(x => Model[i].Choice, Model[i].Question.AnswerChoices[j].AnswerChoiceId) 30 |
    2. 31 | } 32 |
    33 |
    34 |
    35 | } 36 | 37 | } 38 |
    39 | @*@Html.Partial("_QuestionPartial", item)*@ -------------------------------------------------------------------------------- /SmartLMS/Views/StudentDashboard/SeeQuiz.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | @{ 3 | ViewBag.Title = "See Quiz"; 4 | } 5 | 6 |
    7 |
    8 |

    9 | @ViewBag.Title 10 |

    11 |
    12 |
    13 |
    14 | 15 | 16 | 19 | 22 | 25 | 26 | 27 | 28 | @foreach (var item in Model) 29 | { 30 | 31 | 34 | 37 | 40 | 43 | 44 | } 45 | 46 |
    17 | @Html.DisplayNameFor(model => model.Course.CourseName) 18 | 20 | @Html.DisplayNameFor(model => model.QuizName) 21 | 23 | @Html.DisplayNameFor(model => model.Score) 24 |
    32 | @Html.DisplayFor(modelItem => item.Course.CourseName) 33 | 35 | @Html.DisplayFor(modelItem => item.QuizName) 36 | 38 | @Html.DisplayFor(modelItem => item.Score) 39 | 41 | @Html.ActionLink("Take Quiz", "TakeQuiz", new { quiz = item.QuizId }, new { @class = "btn btn-success btn-sm" }) 42 |
    47 |
    48 | 49 | -------------------------------------------------------------------------------- /SmartLMS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SmartLMS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SmartLMS")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("9c1823cc-3614-48f1-a358-2a29738a8107")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /SmartLMS/Views/Categories/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.ViewModels.CategoryViewModel 2 | 3 | @{ 4 | ViewBag.Title = "Add Category"; 5 | } 6 | 7 |
    8 |
    9 |

    @ViewBag.Title

    10 |
    11 |
    12 |
    13 |
    14 | 15 | @using (Html.BeginForm()) 16 | { 17 | @Html.AntiForgeryToken() 18 | 19 |
    20 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 21 |
    22 | @Html.LabelFor(model => model.CategoryName, htmlAttributes: new { @class = "control-label col-md-2" }) 23 |
    24 | @Html.EditorFor(model => model.CategoryName, new { htmlAttributes = new { @class = "form-control" } }) 25 | @Html.ValidationMessageFor(model => model.CategoryName, "", new { @class = "text-danger" }) 26 |
    27 |
    28 | 29 |
    30 |
    31 | 32 |
    33 |
    34 |
    35 | } 36 | 37 |
    38 | @Html.ActionLink("Back to List", "Index") 39 |
    40 |
    41 | 42 | 43 | @section Scripts { 44 | @Scripts.Render("~/bundles/jqueryval") 45 | } 46 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: middle; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | 32 | .btn-xs &, 33 | .btn-group-xs > .btn & { 34 | top: 0; 35 | padding: 1px 5px; 36 | } 37 | 38 | // Hover state, but only for links 39 | a& { 40 | &:hover, 41 | &:focus { 42 | color: @badge-link-hover-color; 43 | text-decoration: none; 44 | cursor: pointer; 45 | } 46 | } 47 | 48 | // Account for badges in navs 49 | .list-group-item.active > &, 50 | .nav-pills > .active > a > & { 51 | color: @badge-active-color; 52 | background-color: @badge-active-bg; 53 | } 54 | 55 | .list-group-item > & { 56 | float: right; 57 | } 58 | 59 | .list-group-item > & + & { 60 | margin-right: 5px; 61 | } 62 | 63 | .nav-pills > li > a > & { 64 | margin-left: 3px; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /SmartLMS.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SmartLMS.Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SmartLMS.Tests")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("52303669-8f69-4fba-a527-6b3e9440a9a4")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /SmartLMS/Views/StudentDashboard/Assignments.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | @{ 3 | ViewBag.Title = "List of Assignments"; 4 | } 5 | 6 |
    7 |
    8 |

    @ViewBag.Title

    9 |
    10 |
    11 |
    12 |
    13 |
    14 | 15 | @foreach (var item in Model) 16 | { 17 |
    18 |

    19 | @Html.DisplayFor(modelItem => item.CourseName) 20 |

    21 |
    22 | 23 | 24 | 25 | 28 | 29 | 30 | 31 | @foreach (var assgn in item.Assignments) 32 | { 33 | 34 | 37 | 40 | 41 | } 42 |
    26 | @Html.DisplayName("Assignments Name") 27 | @Html.DisplayName("Assignments Last Date")
    35 | @Html.DisplayFor(modelItem => assgn.AssignmentName) 36 | 38 | @Html.DisplayFor(modelItem => assgn.LastDate) 39 |
    43 | } 44 |
    45 |
    46 | -------------------------------------------------------------------------------- /SmartLMS/Views/Lectures/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "List of Lectures"; 5 | } 6 | 7 |
    8 |
    9 |

    @ViewBag.Title 10 | @Html.ActionLink("Add New Lecture", "Create", "Lectures", null, new { @Class = "btn btn-success btn-sm pull-right" }) 11 |

    12 |
    13 |
    14 | 15 |
    16 | 17 | 18 | 21 | 24 | 25 | 26 | 27 | @foreach (var item in Model) 28 | { 29 | 30 | 33 | 36 | 41 | 42 | } 43 | 44 |
    19 | @Html.DisplayNameFor(model => model.Course.CourseName) 20 | 22 | @Html.DisplayNameFor(model => model.LectureName) 23 | Action
    31 | @Html.DisplayFor(modelItem => item.Course.CourseName) 32 | 34 | @Html.DisplayFor(modelItem => item.LectureName) 35 | 37 | @Html.ActionLink("Edit", "Edit", new { id = item.LectureId }) | 38 | @Html.ActionLink("Details", "Details", new { id = item.LectureId }) | 39 | @Html.ActionLink("Delete", "Delete", new { id = item.LectureId }) 40 |
    45 |
    46 | -------------------------------------------------------------------------------- /SmartLMS/Areas/Admin/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @ViewBag.Title - My ASP.NET Application 7 | @Styles.Render("~/Content/css") 8 | @Scripts.Render("~/bundles/modernizr") 9 | 10 | 11 | 27 | 28 |
    29 | @RenderBody() 30 |
    31 |
    32 |

    © @DateTime.Now.Year - My ASP.NET Application

    33 |
    34 |
    35 | 36 | @Scripts.Render("~/bundles/jquery") 37 | @Scripts.Render("~/bundles/bootstrap") 38 | @RenderSection("scripts", required: false) 39 | 40 | -------------------------------------------------------------------------------- /SmartLMS.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartLMS", "SmartLMS\SmartLMS.csproj", "{5A7C1714-AB89-4D6F-B067-F41C8119031C}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartLMS.Tests", "SmartLMS.Tests\SmartLMS.Tests.csproj", "{FF04D94C-8D6C-4038-A6D9-A425CC692658}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {5A7C1714-AB89-4D6F-B067-F41C8119031C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {5A7C1714-AB89-4D6F-B067-F41C8119031C}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {5A7C1714-AB89-4D6F-B067-F41C8119031C}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {5A7C1714-AB89-4D6F-B067-F41C8119031C}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {FF04D94C-8D6C-4038-A6D9-A425CC692658}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {FF04D94C-8D6C-4038-A6D9-A425CC692658}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {FF04D94C-8D6C-4038-A6D9-A425CC692658}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {FF04D94C-8D6C-4038-A6D9-A425CC692658}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/bootstrap.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.7 (http://getbootstrap.com) 3 | * Copyright 2011-2016 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | // Core variables and mixins 8 | @import "variables.less"; 9 | @import "mixins.less"; 10 | 11 | // Reset and dependencies 12 | @import "normalize.less"; 13 | @import "print.less"; 14 | @import "glyphicons.less"; 15 | 16 | // Core CSS 17 | @import "scaffolding.less"; 18 | @import "type.less"; 19 | @import "code.less"; 20 | @import "grid.less"; 21 | @import "tables.less"; 22 | @import "forms.less"; 23 | @import "buttons.less"; 24 | 25 | // Components 26 | @import "component-animations.less"; 27 | @import "dropdowns.less"; 28 | @import "button-groups.less"; 29 | @import "input-groups.less"; 30 | @import "navs.less"; 31 | @import "navbar.less"; 32 | @import "breadcrumbs.less"; 33 | @import "pagination.less"; 34 | @import "pager.less"; 35 | @import "labels.less"; 36 | @import "badges.less"; 37 | @import "jumbotron.less"; 38 | @import "thumbnails.less"; 39 | @import "alerts.less"; 40 | @import "progress-bars.less"; 41 | @import "media.less"; 42 | @import "list-group.less"; 43 | @import "panels.less"; 44 | @import "responsive-embed.less"; 45 | @import "wells.less"; 46 | @import "close.less"; 47 | 48 | // Components w/ JavaScript 49 | @import "modals.less"; 50 | @import "tooltip.less"; 51 | @import "popovers.less"; 52 | @import "carousel.less"; 53 | 54 | // Utility classes 55 | @import "utilities.less"; 56 | @import "responsive-utilities.less"; 57 | -------------------------------------------------------------------------------- /SmartLMS/Views/Categories/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.ViewModels.CategoryViewModel 2 | 3 | @{ 4 | ViewBag.Title = "Edit Categories"; 5 | } 6 | 7 |
    8 |
    9 |

    @ViewBag.Title

    10 | 11 |
    12 |
    13 |
    14 |
    15 | @using (Html.BeginForm()) 16 | { 17 | @Html.AntiForgeryToken() 18 | 19 |
    20 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 21 | @Html.HiddenFor(model => model.CategoryId) 22 | 23 |
    24 | @Html.LabelFor(model => model.CategoryName, htmlAttributes: new { @class = "control-label col-md-2" }) 25 |
    26 | @Html.EditorFor(model => model.CategoryName, new { htmlAttributes = new { @class = "form-control" } }) 27 | @Html.ValidationMessageFor(model => model.CategoryName, "", new { @class = "text-danger" }) 28 |
    29 |
    30 | 31 |
    32 |
    33 | 34 |
    35 |
    36 |
    37 | } 38 | 39 |
    40 | @Html.ActionLink("Back to List", "Index") 41 |
    42 |
    43 | 44 | 45 | @section Scripts { 46 | @Scripts.Render("~/bundles/jqueryval") 47 | } 48 | -------------------------------------------------------------------------------- /SmartLMS/Views/Courses/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "List of Courses"; 5 | } 6 | 7 |
    8 |
    9 |

    10 | @ViewBag.Title 11 | @Html.ActionLink("Add New Course", "Create", null, new { @class="btn btn-success btn-sm pull-right" }) 12 |

    13 | 14 |
    15 |
    16 |
    17 | 18 |
    19 | 20 | 21 | 24 | 27 | 28 | 29 | 30 | @foreach (var item in Model) 31 | { 32 | 33 | 36 | 39 | 44 | 45 | } 46 | 47 |
    22 | @Html.DisplayNameFor(model => model.Category.CategoryName) 23 | 25 | @Html.DisplayNameFor(model => model.CourseName) 26 |
    34 | @Html.DisplayFor(modelItem => item.Category.CategoryName) 35 | 37 | @Html.DisplayFor(modelItem => item.CourseName) 38 | 40 | @Html.ActionLink("Edit", "Edit", new { id = item.CourseId }) | 41 | @Html.ActionLink("Details", "Details", new { id = item.CourseId }) | 42 | @Html.ActionLink("Delete", "Delete", new { id = item.CourseId }) 43 |
    48 |
    -------------------------------------------------------------------------------- /SmartLMS/Areas/Admin/Controllers/UsersController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNet.Identity; 2 | using Microsoft.AspNet.Identity.EntityFramework; 3 | using SmartLMS.Areas.Admin.Models; 4 | using SmartLMS.Controllers; 5 | using SmartLMS.Data.Repository; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Linq; 9 | using System.Threading.Tasks; 10 | using System.Web; 11 | using System.Web.Mvc; 12 | 13 | namespace SmartLMS.Areas.Admin.Controllers 14 | { 15 | [Authorize(Roles = "Administrator")] 16 | public class UsersController : BaseController 17 | { 18 | private readonly RoleManager _roleManager; 19 | protected ISmartLMSData Data { get; private set; } 20 | public UsersController(ApplicationUserManager userManager, RoleManager roleManager, ISmartLMSData data) 21 | : base(userManager) 22 | { 23 | this._roleManager = roleManager; 24 | this.Data = data; 25 | } 26 | 27 | // GET: Admin/Users 28 | public ActionResult Index() 29 | { 30 | var users = this.Data.Users.All().ToList(); 31 | return View(users); 32 | } 33 | 34 | [HttpGet] 35 | [Route("admin/users/roles/")] 36 | public async Task Roles(string id) 37 | { 38 | EditUserModel um = new EditUserModel(); 39 | um.User = this.Data.Users.SearchFor( u => u.Id == id).SingleOrDefault(); 40 | um.Roles = await UserManager.GetRolesAsync(um.User.Id); 41 | return View(um); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /SmartLMS/Views/StudentDashboard/CourseDetails.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.Models.Course 2 | @{ 3 | ViewBag.Title = "Course Details"; 4 | } 5 | 6 |
    7 |
    8 |

    9 | @ViewBag.Title 10 |

    11 |
    12 |
    13 | @if (Model != null) 14 | { 15 |
    16 |
    17 |
    18 |

    19 | @Html.DisplayFor(model => model.CourseName) 20 |

    21 |
    22 |
    23 | @Html.ActionLink("Watch", "SeeLectures", new { courseId = Model.CourseId }, new { @class = "btnl btn-success btn-sm pull-right" }) 24 |
    25 | 26 | 27 | 30 | 31 | 32 | @foreach (var item in Model.Lectures) 33 | { 34 | 35 | 38 | 39 | } 40 | 41 |
    28 | @Html.DisplayName("Lecture Name") 29 |
    36 | @Html.DisplayFor(modelItem => item.LectureName) 37 |
    42 |
    43 |
    44 | } 45 | else 46 | { 47 |
    48 |
    49 |

    Course and Lecute not Found

    50 |
    51 | } 52 | 53 | -------------------------------------------------------------------------------- /SmartLMS/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using SmartLMS.Models; 2 | using System.Data; 3 | using System.Data.Entity; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Web; 8 | using System.Web.Mvc; 9 | using System.Threading.Tasks; 10 | 11 | namespace SmartLMS.Controllers 12 | { 13 | public class HomeController : Controller 14 | { 15 | ApplicationDbContext db = new ApplicationDbContext(); 16 | public ActionResult Index() 17 | { 18 | ViewBag.Title = "Home Page"; 19 | if (User.Identity.IsAuthenticated) 20 | { 21 | //if (User.IsInRole("Student")) 22 | //{ 23 | // return RedirectToAction("Dashboard", "StudentDashboard"); 24 | //} 25 | 26 | //else 27 | //{ 28 | // return RedirectToAction("Dashboard", "LecturerDashboard"); 29 | //} 30 | 31 | } 32 | return View(); 33 | } 34 | 35 | public ActionResult About() 36 | { 37 | ViewBag.Message = "Your application description page."; 38 | 39 | return View(); 40 | } 41 | 42 | public ActionResult Contact() 43 | { 44 | ViewBag.Message = "Your contact page."; 45 | 46 | return View(); 47 | } 48 | 49 | public async Task Course() 50 | { 51 | var courses = db.Courses.Include(c => c.Category); 52 | return View(await courses.ToListAsync()); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/ModelDescriptions/ModelNameHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Linq; 4 | using System.Reflection; 5 | 6 | namespace SmartLMS.Areas.HelpPage.ModelDescriptions 7 | { 8 | internal static class ModelNameHelper 9 | { 10 | // Modify this to provide custom model name mapping. 11 | public static string GetModelName(Type type) 12 | { 13 | ModelNameAttribute modelNameAttribute = type.GetCustomAttribute(); 14 | if (modelNameAttribute != null && !String.IsNullOrEmpty(modelNameAttribute.Name)) 15 | { 16 | return modelNameAttribute.Name; 17 | } 18 | 19 | string modelName = type.Name; 20 | if (type.IsGenericType) 21 | { 22 | // Format the generic type name to something like: GenericOfAgurment1AndArgument2 23 | Type genericType = type.GetGenericTypeDefinition(); 24 | Type[] genericArguments = type.GetGenericArguments(); 25 | string genericTypeName = genericType.Name; 26 | 27 | // Trim the generic parameter counts from the name 28 | genericTypeName = genericTypeName.Substring(0, genericTypeName.IndexOf('`')); 29 | string[] argumentTypeNames = genericArguments.Select(t => GetModelName(t)).ToArray(); 30 | modelName = String.Format(CultureInfo.InvariantCulture, "{0}Of{1}", genericTypeName, String.Join("And", argumentTypeNames)); 31 | } 32 | 33 | return modelName; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /SmartLMS/Views/Home/Course.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "List of Courses"; 5 | } 6 | 7 |
    8 |
    9 |

    @ViewBag.Title

    10 |
    11 |
    12 |
    13 | 14 |
    15 | 16 | 17 | 20 | 23 | 24 | 25 | 26 | @foreach (var item in Model) 27 | { 28 | 29 | 32 | 35 | 44 | 45 | } 46 | 47 |
    18 | @Html.DisplayNameFor(model => model.Category.CategoryName) 19 | 21 | @Html.DisplayNameFor(model => model.CourseName) 22 |
    30 | @Html.DisplayFor(modelItem => item.Category.CategoryName) 31 | 33 | @Html.DisplayFor(modelItem => item.CourseName) 34 | 36 | @using (Html.BeginForm("Enroll", "StudentDashboard", new { course = item.CourseId, Area = "" }, FormMethod.Post)) 37 | { 38 | @Html.ActionLink("Details", "Details", "Courses", new { id = item.CourseId, Area = "" }, new { @class = "btn btn-success btn-sm" }) 39 | 40 | @Html.AntiForgeryToken() 41 | 42 | } 43 |
    48 |
    -------------------------------------------------------------------------------- /SmartLMS/Models/Course.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | using System.Linq; 6 | using System.Web; 7 | 8 | namespace SmartLMS.Models 9 | { 10 | public class Course 11 | { 12 | [Key] 13 | [Display(Name = "Course")] 14 | public int CourseId { get; set; } 15 | 16 | [Required] 17 | [MaxLength(20)] 18 | //[RegularExpression(@"^\S\,*$", ErrorMessage = "No white space allowed")] 19 | [Display(Name = "Course Code")] 20 | public string CourseCode { get; set; } 21 | 22 | [Required] 23 | [Display(Name = "Course Name")] 24 | public string CourseName { get; set; } 25 | 26 | [Required(ErrorMessage = "The module must have a description!")] 27 | [Display(Name = "Description")] 28 | public string Description { get; set; } 29 | 30 | [Required] 31 | [ForeignKey("Category")] 32 | [Display(Name = "Category")] 33 | public int CategoryId { get; set; } 34 | public virtual Category Category { get; set; } 35 | 36 | [Display(Name = "Start Date")] 37 | public DateTime? StartDate { get; set; } 38 | 39 | [ScaffoldColumn(false)] 40 | public int Rating { get; set; } 41 | 42 | public virtual ApplicationUser User { get; set; } 43 | public virtual ICollection Enrollments { get; set; } 44 | public virtual ICollection Lectures { get; set; } 45 | public virtual ICollection Assignments { get; set; } 46 | } 47 | } -------------------------------------------------------------------------------- /SmartLMS/Views/Quizs/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | @{ 3 | ViewBag.Title = "Quizs"; 4 | } 5 | 6 |
    7 |
    8 |

    9 | @ViewBag.Title 10 | @Html.ActionLink("Add New Quiz", "Create", "Quizs", null, new { @Class = "btn btn-success btn-sm pull-right" }) 11 |

    12 |
    13 |
    14 |
    15 | 16 | 17 | 20 | 23 | 26 | 27 | 28 | 29 | @foreach (var item in Model) 30 | { 31 | 32 | 35 | 38 | 41 | 45 | 46 | } 47 | 48 |
    18 | @Html.DisplayNameFor(model => model.Course.CourseName) 19 | 21 | @Html.DisplayNameFor(model => model.QuizName) 22 | 24 | @Html.DisplayNameFor(model => model.Score) 25 | Action
    33 | @Html.DisplayFor(modelItem => item.Course.CourseName) 34 | 36 | @Html.DisplayFor(modelItem => item.QuizName) 37 | 39 | @Html.DisplayFor(modelItem => item.Score) 40 | 42 | @Html.ActionLink("Edit", "Edit", new { id = item.QuizId }) | 43 | @Html.ActionLink("Details", "Details", new { id = item.QuizId }) 44 |
    49 |
    50 | 51 | -------------------------------------------------------------------------------- /SmartLMS.Tests/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /SmartLMS/Controllers/ManageController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNet.Identity.Owin; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Web; 6 | using System.Web.Mvc; 7 | using static SmartLMS.ApplicationUserManager; 8 | 9 | namespace SmartLMS.Controllers 10 | { 11 | [Authorize] 12 | public class ManageController : Controller 13 | { 14 | private ApplicationSignInManager _signInManager; 15 | private ApplicationUserManager _userManager; 16 | 17 | public ManageController() 18 | { 19 | } 20 | 21 | public ManageController(ApplicationUserManager userManager, ApplicationSignInManager signInManager) 22 | { 23 | UserManager = userManager; 24 | SignInManager = signInManager; 25 | } 26 | 27 | public ApplicationSignInManager SignInManager 28 | { 29 | get 30 | { 31 | return _signInManager ?? HttpContext.GetOwinContext().Get(); 32 | } 33 | private set 34 | { 35 | _signInManager = value; 36 | } 37 | } 38 | 39 | public ApplicationUserManager UserManager 40 | { 41 | get 42 | { 43 | return _userManager ?? HttpContext.GetOwinContext().GetUserManager(); 44 | } 45 | private set 46 | { 47 | _userManager = value; 48 | } 49 | } 50 | 51 | // GET: Manage 52 | public ActionResult Index() 53 | { 54 | return View(); 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /SmartLMS/Views/Courses/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.ViewModels.CourseViewModel 2 | @using SmartLMS.Models 3 | @{ 4 | ViewBag.Title = "Course Details"; 5 | } 6 | 7 |
    8 |
    9 |

    @ViewBag.Title

    10 |
    11 |
    12 |
    13 | 14 |
    15 |
    16 |
    17 | @Html.DisplayNameFor(model => model.Category.CategoryName) 18 |
    19 | 20 |
    21 | @Html.DisplayFor(model => model.Category.CategoryName) 22 |
    23 | 24 |
    25 | @Html.DisplayNameFor(model => model.CourseName) 26 |
    27 | 28 |
    29 | @Html.DisplayFor(model => model.CourseName) 30 |
    31 |
    32 | @Html.DisplayNameFor(model => model.Description) 33 |
    34 | 35 |
    36 | @Html.DisplayFor(model => model.Description) 37 |
    38 |
    39 | @Html.DisplayNameFor(model => model.StartDate) 40 |
    41 | 42 |
    43 | @Html.DisplayFor(model => model.StartDate) 44 |
    45 | 46 |
    47 |
    48 |

    49 | @if (User.IsInRole(UserRoles.Lecturer.ToString())) 50 | { 51 | @Html.ActionLink("Edit", "Edit", new { id = Model.CourseId }, new { @class="btn btn-success" }) @:  52 | @Html.ActionLink("Back to List", "Index", null, new { @class = "btn btn-success" }) 53 | } 54 | else 55 | { 56 | @Html.ActionLink("Back to List", "Course", "Home", null, new { @class = "btn btn-success" }) 57 | } 58 |

    59 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/ApiDescriptionExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Web; 4 | using System.Web.Http.Description; 5 | 6 | namespace SmartLMS.Areas.HelpPage 7 | { 8 | public static class ApiDescriptionExtensions 9 | { 10 | /// 11 | /// Generates an URI-friendly ID for the . E.g. "Get-Values-id_name" instead of "GetValues/{id}?name={name}" 12 | /// 13 | /// The . 14 | /// The ID as a string. 15 | public static string GetFriendlyId(this ApiDescription description) 16 | { 17 | string path = description.RelativePath; 18 | string[] urlParts = path.Split('?'); 19 | string localPath = urlParts[0]; 20 | string queryKeyString = null; 21 | if (urlParts.Length > 1) 22 | { 23 | string query = urlParts[1]; 24 | string[] queryKeys = HttpUtility.ParseQueryString(query).AllKeys; 25 | queryKeyString = String.Join("_", queryKeys); 26 | } 27 | 28 | StringBuilder friendlyPath = new StringBuilder(); 29 | friendlyPath.AppendFormat("{0}-{1}", 30 | description.HttpMethod.Method, 31 | localPath.Replace("/", "-").Replace("{", String.Empty).Replace("}", String.Empty)); 32 | if (queryKeyString != null) 33 | { 34 | friendlyPath.AppendFormat("_{0}", queryKeyString.Replace('.', '-')); 35 | } 36 | return friendlyPath.ToString(); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /SmartLMS/Areas/Admin/Models/EditUserModel.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNet.Identity.EntityFramework; 2 | using SmartLMS.Infrastructure.BaseTypes; 3 | using SmartLMS.Models; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Web; 8 | 9 | namespace SmartLMS.Areas.Admin.Models 10 | { 11 | public class EditUserModel : SaveableModel 12 | { 13 | public ApplicationUser User { get; set; } 14 | public IList Roles { get; set; } 15 | public IList AllRoles { get; set; } 16 | } 17 | 18 | public class SaveProfileModel 19 | { 20 | public UserProfile User { get; set; } 21 | } 22 | 23 | public class UserProfile 24 | { 25 | public string FirstName { get; set; } 26 | 27 | public string LastName { get; set; } 28 | 29 | public string CompanyName { get; set; } 30 | 31 | public string DisplayName { get; set; } 32 | 33 | public bool EmailOptin { get; set; } 34 | 35 | public string Phone { get; set; } 36 | 37 | public string Mobile { get; set; } 38 | 39 | public string Twitter { get; set; } 40 | 41 | public string TwitterHandle { get; set; } 42 | 43 | public string Facebook { get; set; } 44 | 45 | public string GooglePlus { get; set; } 46 | 47 | public string LinkedIn { get; set; } 48 | 49 | public string Bio { get; set; } 50 | 51 | public string JobTitle { get; set; } 52 | 53 | public string WebsiteUrl { get; set; } 54 | 55 | public string VATNumber { get; set; } 56 | 57 | public string ClientCode { get; set; } 58 | 59 | public string Notes { get; set; } 60 | 61 | } 62 | } -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | border-radius: @border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: @kbd-color; 28 | background-color: @kbd-bg; 29 | border-radius: @border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | font-weight: bold; 36 | box-shadow: none; 37 | } 38 | } 39 | 40 | // Blocks of code 41 | pre { 42 | display: block; 43 | padding: ((@line-height-computed - 1) / 2); 44 | margin: 0 0 (@line-height-computed / 2); 45 | font-size: (@font-size-base - 1); // 14px to 13px 46 | line-height: @line-height-base; 47 | word-break: break-all; 48 | word-wrap: break-word; 49 | color: @pre-color; 50 | background-color: @pre-bg; 51 | border: 1px solid @pre-border-color; 52 | border-radius: @border-radius-base; 53 | 54 | // Account for some code outputs that place code tags in pre tags 55 | code { 56 | padding: 0; 57 | font-size: inherit; 58 | color: inherit; 59 | white-space: pre-wrap; 60 | background-color: transparent; 61 | border-radius: 0; 62 | } 63 | } 64 | 65 | // Enable scrollable blocks of code 66 | .pre-scrollable { 67 | max-height: @pre-scrollable-max-height; 68 | overflow-y: scroll; 69 | } 70 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/mixins/buttons.less: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | .button-variant(@color; @background; @border) { 7 | color: @color; 8 | background-color: @background; 9 | border-color: @border; 10 | 11 | &:focus, 12 | &.focus { 13 | color: @color; 14 | background-color: darken(@background, 10%); 15 | border-color: darken(@border, 25%); 16 | } 17 | &:hover { 18 | color: @color; 19 | background-color: darken(@background, 10%); 20 | border-color: darken(@border, 12%); 21 | } 22 | &:active, 23 | &.active, 24 | .open > .dropdown-toggle& { 25 | color: @color; 26 | background-color: darken(@background, 10%); 27 | border-color: darken(@border, 12%); 28 | 29 | &:hover, 30 | &:focus, 31 | &.focus { 32 | color: @color; 33 | background-color: darken(@background, 17%); 34 | border-color: darken(@border, 25%); 35 | } 36 | } 37 | &:active, 38 | &.active, 39 | .open > .dropdown-toggle& { 40 | background-image: none; 41 | } 42 | &.disabled, 43 | &[disabled], 44 | fieldset[disabled] & { 45 | &:hover, 46 | &:focus, 47 | &.focus { 48 | background-color: @background; 49 | border-color: @border; 50 | } 51 | } 52 | 53 | .badge { 54 | color: @background; 55 | background-color: @color; 56 | } 57 | } 58 | 59 | // Button sizes 60 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 61 | padding: @padding-vertical @padding-horizontal; 62 | font-size: @font-size; 63 | line-height: @line-height; 64 | border-radius: @border-radius; 65 | } 66 | -------------------------------------------------------------------------------- /SmartLMS/Views/StudentDashboard/Courses.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | @{ 3 | ViewBag.Title = "Your Courses"; 4 | } 5 | 6 |
    7 |
    8 |

    @ViewBag.Title

    9 |
    10 |
    11 |
    12 |
    13 |
    14 | 15 | 16 | 19 | 22 | 23 | 24 | 25 | 26 | @foreach (var item in Model) 27 | { 28 | 29 | 32 | 35 | 38 | 42 | 43 | } 44 | 45 |
    17 | @Html.DisplayNameFor(model => model.Category.CategoryName) 18 | 20 | @Html.DisplayNameFor(model => model.CourseName) 21 | @Html.DisplayName("Instructor")Action
    30 | @Html.DisplayFor(modelItem => item.Category.CategoryName) 31 | 33 | @Html.DisplayFor(modelItem => item.CourseName) 34 | 36 | @Html.DisplayFor(modelItem => item.User.Email) 37 | 39 | @Html.ActionLink("Details", "CourseDetails", new { courseId = item.CourseId }, new { @class = "btn btn-success" }) 40 | @Html.ActionLink("Quiz", "SeeQuiz", new { courseId = item.CourseId }, new { @class = "btn btn-success" }) 41 |
    46 |
    47 |
    48 | 49 | -------------------------------------------------------------------------------- /SmartLMS/Views/Account/Register.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.Models.RegisterViewModel 2 | @{ 3 | ViewBag.Title = "Register"; 4 | } 5 | 6 |
    7 |
    8 |

    Create a new account

    9 |
    10 |
    11 |
    12 |
    13 | @using (Html.BeginForm("Register", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 14 | { 15 | @Html.AntiForgeryToken() 16 | 17 | @Html.ValidationSummary("", new { @class = "text-danger" }) 18 |
    19 | @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) 20 |
    21 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) 22 |
    23 |
    24 |
    25 | @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) 26 |
    27 | @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) 28 |
    29 |
    30 |
    31 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 32 |
    33 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 34 |
    35 |
    36 |
    37 |
    38 | 39 |
    40 |
    41 | } 42 |
    43 | 44 | @section Scripts { 45 | @Scripts.Render("~/bundles/jqueryval") 46 | } 47 | 48 | -------------------------------------------------------------------------------- /SmartLMS/Views/Quizs/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.Models.Quiz 2 | 3 | @{ 4 | ViewBag.Title = "Quiz Details"; 5 | } 6 | 7 |
    8 |
    9 |

    @ViewBag.Title

    10 |
    11 |
    12 |
    13 | 14 |
    15 |
    16 |
    17 | @Html.DisplayNameFor(model => model.Course.CourseName) 18 |
    19 | 20 |
    21 | @Html.DisplayFor(model => model.Course.CourseName) 22 |
    23 | 24 |
    25 | @Html.DisplayNameFor(model => model.QuizName) 26 |
    27 | 28 |
    29 | @Html.DisplayFor(model => model.QuizName) 30 |
    31 | 32 |
    33 | @Html.DisplayNameFor(model => model.StartTime) 34 |
    35 | 36 |
    37 | @Html.DisplayFor(model => model.StartTime) 38 |
    39 | 40 |
    41 | @Html.DisplayNameFor(model => model.Duration) 42 |
    43 | 44 |
    45 | @Html.DisplayFor(model => model.Duration) 46 |
    47 | 48 |
    49 | @Html.DisplayNameFor(model => model.EndTime) 50 |
    51 | 52 |
    53 | @Html.DisplayFor(model => model.EndTime) 54 |
    55 | 56 |
    57 | @Html.DisplayNameFor(model => model.Score) 58 |
    59 | 60 |
    61 | @Html.DisplayFor(model => model.Score) 62 |
    63 | 64 |
    65 |
    66 |
    67 |

    68 | @Html.ActionLink("Edit", "Edit", new { id = Model.QuizId }) | 69 | @Html.ActionLink("Back to List", "Index") 70 |

    71 |
    72 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /SmartLMS/Views/Account/RegisterAsLecturer.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.Models.RegisterViewModel 2 | @{ 3 | ViewBag.Title = "Register"; 4 | } 5 | 6 |
    7 |
    8 |

    Create a new account.

    9 |
    10 |
    11 |
    12 |
    13 | @using (Html.BeginForm("RegisterAsLecturer", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 14 | { 15 | @Html.AntiForgeryToken() 16 | 17 | @Html.ValidationSummary("", new { @class = "text-danger" }) 18 |
    19 | @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) 20 |
    21 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) 22 |
    23 |
    24 |
    25 | @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) 26 |
    27 | @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) 28 |
    29 |
    30 |
    31 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 32 |
    33 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 34 |
    35 |
    36 |
    37 |
    38 | 39 |
    40 |
    41 | } 42 |
    43 | 44 | @section Scripts { 45 | @Scripts.Render("~/bundles/jqueryval") 46 | } 47 | 48 | -------------------------------------------------------------------------------- /SmartLMS/Views/AnswerChoices/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "List of Answers"; 5 | } 6 | 7 |
    8 |
    9 |

    10 | @ViewBag.Title 11 | @Html.ActionLink("Add Answer", "Create", null, new { @class = "btn btn-success btn-sm pull-right" }) 12 |

    13 |
    14 |
    15 |
    16 | 17 |
    18 | 19 | 20 | 23 | 26 | 29 | 30 | 31 | 32 | @foreach (var item in Model) 33 | { 34 | 35 | 38 | 41 | 44 | 49 | 50 | } 51 | 52 |
    21 | @Html.DisplayNameFor(model => model.Question.QuestionText) 22 | 24 | @Html.DisplayNameFor(model => model.Choices) 25 | 27 | @Html.DisplayNameFor(model => model.IsCorrect) 28 |
    36 | @Html.DisplayFor(modelItem => item.Question.QuestionText) 37 | 39 | @Html.DisplayFor(modelItem => item.Choices) 40 | 42 | @Html.DisplayFor(modelItem => item.IsCorrect) 43 | 45 | @Html.ActionLink("Edit", "Edit", new { id = item.AnswerChoiceId }) | 46 | @Html.ActionLink("Details", "Details", new { id = item.AnswerChoiceId }) | 47 | @Html.ActionLink("Delete", "Delete", new { id = item.AnswerChoiceId }) 48 |
    53 |
    54 | -------------------------------------------------------------------------------- /SmartLMS/Views/Assignments/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | @{ 3 | ViewBag.Title = "List Assignments"; 4 | } 5 | 6 |
    7 |
    8 |

    9 | @ViewBag.Title 10 | @Html.ActionLink("Add New Assignments", "Create", "Assignments", null, new { @Class = "btn btn-success btn-sm pull-right" }) 11 |

    12 |
    13 |
    14 |
    15 | 16 | 17 | 20 | 23 | 26 | 27 | 28 | 29 | @foreach (var item in Model) 30 | { 31 | 32 | 35 | 38 | 41 | 46 | 47 | } 48 | 49 |
    18 | @Html.DisplayNameFor(model => model.Course.CourseName) 19 | 21 | @Html.DisplayNameFor(model => model.AssignmentName) 22 | 24 | @Html.DisplayNameFor(model => model.LastDate) 25 | Action
    33 | @Html.DisplayFor(modelItem => item.Course.CourseName) 34 | 36 | @Html.DisplayFor(modelItem => item.AssignmentName) 37 | 39 | @Html.DisplayFor(modelItem => item.LastDate) 40 | 42 | @Html.ActionLink("Edit", "Edit", new { id = item.AssignmentId }) | 43 | @Html.ActionLink("Details", "Details", new { id = item.AssignmentId }) | 44 | @Html.ActionLink("Delete", "Delete", new { id = item.AssignmentId }) 45 |
    50 |
    51 | 52 | -------------------------------------------------------------------------------- /SmartLMS/Views/Assignments/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.Models.Assignment 2 | 3 | @{ 4 | ViewBag.Title = "Assignments Details"; 5 | var fileSrc = ViewBag.FilePath; 6 | // src=@Url.Content(@HttpUtility.UrlPathEncode(filesrc)) 7 | } 8 | 9 |
    10 |
    11 |

    @ViewBag.Title

    12 |
    13 |
    14 |
    15 | 16 |
    17 |
    18 |
    19 |
    20 |
    21 | @Html.DisplayNameFor(model => model.Course.CourseName) 22 |
    23 | 24 |
    25 | @Html.DisplayFor(model => model.Course.CourseName) 26 |
    27 | 28 |
    29 | @Html.DisplayNameFor(model => model.AssignmentName) 30 |
    31 | 32 |
    33 | @Html.DisplayFor(model => model.AssignmentName) 34 |
    35 | 36 |
    37 | @Html.DisplayNameFor(model => model.LastDate) 38 |
    39 | 40 |
    41 | @Html.DisplayFor(model => model.LastDate) 42 |
    43 |
    44 | Download 45 |
    46 |
    47 | @Html.ActionLink("Download", "Download", new { FileName = fileSrc }) 48 |
    49 |
    50 |
    51 |
    52 | 53 |
    54 |
    55 |

    56 | @Html.ActionLink("Edit", "Edit", new { id = Model.AssignmentId }) | 57 | @Html.ActionLink("Back to List", "Index") 58 |

    59 |
    -------------------------------------------------------------------------------- /SmartLMS/Areas/Admin/Views/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
    7 |
    8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /SmartLMS/Views/Questions/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "List of Questions"; 5 | } 6 | 7 |
    8 |
    9 |

    10 | @ViewBag.Title 11 | @Html.ActionLink("Add Question", "Create", "Questions", null, new { @Class = "btn btn-success btn-sm pull-right" }) 12 |

    13 |
    14 |
    15 |
    16 | 17 |
    18 | 19 | 20 | 21 | 24 | 27 | 30 | 31 | 32 | 33 | @foreach (var item in Model) 34 | { 35 | 36 | 39 | 42 | 45 | 50 | 51 | } 52 | 53 |
    22 | @Html.DisplayNameFor(model => model.Quiz.Course.CourseName) 23 | 25 | @Html.DisplayNameFor(model => model.Quiz.QuizName) 26 | 28 | @Html.DisplayNameFor(model => model.QuestionText) 29 |
    37 | @Html.DisplayFor(modelItem => item.Quiz.Course.CourseName) 38 | 40 | @Html.DisplayFor(modelItem => item.Quiz.QuizName) 41 | 43 | @Html.DisplayFor(modelItem => item.QuestionText) 44 | 46 | @Html.ActionLink("Edit", "Edit", new { id = item.QuestionId }) | 47 | @Html.ActionLink("Details", "Details", new { id = item.QuestionId }) | 48 | @Html.ActionLink("Delete", "Delete", new { id = item.QuestionId }) 49 |
    54 |
    55 | -------------------------------------------------------------------------------- /SmartLMS/Views/StudentDashboard/SeeLectures.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.ViewModels.SeeLectureViewModel 2 | @{ 3 | ViewBag.Title = "Watch Lectures"; 4 | var firstFile = ""; 5 | if (Model.Lectures.Count > 0) 6 | { 7 | firstFile = Model.LecturerUserName + "/" + Model.CourseCode + "/" + Model.Lectures.FirstOrDefault().FileName; 8 | } 9 | 10 | } 11 |
    12 | 13 |
    14 |
    15 |
    16 |
    17 |
    18 | @{ 19 | Html.RenderPartial("_VideoPartial", firstFile); 20 | } 21 |
    22 |
    23 |
    24 |

    @Model.CourseName

    25 |

    by @Model.LecturerUserName

    26 |
    27 |
    28 | @foreach (var item in Model.Lectures) 29 | { 30 | var urlpath = Model.LecturerUserName + "/" + Model.CourseCode + "/" + item.FileName; 31 | 32 | @item.LectureName 33 | 34 | } 35 |
    36 |
    37 |
    38 |
    39 | @section Scripts { 40 | @Scripts.Render("~/bundles/jqueryval") 41 | 52 | } 53 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | 22 | // Provide class for links that match alerts 23 | .alert-link { 24 | font-weight: @alert-link-font-weight; 25 | } 26 | 27 | // Improve alignment and spacing of inner content 28 | > p, 29 | > ul { 30 | margin-bottom: 0; 31 | } 32 | 33 | > p + p { 34 | margin-top: 5px; 35 | } 36 | } 37 | 38 | // Dismissible alerts 39 | // 40 | // Expand the right padding and account for the close button's positioning. 41 | 42 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 43 | .alert-dismissible { 44 | padding-right: (@alert-padding + 20); 45 | 46 | // Adjust close link position 47 | .close { 48 | position: relative; 49 | top: -2px; 50 | right: -21px; 51 | color: inherit; 52 | } 53 | } 54 | 55 | // Alternate styles 56 | // 57 | // Generate contextual modifier classes for colorizing the alert. 58 | 59 | .alert-success { 60 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 61 | } 62 | 63 | .alert-info { 64 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 65 | } 66 | 67 | .alert-warning { 68 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 69 | } 70 | 71 | .alert-danger { 72 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 73 | } 74 | -------------------------------------------------------------------------------- /SmartLMS/Views/Questions/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.Models.Question 2 | 3 | @{ 4 | ViewBag.Title = "Add Question"; 5 | } 6 | 7 |
    8 |
    9 |

    @ViewBag.Title

    10 |
    11 |
    12 |
    13 | 14 |
    15 | @using (Html.BeginForm()) 16 | { 17 | @Html.AntiForgeryToken() 18 | 19 |
    20 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 21 | 22 |
    23 | @Html.LabelFor(model => model.QuizId, "QuizId", htmlAttributes: new { @class = "control-label col-md-2" }) 24 |
    25 | @Html.DropDownList("QuizId", null, "Select a Quiz", htmlAttributes: new { @class = "form-control" }) 26 | @Html.ValidationMessageFor(model => model.QuizId, "", new { @class = "text-danger" }) 27 |
    28 |
    29 | 30 |
    31 | @Html.LabelFor(model => model.QuestionText, htmlAttributes: new { @class = "control-label col-md-2" }) 32 |
    33 | @Html.EditorFor(model => model.QuestionText, new { htmlAttributes = new { @class = "form-control" } }) 34 | @Html.ValidationMessageFor(model => model.QuestionText, "", new { @class = "text-danger" }) 35 |
    36 |
    37 | 38 |
    39 |
    40 | 41 |
    42 |
    43 |
    44 | } 45 |
    46 | 47 |
    48 | @Html.ActionLink("Back to List", "Index") 49 |
    50 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/DisplayTemplates/Parameters.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Collections.Generic 2 | @using System.Collections.ObjectModel 3 | @using System.Web.Http.Description 4 | @using System.Threading 5 | @using SmartLMS.Areas.HelpPage.ModelDescriptions 6 | @model IList 7 | 8 | @if (Model.Count > 0) 9 | { 10 | 11 | 12 | 13 | 14 | 15 | @foreach (ParameterDescription parameter in Model) 16 | { 17 | ModelDescription modelDescription = parameter.TypeDescription; 18 | 19 | 20 | 23 | 26 | 39 | 40 | } 41 | 42 |
    NameDescriptionTypeAdditional information
    @parameter.Name 21 |

    @parameter.Documentation

    22 |
    24 | @Html.DisplayFor(m => modelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = modelDescription }) 25 | 27 | @if (parameter.Annotations.Count > 0) 28 | { 29 | foreach (var annotation in parameter.Annotations) 30 | { 31 |

    @annotation.Documentation

    32 | } 33 | } 34 | else 35 | { 36 |

    None.

    37 | } 38 |
    43 | } 44 | else 45 | { 46 |

    None.

    47 | } 48 | 49 | -------------------------------------------------------------------------------- /SmartLMS/Views/Questions/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.Models.Question 2 | 3 | @{ 4 | ViewBag.Title = "Edit Question"; 5 | } 6 | 7 |
    8 |
    9 |

    @ViewBag.Title

    10 |

    @Model.Quiz.Course.CourseName

    11 |
    12 |
    13 |
    14 |
    15 | @using (Html.BeginForm()) 16 | { 17 | @Html.AntiForgeryToken() 18 | 19 |
    20 | 21 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 22 | @Html.HiddenFor(model => model.QuestionId) 23 | 24 |
    25 | @Html.LabelFor(model => model.QuizId, "QuizId", htmlAttributes: new { @class = "control-label col-md-2" }) 26 |
    27 | @Html.DropDownList("QuizId", null, htmlAttributes: new { @class = "form-control" }) 28 | @Html.ValidationMessageFor(model => model.QuizId, "", new { @class = "text-danger" }) 29 |
    30 |
    31 | 32 |
    33 | @Html.LabelFor(model => model.QuestionText, htmlAttributes: new { @class = "control-label col-md-2" }) 34 |
    35 | @Html.EditorFor(model => model.QuestionText, new { htmlAttributes = new { @class = "form-control" } }) 36 | @Html.ValidationMessageFor(model => model.QuestionText, "", new { @class = "text-danger" }) 37 |
    38 |
    39 | 40 |
    41 |
    42 | 43 |
    44 |
    45 |
    46 | } 47 |
    48 | 49 |
    50 | @Html.ActionLink("Back to List", "Index") 51 |
    52 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
    7 |
    8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /SmartLMS/Views/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
    7 |
    8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Views/Help/DisplayTemplates/HelpPageApiModel.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Web.Http 2 | @using System.Web.Http.Description 3 | @using SmartLMS.Areas.HelpPage.Models 4 | @using SmartLMS.Areas.HelpPage.ModelDescriptions 5 | @model HelpPageApiModel 6 | 7 | @{ 8 | ApiDescription description = Model.ApiDescription; 9 | } 10 |

    @description.HttpMethod.Method @description.RelativePath

    11 |
    12 |

    @description.Documentation

    13 | 14 |

    Request Information

    15 | 16 |

    URI Parameters

    17 | @Html.DisplayFor(m => m.UriParameters, "Parameters") 18 | 19 |

    Body Parameters

    20 | 21 |

    @Model.RequestDocumentation

    22 | 23 | @if (Model.RequestModelDescription != null) 24 | { 25 | @Html.DisplayFor(m => m.RequestModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.RequestModelDescription }) 26 | if (Model.RequestBodyParameters != null) 27 | { 28 | @Html.DisplayFor(m => m.RequestBodyParameters, "Parameters") 29 | } 30 | } 31 | else 32 | { 33 |

    None.

    34 | } 35 | 36 | @if (Model.SampleRequests.Count > 0) 37 | { 38 |

    Request Formats

    39 | @Html.DisplayFor(m => m.SampleRequests, "Samples") 40 | } 41 | 42 |

    Response Information

    43 | 44 |

    Resource Description

    45 | 46 |

    @description.ResponseDescription.Documentation

    47 | 48 | @if (Model.ResourceDescription != null) 49 | { 50 | @Html.DisplayFor(m => m.ResourceDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ResourceDescription }) 51 | if (Model.ResourceProperties != null) 52 | { 53 | @Html.DisplayFor(m => m.ResourceProperties, "Parameters") 54 | } 55 | } 56 | else 57 | { 58 |

    None.

    59 | } 60 | 61 | @if (Model.SampleResponses.Count > 0) 62 | { 63 |

    Response Formats

    64 | @Html.DisplayFor(m => m.SampleResponses, "Samples") 65 | } 66 | 67 |
    -------------------------------------------------------------------------------- /SmartLMS/Areas/HelpPage/Controllers/HelpController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Web.Http; 3 | using System.Web.Mvc; 4 | using SmartLMS.Areas.HelpPage.ModelDescriptions; 5 | using SmartLMS.Areas.HelpPage.Models; 6 | 7 | namespace SmartLMS.Areas.HelpPage.Controllers 8 | { 9 | /// 10 | /// The controller that will handle requests for the help page. 11 | /// 12 | public class HelpController : Controller 13 | { 14 | private const string ErrorViewName = "Error"; 15 | 16 | public HelpController() 17 | : this(GlobalConfiguration.Configuration) 18 | { 19 | } 20 | 21 | public HelpController(HttpConfiguration config) 22 | { 23 | Configuration = config; 24 | } 25 | 26 | public HttpConfiguration Configuration { get; private set; } 27 | 28 | public ActionResult Index() 29 | { 30 | ViewBag.DocumentationProvider = Configuration.Services.GetDocumentationProvider(); 31 | return View(Configuration.Services.GetApiExplorer().ApiDescriptions); 32 | } 33 | 34 | public ActionResult Api(string apiId) 35 | { 36 | if (!String.IsNullOrEmpty(apiId)) 37 | { 38 | HelpPageApiModel apiModel = Configuration.GetHelpPageApiModel(apiId); 39 | if (apiModel != null) 40 | { 41 | return View(apiModel); 42 | } 43 | } 44 | 45 | return View(ErrorViewName); 46 | } 47 | 48 | public ActionResult ResourceModel(string modelName) 49 | { 50 | if (!String.IsNullOrEmpty(modelName)) 51 | { 52 | ModelDescriptionGenerator modelDescriptionGenerator = Configuration.GetModelDescriptionGenerator(); 53 | ModelDescription modelDescription; 54 | if (modelDescriptionGenerator.GeneratedModels.TryGetValue(modelName, out modelDescription)) 55 | { 56 | return View(modelDescription); 57 | } 58 | } 59 | 60 | return View(ErrorViewName); 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /SmartLMS.Tests/Controllers/ValuesControllerTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net.Http; 5 | using System.Text; 6 | using System.Web.Http; 7 | using Microsoft.VisualStudio.TestTools.UnitTesting; 8 | using SmartLMS; 9 | using SmartLMS.Controllers; 10 | 11 | namespace SmartLMS.Tests.Controllers 12 | { 13 | [TestClass] 14 | public class ValuesControllerTest 15 | { 16 | [TestMethod] 17 | public void Get() 18 | { 19 | // Arrange 20 | ValuesController controller = new ValuesController(); 21 | 22 | // Act 23 | IEnumerable result = controller.Get(); 24 | 25 | // Assert 26 | Assert.IsNotNull(result); 27 | Assert.AreEqual(2, result.Count()); 28 | Assert.AreEqual("value1", result.ElementAt(0)); 29 | Assert.AreEqual("value2", result.ElementAt(1)); 30 | } 31 | 32 | [TestMethod] 33 | public void GetById() 34 | { 35 | // Arrange 36 | ValuesController controller = new ValuesController(); 37 | 38 | // Act 39 | string result = controller.Get(5); 40 | 41 | // Assert 42 | Assert.AreEqual("value", result); 43 | } 44 | 45 | [TestMethod] 46 | public void Post() 47 | { 48 | // Arrange 49 | ValuesController controller = new ValuesController(); 50 | 51 | // Act 52 | controller.Post("value"); 53 | 54 | // Assert 55 | } 56 | 57 | [TestMethod] 58 | public void Put() 59 | { 60 | // Arrange 61 | ValuesController controller = new ValuesController(); 62 | 63 | // Act 64 | controller.Put(5, "value"); 65 | 66 | // Assert 67 | } 68 | 69 | [TestMethod] 70 | public void Delete() 71 | { 72 | // Arrange 73 | ValuesController controller = new ValuesController(); 74 | 75 | // Act 76 | controller.Delete(5); 77 | 78 | // Assert 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /SmartLMS/Controllers/BaseController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNet.Identity; 2 | using Microsoft.AspNet.Identity.Owin; 3 | using SmartLMS.Models; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Web; 8 | using System.Web.Mvc; 9 | 10 | namespace SmartLMS.Controllers 11 | { 12 | public class BaseController : Controller 13 | { 14 | private ApplicationUserManager _userManager; 15 | 16 | public BaseController(ApplicationUserManager userManager) 17 | { 18 | UserManager = userManager; 19 | } 20 | 21 | public ApplicationUserManager UserManager 22 | { 23 | get 24 | { 25 | return _userManager ?? HttpContext.GetOwinContext().GetUserManager(); 26 | } 27 | private set 28 | { 29 | _userManager = value; 30 | } 31 | } 32 | 33 | #region Helpers 34 | [NonAction] 35 | public void AddErrorString(string error) 36 | { 37 | ModelState.AddModelError("", error); 38 | } 39 | 40 | 41 | [NonAction] 42 | public virtual string GetUserName() 43 | { 44 | string userId = this.User.Identity.Name; 45 | return userId; 46 | } 47 | 48 | [NonAction] 49 | public virtual async System.Threading.Tasks.Task GetUserId() 50 | { 51 | string userName = this.User.Identity.Name; 52 | var user = await UserManager.FindByNameAsync(userName); 53 | return user.Id; 54 | } 55 | 56 | [NonAction] 57 | public virtual async System.Threading.Tasks.Task GetUserAsync() 58 | { 59 | string username = this.User.Identity.Name; 60 | var user = await UserManager.FindByNameAsync(username); 61 | return user; 62 | } 63 | 64 | [NonAction] 65 | public virtual ApplicationUser GetUser() 66 | { 67 | string username = this.User.Identity.Name; 68 | var user = UserManager.FindByName(username); 69 | return user; 70 | } 71 | #endregion 72 | } 73 | } -------------------------------------------------------------------------------- /SmartLMS/App_Start/NinjectWebCommon.cs: -------------------------------------------------------------------------------- 1 | [assembly: WebActivatorEx.PreApplicationStartMethod(typeof(SmartLMS.App_Start.NinjectWebCommon), "Start")] 2 | [assembly: WebActivatorEx.ApplicationShutdownMethodAttribute(typeof(SmartLMS.App_Start.NinjectWebCommon), "Stop")] 3 | 4 | namespace SmartLMS.App_Start 5 | { 6 | using System; 7 | using System.Web; 8 | 9 | using Microsoft.Web.Infrastructure.DynamicModuleHelper; 10 | 11 | using Ninject; 12 | using Ninject.Web.Common; 13 | 14 | public static class NinjectWebCommon 15 | { 16 | private static readonly Bootstrapper bootstrapper = new Bootstrapper(); 17 | 18 | /// 19 | /// Starts the application 20 | /// 21 | public static void Start() 22 | { 23 | DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule)); 24 | DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule)); 25 | bootstrapper.Initialize(CreateKernel); 26 | } 27 | 28 | /// 29 | /// Stops the application. 30 | /// 31 | public static void Stop() 32 | { 33 | bootstrapper.ShutDown(); 34 | } 35 | 36 | /// 37 | /// Creates the kernel that will manage your application. 38 | /// 39 | /// The created kernel. 40 | private static IKernel CreateKernel() 41 | { 42 | var kernel = new StandardKernel(); 43 | try 44 | { 45 | kernel.Bind>().ToMethod(ctx => () => new Bootstrapper().Kernel); 46 | kernel.Bind().To(); 47 | 48 | RegisterServices(kernel); 49 | return kernel; 50 | } 51 | catch 52 | { 53 | kernel.Dispose(); 54 | throw; 55 | } 56 | } 57 | 58 | /// 59 | /// Load your modules or register your services here! 60 | /// 61 | /// The kernel. 62 | private static void RegisterServices(IKernel kernel) 63 | { 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /SmartLMS.Tests/App_Start/NinjectWebCommon.cs: -------------------------------------------------------------------------------- 1 | [assembly: WebActivatorEx.PreApplicationStartMethod(typeof(SmartLMS.Tests.App_Start.NinjectWebCommon), "Start")] 2 | [assembly: WebActivatorEx.ApplicationShutdownMethodAttribute(typeof(SmartLMS.Tests.App_Start.NinjectWebCommon), "Stop")] 3 | 4 | namespace SmartLMS.Tests.App_Start 5 | { 6 | using System; 7 | using System.Web; 8 | 9 | using Microsoft.Web.Infrastructure.DynamicModuleHelper; 10 | 11 | using Ninject; 12 | using Ninject.Web.Common; 13 | 14 | public static class NinjectWebCommon 15 | { 16 | private static readonly Bootstrapper bootstrapper = new Bootstrapper(); 17 | 18 | /// 19 | /// Starts the application 20 | /// 21 | public static void Start() 22 | { 23 | DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule)); 24 | DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule)); 25 | bootstrapper.Initialize(CreateKernel); 26 | } 27 | 28 | /// 29 | /// Stops the application. 30 | /// 31 | public static void Stop() 32 | { 33 | bootstrapper.ShutDown(); 34 | } 35 | 36 | /// 37 | /// Creates the kernel that will manage your application. 38 | /// 39 | /// The created kernel. 40 | private static IKernel CreateKernel() 41 | { 42 | var kernel = new StandardKernel(); 43 | try 44 | { 45 | kernel.Bind>().ToMethod(ctx => () => new Bootstrapper().Kernel); 46 | kernel.Bind().To(); 47 | 48 | RegisterServices(kernel); 49 | return kernel; 50 | } 51 | catch 52 | { 53 | kernel.Dispose(); 54 | throw; 55 | } 56 | } 57 | 58 | /// 59 | /// Load your modules or register your services here! 60 | /// 61 | /// The kernel. 62 | private static void RegisterServices(IKernel kernel) 63 | { 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/progress-bars.less: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bars 3 | // -------------------------------------------------- 4 | 5 | 6 | // Bar animations 7 | // ------------------------- 8 | 9 | // WebKit 10 | @-webkit-keyframes progress-bar-stripes { 11 | from { background-position: 40px 0; } 12 | to { background-position: 0 0; } 13 | } 14 | 15 | // Spec and IE10+ 16 | @keyframes progress-bar-stripes { 17 | from { background-position: 40px 0; } 18 | to { background-position: 0 0; } 19 | } 20 | 21 | 22 | // Bar itself 23 | // ------------------------- 24 | 25 | // Outer container 26 | .progress { 27 | overflow: hidden; 28 | height: @line-height-computed; 29 | margin-bottom: @line-height-computed; 30 | background-color: @progress-bg; 31 | border-radius: @progress-border-radius; 32 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 33 | } 34 | 35 | // Bar of progress 36 | .progress-bar { 37 | float: left; 38 | width: 0%; 39 | height: 100%; 40 | font-size: @font-size-small; 41 | line-height: @line-height-computed; 42 | color: @progress-bar-color; 43 | text-align: center; 44 | background-color: @progress-bar-bg; 45 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 46 | .transition(width .6s ease); 47 | } 48 | 49 | // Striped bars 50 | // 51 | // `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the 52 | // `.progress-bar-striped` class, which you just add to an existing 53 | // `.progress-bar`. 54 | .progress-striped .progress-bar, 55 | .progress-bar-striped { 56 | #gradient > .striped(); 57 | background-size: 40px 40px; 58 | } 59 | 60 | // Call animation for the active one 61 | // 62 | // `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the 63 | // `.progress-bar.active` approach. 64 | .progress.active .progress-bar, 65 | .progress-bar.active { 66 | .animation(progress-bar-stripes 2s linear infinite); 67 | } 68 | 69 | 70 | // Variations 71 | // ------------------------- 72 | 73 | .progress-bar-success { 74 | .progress-bar-variant(@progress-bar-success-bg); 75 | } 76 | 77 | .progress-bar-info { 78 | .progress-bar-variant(@progress-bar-info-bg); 79 | } 80 | 81 | .progress-bar-warning { 82 | .progress-bar-variant(@progress-bar-warning-bg); 83 | } 84 | 85 | .progress-bar-danger { 86 | .progress-bar-variant(@progress-bar-danger-bg); 87 | } 88 | -------------------------------------------------------------------------------- /SmartLMS/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @ViewBag.Title 7 | @Styles.Render("~/Content/css") 8 | @Scripts.Render("~/bundles/modernizr") 9 | 10 | 11 | 42 |
    43 | @RenderBody() 44 |
    45 |
    46 |

    © @DateTime.Now.Year - Arif Ali Mondal

    47 |
    48 |
    49 | 50 | @Scripts.Render("~/bundles/jquery") 51 | @Scripts.Render("~/bundles/bootstrap") 52 | @RenderSection("scripts", required: false) 53 | 54 | 55 | -------------------------------------------------------------------------------- /SmartLMS/Views/AnswerChoices/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model SmartLMS.Models.AnswerChoice 2 | 3 | @{ 4 | ViewBag.Title = "Answer Choice"; 5 | } 6 | 7 |
    8 |
    9 |

    @ViewBag.Title

    10 |
    11 |
    12 |
    13 | 14 |
    15 | @using (Html.BeginForm()) 16 | { 17 | @Html.AntiForgeryToken() 18 | 19 |
    20 | 21 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 22 | 23 |
    24 | @Html.LabelFor(model => model.QuestionId, "QuestionId", htmlAttributes: new { @class = "control-label col-md-2" }) 25 |
    26 | @Html.DropDownList("QuestionId", null, "Select the Question", htmlAttributes: new { @class = "form-control" }) 27 | @Html.ValidationMessageFor(model => model.QuestionId, "", new { @class = "text-danger" }) 28 |
    29 |
    30 | 31 |
    32 | @Html.LabelFor(model => model.Choices, htmlAttributes: new { @class = "control-label col-md-2" }) 33 |
    34 | @Html.EditorFor(model => model.Choices, new { htmlAttributes = new { @class = "form-control" } }) 35 | @Html.ValidationMessageFor(model => model.Choices, "", new { @class = "text-danger" }) 36 |
    37 |
    38 | 39 |
    40 | @Html.LabelFor(model => model.IsCorrect, htmlAttributes: new { @class = "control-label col-md-2" }) 41 |
    42 |
    43 | @Html.EditorFor(model => model.IsCorrect) 44 | @Html.ValidationMessageFor(model => model.IsCorrect, "", new { @class = "text-danger" }) 45 |
    46 |
    47 |
    48 | 49 |
    50 |
    51 | 52 |
    53 |
    54 |
    55 | } 56 |
    57 | 58 |
    59 | @Html.ActionLink("Back to List", "Index") 60 |
    61 | -------------------------------------------------------------------------------- /SmartLMS/Data/Repository/CommonRepository.cs: -------------------------------------------------------------------------------- 1 | using SmartLMS.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | namespace SmartLMS.Data.Repository 7 | { 8 | public class CommonRepository : IDisposable where T : class 9 | { 10 | ApplicationDbContext context = new ApplicationDbContext(); 11 | 12 | public void Create(T obj) 13 | { 14 | IRepository repository = new GenericRepository(context); 15 | repository.Add(obj); 16 | repository.Save(); 17 | } 18 | 19 | public T CreateAndGet(T obj) 20 | { 21 | IRepository repository = new GenericRepository(context); 22 | var objDTO = repository.Add(obj); 23 | repository.Save(); 24 | return objDTO; 25 | } 26 | 27 | public T Get(int id) 28 | { 29 | IRepository repository = new GenericRepository(context); 30 | return repository.Find(id); 31 | } 32 | 33 | public IEnumerable GetAll() 34 | { 35 | IRepository repository = new GenericRepository(context); 36 | 37 | if (repository.All().Any()) 38 | { 39 | return repository.All().ToList(); 40 | } 41 | 42 | return new List(); 43 | } 44 | 45 | public void Update(T obj) 46 | { 47 | IRepository repository = new GenericRepository(context); 48 | repository.Update(obj); 49 | repository.Save(); 50 | } 51 | 52 | public int Count 53 | { 54 | get 55 | { 56 | IRepository repository = new GenericRepository(context); 57 | return repository.Count(); 58 | } 59 | } 60 | 61 | public void Delete(T obj) 62 | { 63 | IRepository repository = new GenericRepository(context); 64 | repository.Delete(obj); 65 | repository.Save(); 66 | } 67 | 68 | public void DeleteById(int id) 69 | { 70 | IRepository repository = new GenericRepository(context); 71 | repository.Delete(id); 72 | repository.Save(); 73 | } 74 | 75 | public void Dispose() 76 | { 77 | //throw new NotImplementedException(); 78 | } 79 | 80 | 81 | } 82 | } -------------------------------------------------------------------------------- /SmartLMS/Content/bootstrap/pagination.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pagination (multiple pages) 3 | // -------------------------------------------------- 4 | .pagination { 5 | display: inline-block; 6 | padding-left: 0; 7 | margin: @line-height-computed 0; 8 | border-radius: @border-radius-base; 9 | 10 | > li { 11 | display: inline; // Remove list-style and block-level defaults 12 | > a, 13 | > span { 14 | position: relative; 15 | float: left; // Collapse white-space 16 | padding: @padding-base-vertical @padding-base-horizontal; 17 | line-height: @line-height-base; 18 | text-decoration: none; 19 | color: @pagination-color; 20 | background-color: @pagination-bg; 21 | border: 1px solid @pagination-border; 22 | margin-left: -1px; 23 | } 24 | &:first-child { 25 | > a, 26 | > span { 27 | margin-left: 0; 28 | .border-left-radius(@border-radius-base); 29 | } 30 | } 31 | &:last-child { 32 | > a, 33 | > span { 34 | .border-right-radius(@border-radius-base); 35 | } 36 | } 37 | } 38 | 39 | > li > a, 40 | > li > span { 41 | &:hover, 42 | &:focus { 43 | z-index: 2; 44 | color: @pagination-hover-color; 45 | background-color: @pagination-hover-bg; 46 | border-color: @pagination-hover-border; 47 | } 48 | } 49 | 50 | > .active > a, 51 | > .active > span { 52 | &, 53 | &:hover, 54 | &:focus { 55 | z-index: 3; 56 | color: @pagination-active-color; 57 | background-color: @pagination-active-bg; 58 | border-color: @pagination-active-border; 59 | cursor: default; 60 | } 61 | } 62 | 63 | > .disabled { 64 | > span, 65 | > span:hover, 66 | > span:focus, 67 | > a, 68 | > a:hover, 69 | > a:focus { 70 | color: @pagination-disabled-color; 71 | background-color: @pagination-disabled-bg; 72 | border-color: @pagination-disabled-border; 73 | cursor: @cursor-disabled; 74 | } 75 | } 76 | } 77 | 78 | // Sizing 79 | // -------------------------------------------------- 80 | 81 | // Large 82 | .pagination-lg { 83 | .pagination-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large); 84 | } 85 | 86 | // Small 87 | .pagination-sm { 88 | .pagination-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small); 89 | } 90 | -------------------------------------------------------------------------------- /SmartLMS/Content/Site.css: -------------------------------------------------------------------------------- 1 | 2 | @font-face { 3 | font-family: 'Ubuntu'; 4 | font-style: normal; 5 | font-weight: 400; 6 | src: local('Ubuntu'), url(http://fonts.gstatic.com/s/ubuntu/v7/ODszJI8YqNw8V2xPulzjO_esZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); 7 | unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; 8 | } 9 | /* cyrillic */ 10 | @font-face { 11 | font-family: 'Ubuntu'; 12 | font-style: normal; 13 | font-weight: 400; 14 | src: local('Ubuntu'), url(http://fonts.gstatic.com/s/ubuntu/v7/iQ9VJx1UMASKNiGywyyCXvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); 15 | unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; 16 | } 17 | /* greek-ext */ 18 | @font-face { 19 | font-family: 'Ubuntu'; 20 | font-style: normal; 21 | font-weight: 400; 22 | src: local('Ubuntu'), url(http://fonts.gstatic.com/s/ubuntu/v7/WkvQmvwsfw_KKeau9SlQ2_esZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); 23 | unicode-range: U+1F00-1FFF; 24 | } 25 | /* greek */ 26 | @font-face { 27 | font-family: 'Ubuntu'; 28 | font-style: normal; 29 | font-weight: 400; 30 | src: local('Ubuntu'), url(http://fonts.gstatic.com/s/ubuntu/v7/gYAtqXUikkQjyJA1SnpDLvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); 31 | unicode-range: U+0370-03FF; 32 | } 33 | /* latin-ext */ 34 | @font-face { 35 | font-family: 'Ubuntu'; 36 | font-style: normal; 37 | font-weight: 400; 38 | src: local('Ubuntu'), url(http://fonts.gstatic.com/s/ubuntu/v7/Wu5Iuha-XnKDBvqRwQzAG_esZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); 39 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; 40 | } 41 | /* latin */ 42 | @font-face { 43 | font-family: 'Ubuntu'; 44 | font-style: normal; 45 | font-weight: 400; 46 | src: local('Ubuntu'), url(http://fonts.gstatic.com/s/ubuntu/v7/sDGTilo5QRsfWu6Yc11AXg.woff2) format('woff2'); 47 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; 48 | } 49 | 50 | body { 51 | margin-left: 5%; 52 | margin-right: 5%; 53 | font-size: 16px; 54 | font-family: 'Ubuntu'; 55 | } 56 | .center { 57 | margin: auto; 58 | float: none; 59 | } 60 | 61 | .top-bottom-padding { 62 | padding-bottom: 10px; 63 | padding-top: 70px; 64 | } 65 | 66 | a:link { 67 | text-decoration: none; 68 | } 69 | 70 | /* Set width on the form input elements since they're 100% wide by default */ 71 | input, 72 | select, 73 | textarea { 74 | max-width: 400px; 75 | } 76 | --------------------------------------------------------------------------------