/// <summary> /// Verifies that the given class question was correctly duplicated. /// </summary> private void VerifyClassQuestion( DatabaseContext dbContext, ClassQuestion oldQuestion, ClassQuestion newQuestion) { VerifyCodeQuestion(dbContext, oldQuestion, newQuestion); VerifyCollectionDuplicated ( dbContext, oldQuestion, newQuestion, q => q.Tests, t => t.Id, t => t.Description ); VerifyCollectionDuplicated ( dbContext, oldQuestion, newQuestion, q => q.RequiredMethods, r => r.Id, r => r.Name ); }
/// <summary> /// Creates a question loader for a class question. /// </summary> IQuestionResolver IQuestionResultVisitor <IQuestionResolver, UserQuestionData> .Visit( ClassQuestion question, UserQuestionData userQuestionData) { return(new DefaultQuestionResolver(userQuestionData)); }
/// <summary> /// Creates a question loader for a class question. /// </summary> IQuestionLoader IQuestionResultVisitor <IQuestionLoader> .Visit(ClassQuestion question) { return(new ClassQuestionLoader(_dbContext, question)); }
/// <summary> /// Creates a question updater for a class question. /// </summary> IQuestionUpdater IQuestionResultVisitor <IQuestionUpdater, IModelErrorCollection> .Visit( ClassQuestion question, IModelErrorCollection errors) { return(new ClassQuestionUpdater(_dbContext, question, errors)); }
/// <summary> /// Creates a question loader for a class question. /// </summary> IUserQuestionDataUpdater IQuestionResultVisitor <IUserQuestionDataUpdater> .Visit( ClassQuestion question) { return(_defaultUserQuestionDataUpdater); }
/// <summary> /// Creates a question duplicator for a class question. /// </summary> IQuestionDuplicator IQuestionResultVisitor <IQuestionDuplicator> .Visit(ClassQuestion question) { return(new ClassQuestionDuplicator(_dbContext, question)); }
/// <summary> /// Creates a question grader for a class question. /// </summary> IQuestionGrader IQuestionResultVisitor <IQuestionGrader> .Visit(ClassQuestion question) { return(new ClassQuestionGrader(question, _codeRunnerService)); }