/// <summary> /// Verifies that the given program question was correctly duplicated. /// </summary> private void VerifyProgramQuestion( DatabaseContext dbContext, ProgramQuestion oldQuestion, ProgramQuestion newQuestion) { VerifyCodeQuestion(dbContext, oldQuestion, newQuestion); VerifyCollectionDuplicated ( dbContext, oldQuestion, newQuestion, q => q.Tests, t => t.Id, t => t.TestDescription ); }
/// <summary> /// Creates a question loader for a program question. /// </summary> IQuestionResolver IQuestionResultVisitor <IQuestionResolver, UserQuestionData> .Visit( ProgramQuestion question, UserQuestionData userQuestionData) { return(new DefaultQuestionResolver(userQuestionData)); }
/// <summary> /// Creates a question loader for a program question. /// </summary> IQuestionLoader IQuestionResultVisitor <IQuestionLoader> .Visit(ProgramQuestion question) { return(new ProgramQuestionLoader(_dbContext, question)); }
/// <summary> /// Creates a question updater for a program question. /// </summary> IQuestionUpdater IQuestionResultVisitor <IQuestionUpdater, IModelErrorCollection> .Visit( ProgramQuestion question, IModelErrorCollection errors) { return(new ProgramQuestionUpdater(_dbContext, question, errors)); }
/// <summary> /// Creates a question loader for a program question. /// </summary> IUserQuestionDataUpdater IQuestionResultVisitor <IUserQuestionDataUpdater> .Visit( ProgramQuestion question) { return(_defaultUserQuestionDataUpdater); }
/// <summary> /// Creates a question duplicator for a program question. /// </summary> IQuestionDuplicator IQuestionResultVisitor <IQuestionDuplicator> .Visit(ProgramQuestion question) { return(new ProgramQuestionDuplicator(_dbContext, question)); }
/// <summary> /// Creates a question grader for a class question. /// </summary> IQuestionGrader IQuestionResultVisitor <IQuestionGrader> .Visit(ProgramQuestion question) { return(new ProgramQuestionGrader(question, _codeRunnerService)); }