ajax - need guidance for this asp.net mvc scenario -


i developing small asp.net mvc base application online test/exam. have scenario like, when user ask load test, getting list of question objects list in index action of controller. requirement user should not able see questions @ time, rather 1 one question should appear. have kept estimated time each question, showing sum of time of question @ right top corner user can see time limit. timer reduces each second. confuse how keep run timer commonly questions. , how can render 1 one question rather ones. since there no postback in asp.net mvc ,the implementation scenario quite difficult. please guide

edited: *can ?*

[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();         } 

  1. you don't need list this

  2. create user control or page , put master page, showing each question @ time.(assume user click next questions). next question post form, have user answered , time.

  3. you can use json/ajax call fetching next questions.

  4. use java script track time(write function ondocumentready or else triggered after question populated)

  5. dont forget post elapsed time answer of user so, don't have worry time spending on question.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -