public ActionResult DeleteQuestion(QuizQuestionDTO token) { string error; _quizAdminServices.DeleteQuestion(token.QuestionId, out error); return(Json(ModelState.ToDataSourceResult())); }
public ActionResult SaveQuestion(QuizQuestionDTO token) { string error; var isNew = token.QuestionId < 0; var result = _quizAdminServices.SaveQuestion(token, out error); return(Json(new JsonResponseToken { success = result, result = new { isNew, id = token.QuestionId }, error = error }, JsonRequestBehavior.AllowGet)); }
public static void UpdateQuizQuestionEntity(this QZ_QuizQuestionsLib entity, QuizQuestionDTO token) { entity.QuestionText = token.QuestionText; entity.TypeId = (byte)token.Type; entity.Description = token.Description; entity.Score = token.Score; entity.BcIdentifier = token.BcIdentifier; entity.ImageUrl = token.ImageUrl; entity.IsActive = token.IsActive; entity.UpdateDate = DateTime.Now; entity.UpdatedBy = DtoExtensions.CurrentUserId; }
public static QZ_StudentQuizAnswers QuestionDto2StudentQuizAnswerEntity(this QuizQuestionDTO token, Guid attemptId, int index) { return(new QZ_StudentQuizAnswers { AttemptId = attemptId , QuestionId = token.QuestionId , QuestionText = token.QuestionText , OrderIndex = index , Score = token.Score , IsCorrect = false , AddOn = DateTime.Now }); }
public static QZ_QuizQuestionsLib Dto2QuizQuestionsEntity(this QuizQuestionDTO token) { return(new QZ_QuizQuestionsLib { QuizId = token.QuizId , QuestionText = token.QuestionText , TypeId = (byte)token.Type , Description = token.Description , Score = token.Score , OrderIndex = token.Index , BcIdentifier = token.BcIdentifier , ImageUrl = token.ImageUrl , IsActive = token.IsActive , AddOn = DateTime.Now , CreatedBy = DtoExtensions.CurrentUserId }); }