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);
    }
Ejemplo n.º 2
0
        private static void StoreUpdatedCompiledAnswer(Result res, TblCompiledAnswers compiledAnswer)
        {
            compiledAnswer.MemoryUsed = res.MemoryUsed;
            compiledAnswer.TimeUsed   = res.TimeUsed;
            compiledAnswer.StatusRef  = (int)res.ProgramStatus;
            compiledAnswer.Output     = res.Output;

            ServerModel.DB.Update(compiledAnswer);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
0
    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);
    }
Ejemplo n.º 6
0
 public static TblCompiledQuestionsData GetCompiledQuestionDataForCompiledAnswer(TblCompiledAnswers ca)
 {
     return(ServerModel.DB.Load <TblCompiledQuestionsData>(ca.CompiledQuestionsDataRef));
 }
Ejemplo n.º 7
0
    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);
    }
Ejemplo n.º 8
0
 private static TblCompiledQuestionsData GetTestCaseData(TblCompiledAnswers c)
 {
     return ServerModel.DB.Load<TblCompiledQuestionsData>(c.CompiledQuestionsDataRef);
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 10
0
 private static void StoreUpdatedCompiledAnswer(Result res, TblCompiledAnswers compiledAnswer)
 {
     compiledAnswer.MemoryUsed = res.MemoryUsed;
     compiledAnswer.TimeUsed = res.TimeUsed;
     compiledAnswer.StatusRef = (int) res.ProgramStatus;
     compiledAnswer.Output = res.Output;
     
     ServerModel.DB.Update(compiledAnswer);
 }
Ejemplo n.º 11
0
 public static TblCompiledQuestionsData GetCompiledQuestionDataForCompiledAnswer(TblCompiledAnswers ca)
 {
     return ServerModel.DB.Load<TblCompiledQuestionsData>(ca.CompiledQuestionsDataRef);
 }
Ejemplo n.º 12
0
 private static TblCompiledQuestionsData GetTestCaseData(TblCompiledAnswers c)
 {
     return(ServerModel.DB.Load <TblCompiledQuestionsData>(c.CompiledQuestionsDataRef));
 }