Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › don’t connect forum or assignment to other course/unit
- This topic has 27 replies, 3 voices, and was last updated 2 years, 10 months ago by Ada.
-
AuthorPosts
-
June 22, 2021 at 4:44 am #362232silverchairSpectatorHi team. I want to force instructor to create one forum for each course and assignment for each course, so I need to hide/disable these option at unit creation: 1. Unit/Forum selection when create a unit, cause I want the forum only connected to its course 2. Connect assignment when create a unit, cause I want to force instructor to create assignment for each course, so I don't need this assignment to connect to other course/unit 3. I want to hide/disable "Practice Question" at unit creation, because I want this question created only on "Quiz" Refer: https://prnt.sc/169xuluJune 22, 2021 at 5:44 am #362249silverchairSpectatorThis reply has been marked as private.June 22, 2021 at 7:49 am #362286AdaParticipantHi, 1- okay, will check if it's possible to disable unit forum then I'll share the code here. 2- If you want one assignment should be connected to one course only then you should connect the course to the assignment by including course name in assignment. 3- ` #course_component .field_curriculum .curriculum_element_wrapper .field_practice_questions { display:none !important; } `June 22, 2021 at 7:57 am #362288silverchairSpectator1. Thanks 2. When we create assignment in front-end course creation, is it not automatically connected to the course? Because its one of the step to for creating course. It's weird when we create assignment in the process of course creation, but the assignment not connected to the course. 3. Will try ASAPJune 22, 2021 at 8:08 am #362294silverchairSpectator3. It works perfectly! thanksJune 22, 2021 at 1:15 pm #362383VeronicaModeratorhi please check this video for better understanding about assignments in wplms v4 https://www.youtube.com/watch?v=tOS3xe6h0lsJune 22, 2021 at 1:44 pm #362391silverchairSpectator2. Alright, I got it for assignment flow, thx @Veronica . Now I'll be waiting for question no.1June 24, 2021 at 6:37 am #362608AdaParticipantHi, Yes for 1 please add this code in your wplms-customizer.php file. Goto plugin editor>>select wplms customizer then add this code at the end in wplms-customizer.php
add_filter('wplms_course_creation_tabs',function($tabs){ $curriculum_elements = $tabs['course_curriculum']['fields'][0]['curriculum_elements']; foreach ($curriculum_elements as $key => $curriculum_element) { if($curriculum_element['type'] == 'unit'){ foreach ($curriculum_element['types'] as $key1 => $unit_type) { foreach ($unit_type['fields'] as $key2=> $unit_content){ if($unit_content['id']=='vibe_forum'){ unset($curriculum_element['types'][$key1]['fields'][$key2]); } } } $curriculum_elements[$key] = $curriculum_element; } } $tabs['course_curriculum']['fields'][0]['curriculum_elements'] = $curriculum_elements; return $tabs; },10,1);
June 24, 2021 at 10:23 am #362637silverchairSpectatorAfter I put that code into wplms-customizer.php . Now Course Level selection are gone in front-end course creation. Yes I have enabled it in WPLMS > Course Manager. Refer: https://prnt.sc/16l82p3 and when I want to create new unit, now its blank, refer: https://prnt.sc/16l7wzs I dont know if I missing something, but it happen after put that code. Maybe you can check my site by the credential which I provide before... ThxJune 24, 2021 at 10:56 am #362650silverchairSpectatorI'll try to make it simple. How if I want to disable all forum creation based on course/unit. So when creating course, just remove "COMPONENT" section, so the forum will be enabled only on helpdesk (which all forum created by admin). So there's no forum field at all on Course or Unit, and all the forum field will be gone. Is it possible? If it's possible, I better using this solutionJune 24, 2021 at 2:15 pm #362696silverchairSpectatorFor now, I remove your code at wplms-customizer.php since it caused an issueJune 25, 2021 at 5:35 am #362735AdaParticipantOkay, the code is working on local. I'll check the code on your site . there may be slight error in the code. But if you want to completely remove forum component then just disable bbpress plugin from your site.June 25, 2021 at 7:18 am #362739silverchairSpectatorIf I disable bbpress, can I still use vibe helpdesk or vibe kb (knowledge base) ?June 25, 2021 at 10:07 am #362757silverchairSpectatorSorry, back to No.2 about assigment, I kno how assignment flow, but I still want to hide this Connect Assignment on Unit Creation . Because I want one assignment for one course only, so the instructor can only connect it to course when they create assignment. Refer: https://prnt.sc/16ps8akJune 25, 2021 at 12:00 pm #362794AdaParticipantHi, Okay this code will work for both unit forum and connect assignments.
Please try adding it again if it does not work and page goes blank as you said in previous reply. then I'll check on your site.add_filter('wplms_course_creation_tabs',function($tabs){ $curriculum_elements = $tabs['course_curriculum']['fields'][0]['curriculum_elements']; foreach ($curriculum_elements as $key => $curriculum_element) { if($curriculum_element['type'] == 'unit'){ foreach ($curriculum_element['types'] as $key1 => $unit_type) { foreach ($unit_type['fields'] as $key2=> $unit_content){ //print_r($unit_content); if($unit_content['id']=='vibe_forum' || $unit_content['id']=='vibe_assignment'){ unset($curriculum_element['types'][$key1]['fields'][$key2]); } } } $curriculum_elements[$key] = $curriculum_element; } } $tabs['course_curriculum']['fields'][0]['curriculum_elements'] = $curriculum_elements; return $tabs; },10,1);
-
AuthorPosts
- The topic ‘don’t connect forum or assignment to other course/unit’ is closed to new replies.