Changeset 1131329
- Timestamp:
- 04/09/2015 04:35:42 PM (11 years ago)
- Location:
- questions
- Files:
-
- 79 added
- 5 edited
-
tags/1.0.0 beta 6 (added)
-
tags/1.0.0 beta 6/README.txt (added)
-
tags/1.0.0 beta 6/assets (added)
-
tags/1.0.0 beta 6/assets/images (added)
-
tags/1.0.0 beta 6/assets/images/icon-dropdown.png (added)
-
tags/1.0.0 beta 6/assets/images/icon-multiplechoice.png (added)
-
tags/1.0.0 beta 6/assets/images/icon-onechoice.png (added)
-
tags/1.0.0 beta 6/assets/images/icon-separator.png (added)
-
tags/1.0.0 beta 6/assets/images/icon-split-form.png (added)
-
tags/1.0.0 beta 6/assets/images/icon-text.png (added)
-
tags/1.0.0 beta 6/assets/images/icon-textarea.png (added)
-
tags/1.0.0 beta 6/assets/images/icon-textfield.png (added)
-
tags/1.0.0 beta 6/assets/images/icon-updown.png (added)
-
tags/1.0.0 beta 6/assets/images/loading-blue.gif (added)
-
tags/1.0.0 beta 6/assets/images/loading.gif (added)
-
tags/1.0.0 beta 6/components (added)
-
tags/1.0.0 beta 6/components/admin (added)
-
tags/1.0.0 beta 6/components/admin/admin.php (added)
-
tags/1.0.0 beta 6/components/admin/includes (added)
-
tags/1.0.0 beta 6/components/admin/includes/js (added)
-
tags/1.0.0 beta 6/components/admin/includes/js/admin-questions-post-type.js (added)
-
tags/1.0.0 beta 6/components/admin/pages (added)
-
tags/1.0.0 beta 6/components/admin/pages/settings.php (added)
-
tags/1.0.0 beta 6/components/charts (added)
-
tags/1.0.0 beta 6/components/charts/chart-creator-c3.php (added)
-
tags/1.0.0 beta 6/components/charts/chart-creator-dimple.php (added)
-
tags/1.0.0 beta 6/components/charts/chart-creator.php (added)
-
tags/1.0.0 beta 6/components/charts/charts.php (added)
-
tags/1.0.0 beta 6/components/charts/data-abstraction.php (added)
-
tags/1.0.0 beta 6/components/charts/includes (added)
-
tags/1.0.0 beta 6/components/charts/includes/3rdparty (added)
-
tags/1.0.0 beta 6/components/charts/includes/3rdparty/d3 (added)
-
tags/1.0.0 beta 6/components/charts/includes/3rdparty/d3/LICENSE (added)
-
tags/1.0.0 beta 6/components/charts/includes/3rdparty/d3/d3.js (added)
-
tags/1.0.0 beta 6/components/charts/includes/3rdparty/d3/d3.min.js (added)
-
tags/1.0.0 beta 6/components/charts/includes/3rdparty/dimple (added)
-
tags/1.0.0 beta 6/components/charts/includes/3rdparty/dimple/dimple.v2.1.0.js (added)
-
tags/1.0.0 beta 6/components/charts/includes/3rdparty/dimple/dimple.v2.1.0.min.js (added)
-
tags/1.0.0 beta 6/components/charts/shortcodes.php (added)
-
tags/1.0.0 beta 6/components/component.php (added)
-
tags/1.0.0 beta 6/components/core (added)
-
tags/1.0.0 beta 6/components/core/core.php (added)
-
tags/1.0.0 beta 6/components/core/export.php (added)
-
tags/1.0.0 beta 6/components/core/process-response.php (added)
-
tags/1.0.0 beta 6/components/core/questions.php (added)
-
tags/1.0.0 beta 6/components/core/shortcodes.php (added)
-
tags/1.0.0 beta 6/components/core/tools (added)
-
tags/1.0.0 beta 6/components/core/tools/post.php (added)
-
tags/1.0.0 beta 6/components/core/tools/survey.php (added)
-
tags/1.0.0 beta 6/components/element.php (added)
-
tags/1.0.0 beta 6/components/elements (added)
-
tags/1.0.0 beta 6/components/elements/description.php (added)
-
tags/1.0.0 beta 6/components/elements/dropdown.php (added)
-
tags/1.0.0 beta 6/components/elements/elements.php (added)
-
tags/1.0.0 beta 6/components/elements/multiplechoice.php (added)
-
tags/1.0.0 beta 6/components/elements/onechoice.php (added)
-
tags/1.0.0 beta 6/components/elements/separator.php (added)
-
tags/1.0.0 beta 6/components/elements/splitter.php (added)
-
tags/1.0.0 beta 6/components/elements/text.php (added)
-
tags/1.0.0 beta 6/components/elements/textarea.php (added)
-
tags/1.0.0 beta 6/components/survey.php (added)
-
tags/1.0.0 beta 6/functions.php (added)
-
tags/1.0.0 beta 6/includes (added)
-
tags/1.0.0 beta 6/includes/css (added)
-
tags/1.0.0 beta 6/includes/css/admin.css (added)
-
tags/1.0.0 beta 6/includes/css/display.css (added)
-
tags/1.0.0 beta 6/includes/css/fonts (added)
-
tags/1.0.0 beta 6/includes/css/fonts.css (added)
-
tags/1.0.0 beta 6/includes/css/fonts/questions.eot (added)
-
tags/1.0.0 beta 6/includes/css/fonts/questions.svg (added)
-
tags/1.0.0 beta 6/includes/css/fonts/questions.ttf (added)
-
tags/1.0.0 beta 6/includes/css/fonts/questions.woff (added)
-
tags/1.0.0 beta 6/init.php (added)
-
tags/1.0.0 beta 6/languages (added)
-
tags/1.0.0 beta 6/languages/plugin.po (added)
-
tags/1.0.0 beta 6/languages/questions-locale-de_DE.mo (added)
-
tags/1.0.0 beta 6/languages/questions-locale-de_DE.po (added)
-
tags/1.0.0 beta 6/testing (added)
-
tags/1.0.0 beta 6/testing/main.php (added)
-
trunk/README.txt (modified) (1 diff)
-
trunk/components/admin/admin.php (modified) (1 diff)
-
trunk/components/charts/data-abstraction.php (modified) (2 diffs)
-
trunk/components/charts/shortcodes.php (modified) (1 diff)
-
trunk/init.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
questions/trunk/README.txt
r1131247 r1131329 66 66 == Changelog == 67 67 68 = 1.0.0 beta 6 = 69 * Fixed result charts bug 70 * Fixed some translation fails 71 68 72 = 1.0.0 beta 5 = 69 73 * Added Questions Shortcode for embedding surveys -
questions/trunk/components/admin/admin.php
r1131247 r1131329 453 453 454 454 $question_id = $survey_question['id']; 455 $question = $survey_question['question'];455 $question = ''; 456 456 $sort = $survey_question['sort']; 457 457 $type = $survey_question['type']; 458 459 if( array_key_exists( 'question', $survey_question ) ) 460 $question = $survey_question['question']; 458 461 459 462 $answers = array(); -
questions/trunk/components/charts/data-abstraction.php
r1128186 r1131329 47 47 global $wpdb, $questions_global; 48 48 49 $lines = self::lines( $response_array );50 51 49 $ordered_data = array(); 52 50 53 // Getting Labels 54 foreach( $lines[ 0 ] AS $key => $line ): 55 if( $key != '_user_id' ): 56 $ordered_data[ 'questions' ][ $key ] = $line; 57 endif; 58 endforeach; 59 60 unset ( $lines[0] ); // Throw away headlines 61 51 $ordered_data[ 'questions' ] = array(); 62 52 $ordered_data[ 'data' ] = array(); 63 53 64 54 // Getting every entery of one 65 foreach( $ ordered_data[ 'questions' ]AS $key => $line ):55 foreach( $response_array AS $key => $line ): 66 56 $merged_data = array(); 67 57 68 foreach( $lines AS $response_id => $line ): 69 if( !isset( $merged_data[ $line[ $key ] ] ) ) $merged_data[ $line[ $key ] ] = 0; 70 $merged_data[ $line[ $key ] ]++; 71 endforeach; 58 $sql = $wpdb->prepare( "SELECT type FROM {$questions_global->tables->questions} WHERE id = %s", $key ); 59 $result = $wpdb->get_row( $sql ); 60 61 $element_class = 'Questions_SurveyElement_' . $result->type; 62 63 if( !class_exists( $element_class ) ) 64 continue; 65 66 $element = new $element_class( $key ); 67 68 if( !$element->is_displayable ) 69 continue; 70 71 $ordered_data[ 'questions' ][ $key ] = $line[ 'question' ]; 72 72 73 73 // Fill up missed answers with 0 … … 77 77 $voted_answers = array_keys( $merged_data ); 78 78 foreach( $results AS $result ): 79 if( !in_array( $result->answer, $voted_answers ) ) 80 $merged_data[ $result->answer ] = 0; 79 $merged_data[ $result->answer ] = 0; 80 endforeach; 81 82 // Adding voted data 83 $responses = $response_array[ $key ][ 'responses' ]; 84 85 foreach( $responses AS $response ): 86 if( !$element->answer_is_multiple ): 87 $merged_data[ $response ] += 1; 88 else: 89 foreach( $response AS $answer_option => $answer ): 90 if( $answer == __( 'Yes', 'questions-locale' ) ) 91 $merged_data[ $answer_option ] += 1; 92 endforeach; 93 endif; 81 94 endforeach; 82 95 -
questions/trunk/components/charts/shortcodes.php
r1131247 r1131329 54 54 55 55 $survey = new Questions_Survey( $atts[ 'id' ] ); 56 $ordered_data = Questions_AbstractData::order_for_charting( $survey->get_responses( FALSE, FALSE ) ); 56 $response = $survey->get_responses( FALSE, FALSE ); 57 $ordered_data = Questions_AbstractData::order_for_charting( $response ); 57 58 58 59 $html = ''; -
questions/trunk/init.php
r1131247 r1131329 4 4 Plugin URI: http://www.awesome.ug 5 5 Description: Drag & drop your survey/poll with the WordPress Questions plugin. 6 Version: 1.0.0 beta 56 Version: 1.0.0 beta 6 7 7 Author: awesome.ug 8 8 Author URI: http://www.awesome.ug
Note: See TracChangeset
for help on using the changeset viewer.