We are allowing our Trust Level 3 customers to mark Solved, but we have no good way to see how many they are doing. For example, see if a small number of this group are actually doing this work.
I did see
… and I do want that as well.
Could I use data Explorer? I am looking for total accepted Solution over a time period by a user.
From date to date
Name | Total
Mike | 8
Jim | 5
Tim | 3
Tom | 2
Jessica | 1
Beth | 0
Staff would be on the list and the OP would as well (nice to have would be listed as OP)
I was interested to see these stats for my instance as well, so had a go at making some queries for data explorer:
To list each individual “solved” event:
SELECT acting_user_id, target_topic_id, target_post_id, created_at FROM user_actions
WHERE action_type=15
ORDER BY created_at DESC
To produce a list with stats per-user: (with variable for time interval, defaults to 1 year):
-- [params]
-- string :interval = 1 year
SELECT ua.acting_user_id,
count(case t.user_id when ua.acting_user_id then 1 else null end) as is_op,
count(case t.user_id when ua.acting_user_id then null else 1 end) as not_op,
count(*) as total
FROM user_actions ua
LEFT JOIN topics t ON target_topic_id = t.id
WHERE action_type=15
AND ua.created_at >= CURRENT_DATE - INTERVAL :interval
GROUP BY ua.acting_user_id
ORDER BY total DESC
Edit: actually, this data is somewhat wrong… I’ll attempt to fix it
Edit 2: Since this logging was only added to the plugin 6 months ago, any data before that will have the “acting_user” set to the OP of the topic, regardless of who actually clicked the button. I think anything less than 6 months old should be correct.
Any way to make this show the user that marked it solved? It shows the user that solved it and their post, very useful. It would be nice to see who did the marking in this also.
So looking at this, if I read this correctly, “is_op” means their post has been marked as a solution to a topic? I am building a Monthly Leaderboard query and want to add those who’ve had posts marked as solutions to topics.