Beispiel #1
0
 public static ContentTreeViewItemDTO Quiz2ContentTreeViewItemDto(this QuizListDTO token)
 {
     return(new ContentTreeViewItemDTO
     {
         id = token.Sid
         , quizId = token.QuizId
         , name = token.Title
         , type = CourseEnums.eContentTreeViewItemType.quiz
     });
 }
Beispiel #2
0
        //[HttpPost]
        //public ActionResult SaveCourseQuiz2(CourseQuizDTO token)
        //{
        //    string error;
        //    var saved = _courseQuizzesServices.SaveCourseQuiz(token, out error);
        //    return Json(new JsonResponseToken { success = saved, error = error, result = token.CourseQuizId });
        //}

        public virtual JsonResult DestroyCourseQuiz([DataSourceRequest] DataSourceRequest request, QuizListDTO quiz)
        {
            string error;
            var    deleted = _quizAdminServices.DeleteQuiz(quiz.QuizId, out error);

            return(Json(deleted ? new[] { quiz }.ToDataSourceResult(request, ModelState) : new[] { new QuizListDTO() }.ToDataSourceResult(request, ModelState)));
        }