Suggestion: separate question and answers in CSV votes export
-
When exporting poll votes to CSV (Poll Results – View votes – Export), the question and all answers per voter are all exported in the same cell (same column named Vote data) of the CSV output file. It makes the export table a bit mess. I suggest to divide the vote data into separate cells – separate columns: a column for the question, another column for answer1, another column for answer2 (if exists), etc. For example:
Vote data 0 (Question), Vote data 1 (Answer1), Vote data 2 (Answer2), etc.
I have tried myself and managed to separate the question from the answers (but so far all answers in the same column):
…/plugins/yop-poll/admin/models/votes.php :line 1390:
__( ‘Vote data 0’, ‘yop-poll’ ),
__( ‘Vote data 1’, ‘yop-poll’ ) //line addedline 1398:
$details_string = ”;
$details_string2 = ”; //line addedline 1405:
$details_string .= __( ‘Question’, ‘yop-poll’ ). ‘: ‘ . addslashes( $res[‘question’] ) ; //line modified
foreach ( $res[‘answers’] as $ra ) {
$details_string2 .= __( ‘Answer’, ‘yop-poll’ ) . ‘: ‘ . addslashes( $ra[‘answer_value’] ) . ‘;’; //line modifiedline 1418:
stripslashes( $details_string ),
stripslashes( $details_string2 ) //line addedIf you agree you might also separate the answers (if multiple) and make it into your core.
- The topic ‘Suggestion: separate question and answers in CSV votes export’ is closed to new replies.