コード例 #1
0
        /// <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
            );
        }
コード例 #2
0
 /// <summary>
 /// Creates a question loader for a class question.
 /// </summary>
 IQuestionResolver IQuestionResultVisitor <IQuestionResolver, UserQuestionData> .Visit(
     ClassQuestion question,
     UserQuestionData userQuestionData)
 {
     return(new DefaultQuestionResolver(userQuestionData));
 }
コード例 #3
0
 /// <summary>
 /// Creates a question loader for a class question.
 /// </summary>
 IQuestionLoader IQuestionResultVisitor <IQuestionLoader> .Visit(ClassQuestion question)
 {
     return(new ClassQuestionLoader(_dbContext, question));
 }
コード例 #4
0
 /// <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));
 }
コード例 #5
0
 /// <summary>
 /// Creates a question loader for a class question.
 /// </summary>
 IUserQuestionDataUpdater IQuestionResultVisitor <IUserQuestionDataUpdater> .Visit(
     ClassQuestion question)
 {
     return(_defaultUserQuestionDataUpdater);
 }
コード例 #6
0
 /// <summary>
 /// Creates a question duplicator for a class question.
 /// </summary>
 IQuestionDuplicator IQuestionResultVisitor <IQuestionDuplicator> .Visit(ClassQuestion question)
 {
     return(new ClassQuestionDuplicator(_dbContext, question));
 }
コード例 #7
0
 /// <summary>
 /// Creates a question grader for a class question.
 /// </summary>
 IQuestionGrader IQuestionResultVisitor <IQuestionGrader> .Visit(ClassQuestion question)
 {
     return(new ClassQuestionGrader(question, _codeRunnerService));
 }