C# Class Ru.GameSchool.BusinessLayer.Services.LevelService

Service class that abstracts the interraction around the level entity with the data layer.
Inheritance: BaseService
Datei anzeigen Open project: davidein/Ru.GameSchool Class Usage Examples

Public Methods

Method Description
AddLevelProjectToCourseAndLevel ( LevelProject levelproject, int courseId ) : void

Adds a levelproject instance to a level

AnswerLevelExamQuestion ( int answerId, int userInfoId ) : void

Creates a user answer for a specific exam question.

CreateLevel ( Level level ) : void

Persist a level instance object to the datasource.

CreateLevelExam ( LevelExam levelExam ) : void

Persist a levelexam instance object to the datasource.

CreateLevelExamAnswer ( LevelExamAnswer levelExamAnswer ) : void

Creates a LevelExamAnswer

CreateLevelExamQuestion ( LevelExamQuestion levelExamQuestion ) : void

Creates a level exam question.

CreateLevelMaterial ( LevelMaterial levelMaterial, int courseId ) : void

Create level material item

CreateLevelProject ( LevelProject levelProject ) : void

Creates a levelproject instance

CreateLevelProjectResult ( LevelProjectResult levelProjectResult ) : void

checks if level

CreateUserLevelProjectResult ( LevelProjectResult levelProjectResult, UserInfo user ) : void

DeleteLevelExamAnswer ( int levelExamAnswerId ) : void

Deletes a level exam answer.

DeleteLevelExamQuestion ( int levelExamQuestionId ) : void

Deletes a level exam question. Also deletes all children answers.

DeleteLevelProject ( int levelProjectId ) : bool

checks if can delete

GetContentTypes ( ) : IEnumerable

Get level material content types

GetFirstQuestionByExamId ( int levelExamId ) : LevelExamQuestion

Gets the first question for a given exam.

GetLevel ( int levelId ) : Level

Gets a instance of Level from the datasource.

GetLevelExam ( int levelExamId ) : LevelExam

Get a level exam by LevelExamId.

GetLevelExamAnswer ( int levelExamAnswerId ) : LevelExamAnswer

Gets a level exam answer.

GetLevelExamQuestion ( int levelExamQuestionsId ) : LevelExamQuestion

Gets a level exam question.

GetLevelExamQuestionPlacement ( int levelExamQuestionId ) : int

Get the placement of the question in the level exam question list.

GetLevelExamsByCourseId ( int courseId, int userInfoId ) : IEnumerable

Gets a level exam by CourseId and UserInfoId.

GetLevelExamsByLevelId ( int levelId, int userInfoId ) : IEnumerable

Gets a level exam by LevelId and UserInfoId.

GetLevelMaterial ( int levelMaterialId ) : LevelMaterial

Get single level material with specific id

GetLevelMaterials ( ) : IEnumerable

Gets level materials

GetLevelMaterials ( int levelId ) : IEnumerable

Get level materials for a specified level

GetLevelMaterials ( int levelId, int contentTypeId ) : IEnumerable

Get level materials of a certain contenttype for a specified level

GetLevelProject ( int levelProjectId ) : LevelProject

Return a instance of levelproject by levelproject id

GetLevelProjectResultsByUserId ( int userInfoId ) : IEnumerable

Get a collection of levelprojectresult instances by userinfoid

GetLevelProjects ( ) : IEnumerable

Returns all instances of levelprojects

GetLevelProjectsByCourseId ( int courseId ) : IEnumerable

Gets all levelproject objects by course id

GetLevelProjectsByCourseIdAndUserInfoId ( int userInfoId, int courseId ) : IEnumerable

returns a collection

GetLevelProjectsByLevelId ( int levelId ) : IEnumerable

Returns a collection of levelproject by levelid

GetLevelProjectsByUserId ( int userInfoId ) : IEnumerable

returns a collection

GetLevelTabsByCourseIdAndUserInfoId ( int courseId, int userInfoId ) : IEnumerable

Get leveltabs by course id and user info id

GetLevels ( ) : IEnumerable

Returns a collection of levels

GetLevels ( int courseId ) : IEnumerable

Returns a collection of level instances

GetLevelsByCourseId ( int courseId ) : IEnumerable

Returns all level instances by course id

GetNextLevelExamQuestion ( int levelExamQuestionId ) : LevelExamQuestion

Gets the next question in a level exam.

