我目前正在构建一个调查/问卷调查应用程序,管理员用户可以根据这些部分创建包含多个部分和问题的调查问卷。
响应:
<form action="@Url.Action("AnswerQuestions", "Responses", new { id = Model.QuestionnaireID })" method="post">
<div class="well well-small">
<h4>Questions - @ViewBag.ResponseID</h4>
</div>
<ul class="unstyled bordered skip-first">
@foreach (var question in Model.SectionVM.Questions)
{
<li class="row">
<div class="span9">
<input type="hidden" name="Answers.Index" value="@question.QuestionID" />
<input type="hidden" name="Answers[@question.QuestionID].QuestionID" value="@question.QuestionID" />
@Html.Raw(question.Question1)
</div>
<div class="span3">
@if (question.QuestionType == "Text")
{
<input class="span3" type="text" name="Answers[@question.QuestionID].TextAnswer" />
}
@if (question.QuestionType == "Rating")
{
<input type="radio" name="Answers[@question.QuestionID].RatingAnswer" value="1"/><p>Don’t Know</p>
<input type="radio" name="Answers[@question.QuestionID].RatingAnswer" value="2" /><p>Not us</p>
<input type="radio" name="Answers[@question.QuestionID].RatingAnswer" value="3" /><p>Somewhat true of us</p>
<input type="radio" name="Answers[@question.QuestionID].RatingAnswer" value="4" /><p>Mostly true of us</p>
<input type="radio" name="Answers[@question.QuestionID].RatingAnswer" value="5" /><p>That’s us</p>
}
</div>
</li>
}
</ul>
目前我正在使用上面的代码从每个问题中收集答案并存储它,但每次都会创建一个新的响应。有人可以帮助我,以便我可以使用现有的#34;响应&#34;并仍然将答案推送到数据库。
查看代码:
PYSPARK_DRIVER_PYTHON