mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 20:19:21 +00:00
Display survey responses
This commit is contained in:
parent
4a24d5249c
commit
0e3aee13bd
@ -145,8 +145,28 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- All survey responses -->
|
||||||
<div id="survey-responses" class="category container">
|
<div id="survey-responses" class="category container">
|
||||||
Loading survey responses
|
|
||||||
|
<h1>All your responses to surveys</h1>
|
||||||
|
|
||||||
|
<table id="all-survey-responses">
|
||||||
|
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Response number</th>
|
||||||
|
<th>Survey Number</th>
|
||||||
|
<th>Choice number</th>
|
||||||
|
<th>Date</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<!-- Survey responses will go here -->
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="movies" class="category container">
|
<div id="movies" class="category container">
|
||||||
@ -172,6 +192,7 @@
|
|||||||
<script src="assets/js/categories/posts.js"></script>
|
<script src="assets/js/categories/posts.js"></script>
|
||||||
<script src="assets/js/categories/comments.js"></script>
|
<script src="assets/js/categories/comments.js"></script>
|
||||||
<script src="assets/js/categories/likes.js"></script>
|
<script src="assets/js/categories/likes.js"></script>
|
||||||
|
<script src="assets/js/categories/survey.js"></script>
|
||||||
<script src="assets/js/main.js"></script>
|
<script src="assets/js/main.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -0,0 +1,28 @@
|
|||||||
|
/**
|
||||||
|
* Surveys category
|
||||||
|
*
|
||||||
|
* @author Pierre HUBERT
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Apply all survey responses
|
||||||
|
*/
|
||||||
|
function ApplySurveyResponses(){
|
||||||
|
|
||||||
|
let target = document.querySelector("#all-survey-responses tbody");
|
||||||
|
|
||||||
|
data.survey_responses.forEach(response => {
|
||||||
|
|
||||||
|
createElem2({
|
||||||
|
appendTo: target,
|
||||||
|
type: "tr",
|
||||||
|
innerHTML:
|
||||||
|
"<td>"+response.id+"</td>" +
|
||||||
|
"<td>"+response.surveyID+"</td>" +
|
||||||
|
"<td>"+response.choiceID+"</td>" +
|
||||||
|
"<td>"+timeToStr(response.time_sent)+"</td>"
|
||||||
|
})
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
@ -78,6 +78,7 @@ xhr.onload = function(){
|
|||||||
ApplyPosts();
|
ApplyPosts();
|
||||||
ApplyCommentsList();
|
ApplyCommentsList();
|
||||||
ApplyUserLikes();
|
ApplyUserLikes();
|
||||||
|
ApplySurveyResponses();
|
||||||
}
|
}
|
||||||
|
|
||||||
xhr.send(null);
|
xhr.send(null);
|
Loading…
Reference in New Issue
Block a user