private void SetTestCaseResult(TblCompiledQuestionsData compiledData, TblCompiledAnswers compileAnswer)
    {
        var inputCell = new TableCell {
            Text = compiledData.Input
        };

        var expectedOutputCell = new TableCell {
            Text = compiledData.Output
        };

        var userOutputCell = new TableCell {
            Text = compileAnswer.Output
        };

        var timeUsedCell = new TableCell {
            Text = compileAnswer.TimeUsed.ToString()
        };

        var memoryUsedCell = new TableCell {
            Text = compileAnswer.MemoryUsed.ToString()
        };

        var statusCell = new TableCell {
            Text = ((Status)compileAnswer.StatusRef).ToString()
        };


        var tableRow = new TableRow();

        tableRow.Cells.AddRange(new[] { inputCell, expectedOutputCell, userOutputCell, timeUsedCell, memoryUsedCell, statusCell });


        _compiledAnswerTable.Rows.Add(tableRow);
    }
Пример #2
0
        private static void StoreData(int compiledQuestionRef, string input, string ouput)
        {
            var cqd = new TblCompiledQuestionsData
            {
                CompiledQuestionRef = compiledQuestionRef,
                Input = input,
                Output = ouput
            };

            ServerModel.DB.Insert(cqd);
        }
Пример #3
0
        private static void StoreData(int compiledQuestionRef, string input, string ouput)
        {
            var cqd = new TblCompiledQuestionsData
            {
                CompiledQuestionRef = compiledQuestionRef,
                Input  = input,
                Output = ouput
            };

            ServerModel.DB.Insert(cqd);
        }
Пример #4
0
        private static TblCompiledAnswers StorePreCompiledAnswer(TblUserAnswers ans, TblCompiledQuestionsData data)
        {
            var compiledAnswer = new TblCompiledAnswers
            {
                MemoryUsed               = 0,
                TimeUsed                 = 0,
                StatusRef                = (int)Status.Enqueued,
                Output                   = string.Empty,
                UserAnswerRef            = ans.ID,
                CompiledQuestionsDataRef = data.ID
            };

            ServerModel.DB.Insert(compiledAnswer);

            return(compiledAnswer);
        }
    private void SetTestCaseResult(TblCompiledQuestionsData compiledData, TblCompiledAnswers compileAnswer)
    {
        var inputCell = new TableCell {Text = compiledData.Input};

        var expectedOutputCell = new TableCell {Text = compiledData.Output};

        var userOutputCell = new TableCell {Text = compileAnswer.Output};

        var timeUsedCell = new TableCell {Text = compileAnswer.TimeUsed.ToString()};

        var memoryUsedCell = new TableCell {Text = compileAnswer.MemoryUsed.ToString()};

        var statusCell = new TableCell {Text = ((Status) compileAnswer.StatusRef).ToString()};


        var tableRow = new TableRow();
        tableRow.Cells.AddRange(new[]{inputCell, expectedOutputCell, userOutputCell, timeUsedCell, memoryUsedCell, statusCell});


        _compiledAnswerTable.Rows.Add(tableRow);
    }
    private void SetTestCaseResult(TblCompiledQuestionsData compiledData, TblCompiledAnswers compileAnswer)
    {
        var tableRow = new TableRow();

        if (ServerModel.User.Current.Islector())
        {
            var inputCell = new TableCell {
                Text = MakeSpaceAndEnterVisible(compiledData.Input)
            };

            var expectedOutputCell = new TableCell {
                Text = MakeSpaceAndEnterVisible(compiledData.Output)
            };

            tableRow.Cells.AddRange(new[] { inputCell, expectedOutputCell });
        }

        var userOutputCell = new TableCell
        {
            Text = MakeSpaceAndEnterVisible(compileAnswer.Output)
        };

        var timeUsedCell = new TableCell {
            Text = compileAnswer.TimeUsed.ToString()
        };

        var memoryUsedCell = new TableCell {
            Text = compileAnswer.MemoryUsed.ToString()
        };

        var statusCell = new TableCell {
            Text = ((Status)compileAnswer.StatusRef).ToString()
        };


        tableRow.Cells.AddRange(new[] { userOutputCell, timeUsedCell, memoryUsedCell, statusCell });

        _compiledAnswerTable.Rows.Add(tableRow);
    }
    private void SetTestCaseResult(TblCompiledQuestionsData compiledData, TblCompiledAnswers compileAnswer)
    {
        var tableRow = new TableRow();

        if (ServerModel.User.Current.Islector())
        {
            var inputCell = new TableCell { Text = MakeSpaceAndEnterVisible(compiledData.Input) };

            var expectedOutputCell = new TableCell { Text = MakeSpaceAndEnterVisible(compiledData.Output) };

            tableRow.Cells.AddRange(new[] { inputCell, expectedOutputCell });
        }

        var userOutputCell = new TableCell
        {
            Text = MakeSpaceAndEnterVisible(compileAnswer.Output)
        };

        var timeUsedCell = new TableCell { Text = compileAnswer.TimeUsed.ToString() };

        var memoryUsedCell = new TableCell { Text = compileAnswer.MemoryUsed.ToString() };

        var statusCell = new TableCell { Text = ((Status)compileAnswer.StatusRef).ToString() };


        tableRow.Cells.AddRange(new[] { userOutputCell, timeUsedCell, memoryUsedCell, statusCell });

        _compiledAnswerTable.Rows.Add(tableRow);
    }
Пример #8
0
 private void PrepateTestCaseForTesting(TblCompiledQuestionsData testCase)
 {
     _program.InputTest = testCase.Input;
     _program.OutputTest = testCase.Output.Replace("\r", string.Empty);
 }
Пример #9
0
        private static TblCompiledAnswers StorePreCompiledAnswer(TblUserAnswers ans, TblCompiledQuestionsData data)
        {
            var compiledAnswer = new TblCompiledAnswers
                                     {
                                         MemoryUsed = 0,
                                         TimeUsed = 0,
                                         StatusRef = (int)Status.Enqueued,
                                         Output = string.Empty,
                                         UserAnswerRef = ans.ID,
                                         CompiledQuestionsDataRef = data.ID
                                     };

            ServerModel.DB.Insert(compiledAnswer);

            return compiledAnswer;
        }
Пример #10
0
 private void PrepateTestCaseForTesting(TblCompiledQuestionsData testCase)
 {
     _program.InputTest  = testCase.Input;
     _program.OutputTest = testCase.Output.Replace("\r", string.Empty);
 }
Пример #11
0
 private void PrepateTestCaseForTesting(TblCompiledQuestionsData testCase)
 {
     _program.InputTest  = testCase.Input;
     _program.OutputTest = testCase.Output;
 }
Пример #12
0
 private void PrepateTestCaseForTesting(TblCompiledQuestionsData testCase)
 {
     _program.InputTest = testCase.Input;
     _program.OutputTest = testCase.Output;
 }