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 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); }
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); }
public static TblCompiledQuestionsData GetCompiledQuestionDataForCompiledAnswer(TblCompiledAnswers ca) { return(ServerModel.DB.Load <TblCompiledQuestionsData>(ca.CompiledQuestionsDataRef)); }
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 static TblCompiledQuestionsData GetTestCaseData(TblCompiledAnswers c) { return ServerModel.DB.Load<TblCompiledQuestionsData>(c.CompiledQuestionsDataRef); }
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 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); }
public static TblCompiledQuestionsData GetCompiledQuestionDataForCompiledAnswer(TblCompiledAnswers ca) { return ServerModel.DB.Load<TblCompiledQuestionsData>(ca.CompiledQuestionsDataRef); }
private static TblCompiledQuestionsData GetTestCaseData(TblCompiledAnswers c) { return(ServerModel.DB.Load <TblCompiledQuestionsData>(c.CompiledQuestionsDataRef)); }