C# Class DBPOLLDemo.Controllers.QuestionController

Inheritance: Controller
ファイルを表示 Open project: Marknel/dbPOLL

Public Methods

Method Description
Create ( int pollid, String name ) : System.Web.Mvc.ActionResult

Returns the view with a choice between creating a short answer and multiple choice question.

CreateMultipleChoice ( int pollid ) : System.Web.Mvc.ActionResult
CreateShortAnswer ( int pollid ) : System.Web.Mvc.ActionResult

Returns view to create short answer questions. NOTE: Creation is not done here. Creation is performed in the [AcceptVerbs(HttpVerbs.Post)] which is the POST version of this method.

Delete ( int questionid, int id, String name ) : System.Web.Mvc.ActionResult

Calls the model method to delete Questions based on the Question ID and refreshes the view to display the updated list of questions. Currently all logged in user can delete question associated with their account. Need to enforce some type of Authorization based on user type.

Details ( int id, String name ) : System.Web.Mvc.ActionResult

Returns the answers associated with the chosen question.

Edit ( int questionid ) : System.Web.Mvc.ActionResult

Redirects to Edit view to allow modification of Question details.

Index ( int id, String name ) : System.Web.Mvc.ActionResult

Returns a view listing all the questions associated with a poll.

Keypad ( int qid ) : System.Web.Mvc.ActionResult
Result ( int aid ) : System.Web.Mvc.ActionResult
Test ( int questionid, String name, int num_response ) : System.Web.Mvc.ActionResult
viewQuestions ( int pollid ) : System.Web.Mvc.ActionResult

Private Methods

Method Description
CreateMultipleChoice ( String num, int questiontype, String question, int chartstyle, int pollid ) : System.Web.Mvc.ActionResult
CreateShortAnswer ( int shortanswertype, String num, String question, int chartstyle, int pollid ) : System.Web.Mvc.ActionResult
Edit ( int questionid, int questiontype, String question, int chartstyle, int num, System.DateTime createdat, int pollid ) : System.Web.Mvc.ActionResult
viewQuestions ( int pollid, String date1, String date2 ) : System.Web.Mvc.ActionResult

Method Details

Create() public method

Returns the view with a choice between creating a short answer and multiple choice question.
public Create ( int pollid, String name ) : System.Web.Mvc.ActionResult
pollid int Poll to create question for
name String
return System.Web.Mvc.ActionResult

CreateMultipleChoice() public method

public CreateMultipleChoice ( int pollid ) : System.Web.Mvc.ActionResult
pollid int
return System.Web.Mvc.ActionResult

CreateShortAnswer() public method

Returns view to create short answer questions. NOTE: Creation is not done here. Creation is performed in the [AcceptVerbs(HttpVerbs.Post)] which is the POST version of this method.
public CreateShortAnswer ( int pollid ) : System.Web.Mvc.ActionResult
pollid int
return System.Web.Mvc.ActionResult

Delete() public method

Calls the model method to delete Questions based on the Question ID and refreshes the view to display the updated list of questions. Currently all logged in user can delete question associated with their account. Need to enforce some type of Authorization based on user type.
public Delete ( int questionid, int id, String name ) : System.Web.Mvc.ActionResult
questionid int
id int Question ID to be deleted
name String
return System.Web.Mvc.ActionResult

Details() public method

Returns the answers associated with the chosen question.
public Details ( int id, String name ) : System.Web.Mvc.ActionResult
id int Selected Question ID
name String
return System.Web.Mvc.ActionResult

Edit() public method

Redirects to Edit view to allow modification of Question details.
public Edit ( int questionid ) : System.Web.Mvc.ActionResult
questionid int Question designated to be edited
return System.Web.Mvc.ActionResult

Index() public method

Returns a view listing all the questions associated with a poll.
public Index ( int id, String name ) : System.Web.Mvc.ActionResult
id int
name String
return System.Web.Mvc.ActionResult

Keypad() public method

public Keypad ( int qid ) : System.Web.Mvc.ActionResult
qid int
return System.Web.Mvc.ActionResult

Result() public method

public Result ( int aid ) : System.Web.Mvc.ActionResult
aid int
return System.Web.Mvc.ActionResult

Test() public method

public Test ( int questionid, String name, int num_response ) : System.Web.Mvc.ActionResult
questionid int
name String
num_response int
return System.Web.Mvc.ActionResult

viewQuestions() public method

public viewQuestions ( int pollid ) : System.Web.Mvc.ActionResult
pollid int
return System.Web.Mvc.ActionResult