Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Hide "check quiz results" button – 2
Tagged: button, hide quiz results
- This topic has 5 replies, 2 voices, and was last updated 7 years, 9 months ago by H.K. Latiyan.
Viewing 6 posts - 1 through 6 (of 6 total)
-
AuthorPosts
-
March 14, 2017 at 11:12 am #100811raregoSpectatorHello 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 muchMarch 14, 2017 at 11:34 am #100822H.K. LatiyanParticipant1) 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;}
March 14, 2017 at 11:50 am #100836raregoSpectatorThank 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.March 14, 2017 at 2:12 pm #100921H.K. LatiyanParticipantThis 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 });March 14, 2017 at 2:49 pm #100949raregoSpectatorHi, That was AWESOME again and worked perfectly. I'll let you know if I find incompatibilities of any kind. Thank you!March 15, 2017 at 5:03 am #101020H.K. LatiyanParticipantThanks for confirming, so closing the topic. -
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
- The topic ‘Hide "check quiz results" button – 2’ is closed to new replies.