QuizzesReportsGenerator::addQuizActivityFields( $strFields, $queryArgs )
Add quiz activity fields on sql statement
Description
Source
File: bp-integrations/learndash/buddypress/generators/QuizzesReportsGenerator.php
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | public function addQuizActivityFields( $strFields , $queryArgs ) { global $wpdb ; $metaTable = $wpdb ->prefix . "learndash_user_activity_meta" ; $table = $wpdb ->prefix . "learndash_user_activity" ; $strFields .= ", ( SELECT mt_points.activity_meta_value FROM { $metaTable } as mt_points WHERE mt_points.activity_id = ld_user_activity.activity_id AND mt_points.activity_meta_key = 'points' ) as activity_points "; $strFields .= ", ( SELECT mt_score.activity_meta_value FROM { $metaTable } as mt_score WHERE mt_score.activity_id = ld_user_activity.activity_id AND mt_score.activity_meta_key = 'percentage' ) as activity_score "; $strFields .= ", ( SELECT mt_time_spent.activity_meta_value FROM { $metaTable } as mt_time_spent WHERE mt_time_spent.activity_id = ld_user_activity.activity_id AND mt_time_spent.activity_meta_key = 'timespent' ) as activity_time_spent "; $strFields .= ", ( SELECT count (*) FROM { $table } as mt_attempts WHERE mt_attempts.post_id = posts.ID AND mt_attempts.user_id = users.ID ) as activity_attemps "; return $strFields ; } |
Changelog
Version | Description |
---|---|
BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.