GetUserQuestionAnswer ( int levelExamQuestionId, int userInfoId ) : int

Gets the users LevelExamAnswerId for an exam question.

GetlevelProjectResultByLevelProjectId ( int levelProjectId ) : LevelProjectResult

Returns a instance of levelprojectresult by levelproject id

GetlevelProjectResultsByLevelProjectId ( int levelProjectId ) : IEnumerable

GetlevelProjectResultsByLevelProjectResultId ( int id ) : LevelProjectResult

Returns a instance of levelprojectresult by levelprojectresultid

HasAccess ( int levelId, int userInfoId ) : bool

CHecks if a user has acces to a particular level

HasAccessToExam ( int levelExamId, int userInfoId ) : bool

Checks if the user has access to an exam.

ReturnExam ( int levelExamId, int userInfoId ) : double

Closes an exam and gives the user a grade, points and notification.

UpdateLevel ( Level level ) : void

Update a level object with new changes and persist it to the datasource.

UpdateLevelExam ( LevelExam levelExam ) : void

Updates a levelexam.

UpdateLevelMaterial ( LevelMaterial levelMaterial ) : void

Update level material item

UpdateLevelProject ( LevelProject levelProject ) : void

Updates a levelproject instance

UpdateLevelProjectFromResult ( LevelProject levelProject, int userInfoId ) : void

Updates a levelproject from levelrpojectresult

UpdateLevelProjectResult ( LevelProjectResult levelProjectResult ) : void

Updates a instance of levelproject

Method Details

AddLevelProjectToCourseAndLevel() public method

Adds a levelproject instance to a level
public AddLevelProjectToCourseAndLevel ( LevelProject levelproject, int courseId ) : void
levelproject Ru.GameSchool.DataLayer.Repository.LevelProject
courseId int
return void

AnswerLevelExamQuestion() public method

Creates a user answer for a specific exam question.
public AnswerLevelExamQuestion ( int answerId, int userInfoId ) : void
answerId int Integer value of answer if
userInfoId int Integer value of userinfoid
return void

CreateLevel() public method

Persist a level instance object to the datasource.
public CreateLevel ( Level level ) : void
level Ru.GameSchool.DataLayer.Repository.Level Level instance to add.
return void

CreateLevelExam() public method

Persist a levelexam instance object to the datasource.
public CreateLevelExam ( LevelExam levelExam ) : void
levelExam Ru.GameSchool.DataLayer.Repository.LevelExam A levelexam persist.
return void

CreateLevelExamAnswer() public method

Creates a LevelExamAnswer
public CreateLevelExamAnswer ( LevelExamAnswer levelExamAnswer ) : void
levelExamAnswer Ru.GameSchool.DataLayer.Repository.LevelExamAnswer Levelexamanswer instance
return void

CreateLevelExamQuestion() public method

Creates a level exam question.
public CreateLevelExamQuestion ( LevelExamQuestion levelExamQuestion ) : void
levelExamQuestion Ru.GameSchool.DataLayer.Repository.LevelExamQuestion Levelexamquestion object
return void

CreateLevelMaterial() public method

Create level material item
public CreateLevelMaterial ( LevelMaterial levelMaterial, int courseId ) : void
levelMaterial Ru.GameSchool.DataLayer.Repository.LevelMaterial levelmaterial object
courseId int Id of course
return void

CreateLevelProject() public method

Creates a levelproject instance
public CreateLevelProject ( LevelProject levelProject ) : void
levelProject Ru.GameSchool.DataLayer.Repository.LevelProject LEvelproject object
return void

CreateLevelProjectResult() public method

checks if level
public CreateLevelProjectResult ( LevelProjectResult levelProjectResult ) : void
levelProjectResult Ru.GameSchool.DataLayer.Repository.LevelProjectResult
return void

CreateUserLevelProjectResult() public method

public CreateUserLevelProjectResult ( LevelProjectResult levelProjectResult, UserInfo user ) : void
levelProjectResult Ru.GameSchool.DataLayer.Repository.LevelProjectResult
user Ru.GameSchool.DataLayer.Repository.UserInfo
return void

DeleteLevelExamAnswer() public method

Deletes a level exam answer.
public DeleteLevelExamAnswer ( int levelExamAnswerId ) : void
levelExamAnswerId int
return void

DeleteLevelExamQuestion() public method

Deletes a level exam question. Also deletes all children answers.
public DeleteLevelExamQuestion ( int levelExamQuestionId ) : void
levelExamQuestionId int
return void

