Skip to content

Commit

Permalink
Merge pull request #27 from ralphwilliams/AddingQandA
Browse files Browse the repository at this point in the history
Adding qand a
Create Admin link to view from status view
Create printer friendly css
Hide link to answers if no answers
Hide heading for Quesions in video player view if no questions
Icon for managing questions for videos
Add Course name to answers view
Print button
Edit question sort
Group Questions by video
Return to Edit Course from Edit Questions
  • Loading branch information
ralphwilliams authored Aug 4, 2016
2 parents 8ca0f12 + f062dee commit d440670
Show file tree
Hide file tree
Showing 34 changed files with 2,784 additions and 173 deletions.
1,030 changes: 1,030 additions & 0 deletions .vs/config/applicationhost.config

Large diffs are not rendered by default.

File renamed without changes.
17 changes: 6 additions & 11 deletions Calvary_VideoCourse.dnn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="DNNVideoCourse" type="Module" version="01.01.00">
<package name="DNNVideoCourse" type="Module" version="01.02.00">
<friendlyName>DNN Video Course</friendlyName>
<description>DNN Video Course module</description>
<iconFile>Images/logo_min.png</iconFile>
Expand All @@ -22,18 +22,13 @@
<basePath>DesktopModules\DNNVideoCourse</basePath>
<script type="Install">
<path>Providers\DataProviders\SqlDataProvider</path>
<name>00.00.01.SqlDataProvider</name>
<version>00.00.01</version>
</script>
<script type="Install">
<path>Providers\DataProviders\SqlDataProvider</path>
<name>01.01.00.SqlDataProvider</name>
<version>01.01.00</version>
<name>01.02.00.SqlDataProvider</name>
<version>01.02.00</version>
</script>
<script type="UnInstall">
<path>Providers\DataProviders\SqlDataProvider</path>
<name>Uninstall.SqlDataProvider</name>
<version>01.01.00</version>
<version>01.01.01</version>
</script>
</scripts>
</component>
Expand Down Expand Up @@ -78,7 +73,7 @@
<attributes>
<businessControllerClass>RalphWilliams.Modules.DNNVideoCourse.Components.FeatureController</businessControllerClass>
<desktopModuleID>[DESKTOPMODULEID]</desktopModuleID>
<upgradeVersionsList>01.01.00</upgradeVersionsList>
<upgradeVersionsList>01.02.00</upgradeVersionsList>
</attributes>
</eventMessage>
</component>
Expand All @@ -92,7 +87,7 @@
</assemblies>
</component>

<component type="Cleanup" version="01.01.00" fileName ="01.01.00.txt" />
<component type="Cleanup" version="01.02.00" fileName ="01.02.00.txt" />

</components>
</package>
Expand Down
2 changes: 1 addition & 1 deletion Components/FeatureController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public string UpgradeModule(string Version)

switch (Version)
{
case "01.00.06": // should be whichever version number is being upgraded to or currently installed
case "01.02.00": // should be whichever version number is being upgraded to or currently installed
try
{
// get a collection of portals to iterate through
Expand Down
74 changes: 74 additions & 0 deletions Controllers/AnswerController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
' Copyright (c) 2015 Ralph Williams (RalphWilliams.com)
' All rights reserved.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.
'
*/

using System.Collections.Generic;
using DotNetNuke.Data;
using RalphWilliams.Modules.DNNVideoCourse.Entities;

namespace RalphWilliams.Modules.DNNVideoCourse.Controllers
{
class AnswerController
{
public void CreateAnswer(AnswerInfo a)
{
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<AnswerInfo>();
rep.Insert(a);
}
}

public void DeleteAnswer(int answerId, int moduleId)
{
var a = GetAnswer(answerId, moduleId);
DeleteAnswer(a);
}

public void DeleteAnswer(AnswerInfo a)
{
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<AnswerInfo>();
rep.Delete(a);
}
}

public IEnumerable<AnswerInfo> GetAnswers(int moduleId)
{
IEnumerable<AnswerInfo> a;
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<AnswerInfo>();
a = rep.Get(moduleId);
}
return a;
}
public AnswerInfo GetAnswer(int answerId, int moduleId)
{
AnswerInfo a = null;
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<AnswerInfo>();
a = rep.GetById(answerId, moduleId);
}
return a;
}
public void UpdateAnswer(AnswerInfo a)
{
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<AnswerInfo>();
rep.Update(a);
}
}
}
}
76 changes: 76 additions & 0 deletions Controllers/QuestionController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
' Copyright (c) 2015 Ralph Williams (RalphWilliams.com)
' All rights reserved.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.
'
*/

using System.Collections.Generic;
using DotNetNuke.Data;
using RalphWilliams.Modules.DNNVideoCourse.Entities;

namespace RalphWilliams.Modules.DNNVideoCourse.Controllers
{
class QuestionController
{
public void CreateQuestion(QuestionInfo q)
{
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<QuestionInfo>();
rep.Insert(q);
}
}

public void DeleteQuestion(int questionId, int moduleId)
{
var q = GetQuestion(questionId, moduleId);
DeleteQuestion(q);
}

public void DeleteQuestion(QuestionInfo q)
{
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<QuestionInfo>();
rep.Delete(q);
}
}

public IEnumerable<QuestionInfo> GetQuestions(int moduleId)
{
IEnumerable<QuestionInfo> q;
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<QuestionInfo>();
q = rep.Get(moduleId);
}
return q;
}

public QuestionInfo GetQuestion(int questionId, int moduleId)
{
QuestionInfo q = null;
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<QuestionInfo>();
q = rep.GetById(questionId, moduleId);
}
return q;
}

