-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from ralphwilliams/AddingQandA
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
Showing
34 changed files
with
2,784 additions
and
173 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
Oops, something went wrong.