C# Класс Ru.GameSchool.BusinessLayer.Services.LevelService

Service class that abstracts the interraction around the level entity with the data layer.
Наследование: BaseService
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Описание методов

AddLevelProjectToCourseAndLevel() публичный Метод

Adds a levelproject instance to a level
public AddLevelProjectToCourseAndLevel ( LevelProject levelproject, int courseId ) : void
levelproject Ru.GameSchool.DataLayer.Repository.LevelProject
courseId int
Результат void

AnswerLevelExamQuestion() публичный Метод

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
Результат void

CreateLevel() публичный Метод

Persist a level instance object to the datasource.
public CreateLevel ( Level level ) : void
level Ru.GameSchool.DataLayer.Repository.Level Level instance to add.
Результат void

CreateLevelExam() публичный Метод

Persist a levelexam instance object to the datasource.
public CreateLevelExam ( LevelExam levelExam ) : void
levelExam Ru.GameSchool.DataLayer.Repository.LevelExam A levelexam persist.
Результат void

CreateLevelExamAnswer() публичный Метод

Creates a LevelExamAnswer
public CreateLevelExamAnswer ( LevelExamAnswer levelExamAnswer ) : void
levelExamAnswer Ru.GameSchool.DataLayer.Repository.LevelExamAnswer Levelexamanswer instance
Результат void

CreateLevelExamQuestion() публичный Метод

Creates a level exam question.
public CreateLevelExamQuestion ( LevelExamQuestion levelExamQuestion ) : void
levelExamQuestion Ru.GameSchool.DataLayer.Repository.LevelExamQuestion Levelexamquestion object
Результат void

CreateLevelMaterial() публичный Метод

Create level material item
public CreateLevelMaterial ( LevelMaterial levelMaterial, int courseId ) : void
levelMaterial Ru.GameSchool.DataLayer.Repository.LevelMaterial levelmaterial object
courseId int Id of course
Результат void

CreateLevelProject() публичный Метод

Creates a levelproject instance
public CreateLevelProject ( LevelProject levelProject ) : void
levelProject Ru.GameSchool.DataLayer.Repository.LevelProject LEvelproject object
Результат void

CreateLevelProjectResult() публичный Метод

checks if level
public CreateLevelProjectResult ( LevelProjectResult levelProjectResult ) : void
levelProjectResult Ru.GameSchool.DataLayer.Repository.LevelProjectResult
Результат void

CreateUserLevelProjectResult() публичный Метод

public CreateUserLevelProjectResult ( LevelProjectResult levelProjectResult, UserInfo user ) : void
levelProjectResult Ru.GameSchool.DataLayer.Repository.LevelProjectResult
user Ru.GameSchool.DataLayer.Repository.UserInfo
Результат void

DeleteLevelExamAnswer() публичный Метод

Deletes a level exam answer.
public DeleteLevelExamAnswer ( int levelExamAnswerId ) : void
levelExamAnswerId int
Результат void

DeleteLevelExamQuestion() публичный Метод

Deletes a level exam question. Also deletes all children answers.
public DeleteLevelExamQuestion ( int levelExamQuestionId ) : void
levelExamQuestionId int
Результат void

DeleteLevelProject() публичный Метод

checks if can delete
public DeleteLevelProject ( int levelProjectId ) : bool
levelProjectId int
Результат bool

GetContentTypes() публичный Метод

Get level material content types
public GetContentTypes ( ) : IEnumerable
Результат IEnumerable

GetFirstQuestionByExamId() публичный Метод

Gets the first question for a given exam.
public GetFirstQuestionByExamId ( int levelExamId ) : LevelExamQuestion
levelExamId int
Результат Ru.GameSchool.DataLayer.Repository.LevelExamQuestion

GetLevel() публичный Метод

Gets a instance of Level from the datasource.
public GetLevel ( int levelId ) : Level
levelId int The id of a level object to get.
Результат Ru.GameSchool.DataLayer.Repository.Level

GetLevelExam() публичный Метод

Get a level exam by LevelExamId.
public GetLevelExam ( int levelExamId ) : LevelExam
levelExamId int
Результат Ru.GameSchool.DataLayer.Repository.LevelExam

GetLevelExamAnswer() публичный Метод

Gets a level exam answer.
public GetLevelExamAnswer ( int levelExamAnswerId ) : LevelExamAnswer
levelExamAnswerId int
Результат Ru.GameSchool.DataLayer.Repository.LevelExamAnswer

GetLevelExamQuestion() публичный Метод

Gets a level exam question.
public GetLevelExamQuestion ( int levelExamQuestionsId ) : LevelExamQuestion
levelExamQuestionsId int
Результат Ru.GameSchool.DataLayer.Repository.LevelExamQuestion

GetLevelExamQuestionPlacement() публичный Метод

Get the placement of the question in the level exam question list.
public GetLevelExamQuestionPlacement ( int levelExamQuestionId ) : int
levelExamQuestionId int
Результат int

GetLevelExamsByCourseId() публичный Метод

Gets a level exam by CourseId and UserInfoId.
public GetLevelExamsByCourseId ( int courseId, int userInfoId ) : IEnumerable
courseId int
userInfoId int
Результат IEnumerable

GetLevelExamsByLevelId() публичный Метод

Gets a level exam by LevelId and UserInfoId.
public GetLevelExamsByLevelId ( int levelId, int userInfoId ) : IEnumerable
levelId int
userInfoId int
Результат IEnumerable

GetLevelMaterial() публичный Метод

Get single level material with specific id
public GetLevelMaterial ( int levelMaterialId ) : LevelMaterial
levelMaterialId int Id of levelmaterial
Результат Ru.GameSchool.DataLayer.Repository.LevelMaterial

