Hide "check quiz results" button – 2

Home Forums Legacy Support Support queries How-to & Troubleshooting Hide "check quiz results" button – 2

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #100811
    rarego
    Spectator
    Hello again, Sorry for duplicating posts (https://wplms.io/support/forums/topic/hide-check-quiz-results-button/), but I couldn't answer on the first one because it was closed. Thanks for confirming that my solution was valid. Anyway, a CSS approach is much easier and cleaner. I would rather that one. 1) Could you please share how to solve the issue with CSS ? 2) How to disable the link on student's profile > course > results to the quiz so they can not access the test results but only see the grades obtained ?? (that is the whole point of it)   Thanks very much
    #100822
    H.K. Latiyan
    Participant
    1) The css to hide the check results button is: #title a.button.create-group-button.full:not(.begin_quiz):not(.submit_quiz) {display:none;} 2) To hide the results from the profile page use the bellow css: .bp-user #item-body .item-list-tabs#subnav ul li a#course-results {display:none;}
    #100836
    rarego
    Spectator
    Thank you, that was awesome. Nevertheless, for number 2 I didn't mean to make the "results" tab disappear, but to disable the link inside it with the name of the quiz (that way they can see the resulting grade but not the questions/answers). I tried this approach with CSS: a[href="?action=5425"] {pointer-events: none;} but I would need a more global solution for all courses, not only for "5425" Is it possible? Thanks again.
    #100921
    H.K. Latiyan
    Participant
    This cannot be done via css but it can be done via simple code. Try adding the bellow code in your wplms-customizer.php file present in your wplms customizer plugin OR the functions.php file of your child theme (if using a child theme): add_action('bp_after_course_results',function(){   ?>   <script>   jQuery(document).ready(function($){     var check_results = $('body').find('.quiz_results');     if(typeof check_results != 'undefined'){       $('.quiz_results>li>a').attr('href','#');     }   });   </script>   <?php });
    #100949
    rarego
    Spectator
    Hi, That was AWESOME again and worked perfectly. I'll let you know if I find incompatibilities of any kind. Thank you!
    #101020
    H.K. Latiyan
    Participant
    Thanks for confirming, so closing the topic.
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Hide "check quiz results" button – 2’ is closed to new replies.