don’t connect forum or assignment to other course/unit

Home Forums Legacy Support Support queries How-to & Troubleshooting don’t connect forum or assignment to other course/unit

Viewing 15 posts - 1 through 15 (of 28 total)
  • Author
    Posts
  • #362232
    silverchair
    Spectator
    Hi 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/169xulu
    #362249
    silverchair
    Spectator
    This reply has been marked as private.
    #362286
    Ada
    Participant
    Hi, 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; } `
    #362288
    silverchair
    Spectator
    1. 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 ASAP
    #362294
    silverchair
    Spectator
    3. It works perfectly! thanks
    #362383
    Veronica
    Moderator
    hi please check this video for better understanding about assignments in wplms v4 https://www.youtube.com/watch?v=tOS3xe6h0ls
    #362391
    silverchair
    Spectator
    2. Alright, I got it for assignment flow, thx @Veronica . Now I'll be waiting for question no.1
    #362608
    Ada
    Participant
    Hi, 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);
    
    #362637
    silverchair
    Spectator
    After 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... Thx
    #362650
    silverchair
    Spectator
    I'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 solution
    #362696
    silverchair
    Spectator
    For now, I remove your code at wplms-customizer.php since it caused an issue
    #362735
    Ada
    Participant
    Okay, 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.
    #362739
    silverchair
    Spectator
    If I disable bbpress, can I still use vibe helpdesk or vibe kb (knowledge base) ?
    #362757
    silverchair
    Spectator
    Sorry, 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/16ps8ak
    #362794
    Ada
    Participant
    Hi, Okay this code will work for both unit forum and connect assignments.
    
    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);
    
    
    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.
Viewing 15 posts - 1 through 15 (of 28 total)
  • The topic ‘don’t connect forum or assignment to other course/unit’ is closed to new replies.