GetLevelMaterials() публичный Метод

Gets level materials
public GetLevelMaterials ( ) : IEnumerable
Результат IEnumerable

GetLevelMaterials() публичный Метод

Get level materials for a specified level
public GetLevelMaterials ( int levelId ) : IEnumerable
levelId int Id of level
Результат IEnumerable

GetLevelMaterials() публичный Метод

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
Результат IEnumerable

GetLevelProject() публичный Метод

Return a instance of levelproject by levelproject id
public GetLevelProject ( int levelProjectId ) : LevelProject
levelProjectId int Id of a levelproject
Результат Ru.GameSchool.DataLayer.Repository.LevelProject

GetLevelProjectResultsByUserId() публичный Метод

Get a collection of levelprojectresult instances by userinfoid
public GetLevelProjectResultsByUserId ( int userInfoId ) : IEnumerable
userInfoId int Id of a userInfo instance.
Результат IEnumerable

GetLevelProjects() публичный Метод

Returns all instances of levelprojects
public GetLevelProjects ( ) : IEnumerable
Результат IEnumerable

GetLevelProjectsByCourseId() публичный Метод

Gets all levelproject objects by course id
public GetLevelProjectsByCourseId ( int courseId ) : IEnumerable
courseId int Id of a course to find levelproject objects
Результат IEnumerable

GetLevelProjectsByCourseIdAndUserInfoId() публичный Метод

returns a collection
public GetLevelProjectsByCourseIdAndUserInfoId ( int userInfoId, int courseId ) : IEnumerable
userInfoId int
courseId int
Результат IEnumerable

GetLevelProjectsByLevelId() публичный Метод

Returns a collection of levelproject by levelid
public GetLevelProjectsByLevelId ( int levelId ) : IEnumerable
levelId int Integer vased value of levelid to find
Результат IEnumerable

GetLevelProjectsByUserId() публичный Метод

returns a collection
public GetLevelProjectsByUserId ( int userInfoId ) : IEnumerable
userInfoId int
Результат IEnumerable

GetLevelTabsByCourseIdAndUserInfoId() публичный Метод

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
Результат IEnumerable

GetLevels() публичный Метод

Returns a collection of levels
public GetLevels ( ) : IEnumerable
Результат IEnumerable

GetLevels() публичный Метод

Returns a collection of level instances
public GetLevels ( int courseId ) : IEnumerable
courseId int
Результат IEnumerable

GetLevelsByCourseId() публичный Метод

Returns all level instances by course id
public GetLevelsByCourseId ( int courseId ) : IEnumerable
courseId int Id of course
Результат IEnumerable

GetNextLevelExamQuestion() публичный Метод

Gets the next question in a level exam.
public GetNextLevelExamQuestion ( int levelExamQuestionId ) : LevelExamQuestion
levelExamQuestionId int The current level exam question id.
Результат Ru.GameSchool.DataLayer.Repository.LevelExamQuestion

GetUserQuestionAnswer() публичный Метод

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
Результат int

GetlevelProjectResultByLevelProjectId() публичный Метод

Returns a instance of levelprojectresult by levelproject id
public GetlevelProjectResultByLevelProjectId ( int levelProjectId ) : LevelProjectResult
levelProjectId int
Результат Ru.GameSchool.DataLayer.Repository.LevelProjectResult

GetlevelProjectResultsByLevelProjectId() публичный Метод

public GetlevelProjectResultsByLevelProjectId ( int levelProjectId ) : IEnumerable
levelProjectId int
Результат IEnumerable

GetlevelProjectResultsByLevelProjectResultId() публичный Метод

Returns a instance of levelprojectresult by levelprojectresultid
public GetlevelProjectResultsByLevelProjectResultId ( int id ) : LevelProjectResult
id int Levelprojectresultid
Результат Ru.GameSchool.DataLayer.Repository.LevelProjectResult

HasAccess() публичный Метод

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
Результат bool

HasAccessToExam() публичный Метод

Checks if the user has access to an exam.
public HasAccessToExam ( int levelExamId, int userInfoId ) : bool
levelExamId int Id of a levelexam
userInfoId int
Результат bool

ReturnExam() публичный Метод

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
Результат double

UpdateLevel() публичный Метод

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.
Результат void

UpdateLevelExam() публичный Метод

Updates a levelexam.
public UpdateLevelExam ( LevelExam levelExam ) : void
levelExam Ru.GameSchool.DataLayer.Repository.LevelExam Levelexam instance to update.
Результат void

UpdateLevelMaterial() публичный Метод

Update level material item
public UpdateLevelMaterial ( LevelMaterial levelMaterial ) : void
levelMaterial Ru.GameSchool.DataLayer.Repository.LevelMaterial Levelmaterial object
Результат void

UpdateLevelProject() публичный Метод

Updates a levelproject instance
public UpdateLevelProject ( LevelProject levelProject ) : void
levelProject Ru.GameSchool.DataLayer.Repository.LevelProject Levelproject object
Результат void

UpdateLevelProjectFromResult() публичный Метод

Updates a levelproject from levelrpojectresult
public UpdateLevelProjectFromResult ( LevelProject levelProject, int userInfoId ) : void
levelProject Ru.GameSchool.DataLayer.Repository.LevelProject Integer value of levelproject
userInfoId int
Результат void

UpdateLevelProjectResult() публичный Метод

Updates a instance of levelproject
public UpdateLevelProjectResult ( LevelProjectResult levelProjectResult ) : void
levelProjectResult Ru.GameSchool.DataLayer.Repository.LevelProjectResult
Результат void