DeleteLevelProject() public method

checks if can delete
public DeleteLevelProject ( int levelProjectId ) : bool
levelProjectId int
return bool

GetContentTypes() public method

Get level material content types
public GetContentTypes ( ) : IEnumerable
return IEnumerable

GetFirstQuestionByExamId() public method

Gets the first question for a given exam.
public GetFirstQuestionByExamId ( int levelExamId ) : LevelExamQuestion
levelExamId int
return Ru.GameSchool.DataLayer.Repository.LevelExamQuestion

GetLevel() public method

Gets a instance of Level from the datasource.
public GetLevel ( int levelId ) : Level
levelId int The id of a level object to get.
return Ru.GameSchool.DataLayer.Repository.Level

GetLevelExam() public method

Get a level exam by LevelExamId.
public GetLevelExam ( int levelExamId ) : LevelExam
levelExamId int
return Ru.GameSchool.DataLayer.Repository.LevelExam

GetLevelExamAnswer() public method

Gets a level exam answer.
public GetLevelExamAnswer ( int levelExamAnswerId ) : LevelExamAnswer
levelExamAnswerId int
return Ru.GameSchool.DataLayer.Repository.LevelExamAnswer

GetLevelExamQuestion() public method

Gets a level exam question.
public GetLevelExamQuestion ( int levelExamQuestionsId ) : LevelExamQuestion
levelExamQuestionsId int
return Ru.GameSchool.DataLayer.Repository.LevelExamQuestion

GetLevelExamQuestionPlacement() public method

Get the placement of the question in the level exam question list.
public GetLevelExamQuestionPlacement ( int levelExamQuestionId ) : int
levelExamQuestionId int
return int

GetLevelExamsByCourseId() public method

Gets a level exam by CourseId and UserInfoId.
public GetLevelExamsByCourseId ( int courseId, int userInfoId ) : IEnumerable
courseId int
userInfoId int
return IEnumerable

GetLevelExamsByLevelId() public method

Gets a level exam by LevelId and UserInfoId.
public GetLevelExamsByLevelId ( int levelId, int userInfoId ) : IEnumerable
levelId int
userInfoId int
return IEnumerable

GetLevelMaterial() public method

Get single level material with specific id
public GetLevelMaterial ( int levelMaterialId ) : LevelMaterial
levelMaterialId int Id of levelmaterial
return Ru.GameSchool.DataLayer.Repository.LevelMaterial

GetLevelMaterials() public method

Gets level materials
public GetLevelMaterials ( ) : IEnumerable
return IEnumerable

GetLevelMaterials() public method

Get level materials for a specified level
public GetLevelMaterials ( int levelId ) : IEnumerable
levelId int Id of level
return IEnumerable

GetLevelMaterials() public method

Get level materials of a certain contenttype for a specified level
public GetLevelMaterials ( int levelId, int contentTypeId ) : IEnumerable
levelId int Id of level
contentTypeId int Type of levelmaterial
return IEnumerable

GetLevelProject() public method

Return a instance of levelproject by levelproject id
public GetLevelProject ( int levelProjectId ) : LevelProject
levelProjectId int Id of a levelproject
return Ru.GameSchool.DataLayer.Repository.LevelProject

GetLevelProjectResultsByUserId() public method

Get a collection of levelprojectresult instances by userinfoid
public GetLevelProjectResultsByUserId ( int userInfoId ) : IEnumerable
userInfoId int Id of a userInfo instance.
return IEnumerable

GetLevelProjects() public method

Returns all instances of levelprojects
public GetLevelProjects ( ) : IEnumerable
return IEnumerable

GetLevelProjectsByCourseId() public method

Gets all levelproject objects by course id
public GetLevelProjectsByCourseId ( int courseId ) : IEnumerable
courseId int Id of a course to find levelproject objects
return IEnumerable

GetLevelProjectsByCourseIdAndUserInfoId() public method

returns a collection
public GetLevelProjectsByCourseIdAndUserInfoId ( int userInfoId, int courseId ) : IEnumerable
userInfoId int
courseId int
return IEnumerable

GetLevelProjectsByLevelId() public method

Returns a collection of levelproject by levelid
public GetLevelProjectsByLevelId ( int levelId ) : IEnumerable
levelId int Integer vased value of levelid to find
return IEnumerable

GetLevelProjectsByUserId() public method

