/// <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));
 }
Example #3
0
 /// <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));
 }
Example #5
0
 /// <summary>
 /// Creates a question loader for a program question.
 /// </summary>
 IUserQuestionDataUpdater IQuestionResultVisitor <IUserQuestionDataUpdater> .Visit(
     ProgramQuestion question)
 {
     return(_defaultUserQuestionDataUpdater);
 }
Example #6
0
 /// <summary>
 /// Creates a question duplicator for a program question.
 /// </summary>
 IQuestionDuplicator IQuestionResultVisitor <IQuestionDuplicator> .Visit(ProgramQuestion question)
 {
     return(new ProgramQuestionDuplicator(_dbContext, question));
 }
Example #7
0
 /// <summary>
 /// Creates a question grader for a class question.
 /// </summary>
 IQuestionGrader IQuestionResultVisitor <IQuestionGrader> .Visit(ProgramQuestion question)
 {
     return(new ProgramQuestionGrader(question, _codeRunnerService));
 }