私はオンラインテスト/試験用の小さなasp.netmvcベースアプリケーションを開発しています。ユーザーが負荷テストを要求すると、コントローラーのインデックスアクションで質問オブジェクトのリストが表示されるようなシナリオがあります。ただし、このユーザーは、質問を1つずつ表示するのではなく、一度にすべての質問を表示できないようにする必要があります。私は各質問の推定時間を維持しましたが、ユーザーが制限時間を確認できるように、すべての質問の時間の合計を右上隅に表示しています。1秒ごとに減るタイマーです。私はすべての質問に対して一般的に実行タイマーを維持する方法について混乱しています。そして、どうすればすべての質問ではなく、1つずつ質問をレンダリングできますか。asp.net mvcにはポストバックがないため、このシナリオの実装は非常に困難です。ガイドしてください
編集済み: *これを行うことはできますか?*
[HttpGet]
public ActionResult Index(int? testId)
{
int id = Convert.ToInt32(testId);
List<Question> questionList;// = new List<Question>();
questionList = questionManager.GetquestionsByTestId(id);
if (questionList != null)
{
foreach (Question q in questionList)
{
return RedirectToAction("LoadNextQuestion", "LoadTest", q);
}
return View();
}
else
{
return View();
}
}
public ActionResult LoadNextQuestion(Question objQuestion)
{
Question question = questionManager.GetQuestionById(objQuestion.QuestionId);
ViewData["Question"] = question;
return View();
}