public void UpdateQuestion(QuestionInfo q)
{
using (IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<QuestionInfo>();
rep.Update(q);
}
}
}
}
13 changes: 12 additions & 1 deletion DNNVideoCourse.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Components\FeatureController.cs" />
<Compile Include="Controllers\AnswerController.cs" />
<Compile Include="Controllers\QuestionController.cs" />
<Compile Include="Controllers\VideoController.cs" />
<Compile Include="Entities\NewAnswerDTO.cs" />
<Compile Include="Entities\NewRoleGroupDTO.cs" />
<Compile Include="Entities\AnswerInfo.cs" />
<Compile Include="Entities\NewQuestionDTO.cs" />
<Compile Include="Entities\QuestionInfo.cs" />
<Compile Include="Entities\VideoInfo.cs" />
<Compile Include="Components\Calvary_VideoCourseModuleBase.cs">
<SubType>ASPXCodeBehind</SubType>
Expand All @@ -114,7 +120,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="01.01.00.txt" />
<Content Include="01.02.00.txt" />
<Content Include="Content\angular-ui.css" />
<Content Include="Content\angular-ui.min.css" />
<Content Include="Content\bootstrap-flat-extras.css" />
Expand Down Expand Up @@ -166,7 +172,9 @@
<Content Include="Content\themes\base\tooltip.css" />
<Content Include="Content\ui-bootstrap-csp.css" />
<Content Include="fonts\icomoon.svg" />
<Content Include="ng\Controllers\answerListCtrl.js" />
<Content Include="ng\Controllers\editCourseCtrl.js" />
<Content Include="ng\Controllers\editQuestionsCtrl.js" />
<Content Include="ng\Controllers\statusCtrl.js" />
<Content Include="ng\Controllers\editCategoriesCtrl.js" />
<Content Include="ng\Controllers\videoCtrl.js" />
Expand All @@ -177,7 +185,9 @@
<Content Include="module.css" />
<Content Include="ng\app.js" />
<Content Include="ng\factories.js" />
<Content Include="ng\Views\answerListView.html" />
<Content Include="ng\Views\editCourseView.html" />
<Content Include="ng\Views\editQuestionsView.html" />
<Content Include="ng\Views\statusView.html" />
<Content Include="ng\Views\editCategories.html" />
<Content Include="ng\Views\templates\accordion-group.html" />
Expand Down Expand Up @@ -229,6 +239,7 @@
<Content Include="packages\MSBuildTasks.1.4.0.88\tools\MSBuild.psm1" />
<Content Include="packages\repositories.config" />
<Content Include="Providers\DataProviders\SqlDataProvider\01.01.00.SqlDataProvider" />
<Content Include="Providers\DataProviders\SqlDataProvider\01.02.00.SqlDataProvider" />
<None Include="Scripts\jquery-2.1.4.intellisense.js" />
<Content Include="Scripts\jquery-2.1.4.js" />
<Content Include="Scripts\jquery-2.1.4.min.js" />
Expand Down
71 changes: 71 additions & 0 deletions Entities/AnswerInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
' Copyright (c) 2015 Ralph Williams (RalphWilliams.com)
' All rights reserved.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.
'
*/

using System;
using System.Web.Caching;
using DotNetNuke.ComponentModel.DataAnnotations;

namespace RalphWilliams.Modules.DNNVideoCourse.Entities
{
[TableName("DNNVideoCourse_Answers")]
//setup the primary key for table
[PrimaryKey("AnswerId", AutoIncrement = true)]
//configure caching using PetaPoco
[Cacheable("Answers", CacheItemPriority.Default, 20)]
//scope the objects to the ModuleId of a module on a page (or copy of a module on a page)
[Scope("ModuleId")]
public class AnswerInfo
{
///<summary>
/// The ID of your object with the name of the VideoName
///</summary>
public int AnswerId { get; set; }
///<summary>
/// A string with the name of the VideoName
///</summary>
public int QuestionId { get; set; }

public int OrderIndex { get; set; }

public string AnswerText { get; set; }

///<summary>
/// An integer with the user id of the assigned user for the object
///</summary>
public int AssignedUserId { get; set; }

///<summary>
/// The ModuleId of where the object was created and gets displayed
///</summary>
public int ModuleId { get; set; }

///<summary>
/// An integer for the user id of the user who created the object
///</summary>
public int CreatedByUserId { get; set; }

///<summary>
/// An integer for the user id of the user who last updated the object
///</summary>
public int LastModifiedByUserId { get; set; }

///<summary>
/// The date the object was created
///</summary>
public DateTime CreatedOnDate { get; set; }

///<summary>
/// The date the object was updated
///</summary>
public DateTime LastModifiedOnDate { get; set; }
}
}
22 changes: 22 additions & 0 deletions Entities/NewAnswerDTO.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
' Copyright (c) 2015 Ralph Williams (RalphWilliams.com)
' All rights reserved.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.
'
*/

using System;

namespace RalphWilliams.Modules.DNNVideoCourse.Entities
{
// [Serializable]
public class NewAnswerDTO
{
public int AnswerId { get; set; }
}
}
22 changes: 22 additions & 0 deletions Entities/NewQuestionDTO.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
' Copyright (c) 2015 Ralph Williams (RalphWilliams.com)
' All rights reserved.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.
'
*/

using System;

namespace RalphWilliams.Modules.DNNVideoCourse.Entities
{
// [Serializable]
public class NewQuestionDTO
{
public int QuestionId { get; set; }
}
}
Loading

0 comments on commit d440670

Please sign in to comment.