Home › Forums › Legacy Support › Support queries › Update Issues › How to get the question tags from a question?
- This topic has 8 replies, 3 voices, and was last updated 3 years, 9 months ago by arteebee.
Viewing 9 posts - 1 through 9 (of 9 total)
-
AuthorPosts
-
February 7, 2021 at 5:53 pm #338637arteebeeParticipant1) https://prntscr.com/ynzast My question is how can we get the question tag from the question itself? 2) https://prntscr.com/yaubud This screenshot is from the quiz result page, and I want to ask how did you get the correct percentage for each question tag that appears during the quiz? My final goal is to set up comments based on the correct percentage of question tags. Same as the second screenshot I provided, if the student gets all the "Animal" questions correct, then the percentage is 100% and I will give a comment as "Animal 100% correct!!". Can you please help me with this? Thank you.February 7, 2021 at 8:28 pm #338644arteebeeParticipantThis reply has been marked as private.February 8, 2021 at 2:17 am #338655arteebeeParticipantThis reply has been marked as private.February 8, 2021 at 2:57 pm #338797Anshuman SahuKeymasterThis reply has been marked as private.February 8, 2021 at 7:06 pm #338829arteebeeParticipantHi Alex, I tried to get the question tag value in/after the quiz evaluation. More specifically, I used a hook function as ' add_action('wplms_after_quiz_message', 'my_custom_function'); ', and I expect to display the correct percentage of each question tag as a text variable. I circled a place where I want to put my result of the question tag's correct percentage: https://prntscr.com/yqtu9k I really appreciate your reply. Best Wish.February 8, 2021 at 7:46 pm #338846MrVibeKeymasterEnable WP admin - LMS - Settings - Advance quiz stats. --- Not exactly sure what you want to achieve. 1. Question tag is a taxonomy for the question. 2. Each question tag term maintains the correct and incorrect data in Term meta. ---February 8, 2021 at 8:11 pm #338847arteebeeParticipantHello, I already enabled the Advance quiz stats, that's why I want to know more about it. My customer wants me to create different comments based on the correct percentage of a question tag. To be more specific, I will use this screenshot as an example: https://prntscr.com/yaubud. In this screenshot, it includes these question tags and their correct percentage: ( Number: 0%, Animals: 100%, Capitals: 100%, Geography: 100%, Roman: 0% ). So what my customer wants me to do is: if(Number's correct percentage > 50%){ echo 'Number's correct percentage is greater than 50%'; }else{ echo 'Number's correct percentage is less than 50%'; } This is basically what I want. If you can provide me with a possible solution would be great. Thank you.February 9, 2021 at 2:11 pm #339017Anshuman SahuKeymasterhere is the function which can return tags data : you just need to pass quiz id and user id :
function get_tags_data($quiz_id,$user_id){ $tags_data = get_user_meta($user_id,'tags_data'.$quiz_id,true); return $tags_data; }
February 9, 2021 at 3:15 pm #339040arteebeeParticipantThank you so much, this is the exact function I need. You can close this topic now. -
AuthorPosts
Viewing 9 posts - 1 through 9 (of 9 total)
- The topic ‘How to get the question tags from a question?’ is closed to new replies.