returns a collection
public GetLevelProjectsByUserId ( int userInfoId ) : IEnumerable
userInfoId int
return IEnumerable

GetLevelTabsByCourseIdAndUserInfoId() public method

Get leveltabs by course id and user info id
public GetLevelTabsByCourseIdAndUserInfoId ( int courseId, int userInfoId ) : IEnumerable
courseId int Id of a course to find
userInfoId int Id of a userinfo to find
return IEnumerable

GetLevels() public method

Returns a collection of levels
public GetLevels ( ) : IEnumerable
return IEnumerable

GetLevels() public method

Returns a collection of level instances
public GetLevels ( int courseId ) : IEnumerable
courseId int
return IEnumerable

GetLevelsByCourseId() public method

Returns all level instances by course id
public GetLevelsByCourseId ( int courseId ) : IEnumerable
courseId int Id of course
return IEnumerable

GetNextLevelExamQuestion() public method

Gets the next question in a level exam.
public GetNextLevelExamQuestion ( int levelExamQuestionId ) : LevelExamQuestion
levelExamQuestionId int The current level exam question id.
return Ru.GameSchool.DataLayer.Repository.LevelExamQuestion

GetUserQuestionAnswer() public method

Gets the users LevelExamAnswerId for an exam question.
If the question does not exist.
public GetUserQuestionAnswer ( int levelExamQuestionId, int userInfoId ) : int
levelExamQuestionId int
userInfoId int
return int

GetlevelProjectResultByLevelProjectId() public method

Returns a instance of levelprojectresult by levelproject id
public GetlevelProjectResultByLevelProjectId ( int levelProjectId ) : LevelProjectResult
levelProjectId int
return Ru.GameSchool.DataLayer.Repository.LevelProjectResult

GetlevelProjectResultsByLevelProjectId() public method

public GetlevelProjectResultsByLevelProjectId ( int levelProjectId ) : IEnumerable
levelProjectId int
return IEnumerable

GetlevelProjectResultsByLevelProjectResultId() public method

Returns a instance of levelprojectresult by levelprojectresultid
public GetlevelProjectResultsByLevelProjectResultId ( int id ) : LevelProjectResult
id int Levelprojectresultid
return Ru.GameSchool.DataLayer.Repository.LevelProjectResult

HasAccess() public method

CHecks if a user has acces to a particular level
public HasAccess ( int levelId, int userInfoId ) : bool
levelId int Integer value of level
userInfoId int Integer value of userinfo
return bool

HasAccessToExam() public method

Checks if the user has access to an exam.
public HasAccessToExam ( int levelExamId, int userInfoId ) : bool
levelExamId int Id of a levelexam
userInfoId int
return bool

ReturnExam() public method

Closes an exam and gives the user a grade, points and notification.
public ReturnExam ( int levelExamId, int userInfoId ) : double
levelExamId int id of a levelexam
userInfoId int id of an userinfo
return double

UpdateLevel() public method

Update a level object with new changes and persist it to the datasource.
public UpdateLevel ( Level level ) : void
level Ru.GameSchool.DataLayer.Repository.Level Level instance with updated values.
return void

UpdateLevelExam() public method

Updates a levelexam.
public UpdateLevelExam ( LevelExam levelExam ) : void
levelExam Ru.GameSchool.DataLayer.Repository.LevelExam Levelexam instance to update.
return void

UpdateLevelMaterial() public method

Update level material item
public UpdateLevelMaterial ( LevelMaterial levelMaterial ) : void
levelMaterial Ru.GameSchool.DataLayer.Repository.LevelMaterial Levelmaterial object
return void

UpdateLevelProject() public method

Updates a levelproject instance
public UpdateLevelProject ( LevelProject levelProject ) : void
levelProject Ru.GameSchool.DataLayer.Repository.LevelProject Levelproject object
return void

UpdateLevelProjectFromResult() public method

Updates a levelproject from levelrpojectresult
public UpdateLevelProjectFromResult ( LevelProject levelProject, int userInfoId ) : void
levelProject Ru.GameSchool.DataLayer.Repository.LevelProject Integer value of levelproject
userInfoId int
return void

UpdateLevelProjectResult() public method

Updates a instance of levelproject
public UpdateLevelProjectResult ( LevelProjectResult levelProjectResult ) : void
levelProjectResult Ru.GameSchool.DataLayer.Repository.LevelProjectResult
return void