Unable to add a new extension in assignment submission

Home Forums Legacy Support Support queries Setup issues Unable to add a new extension in assignment submission

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #92578
    edxacademy
    Participant
    Hi, I have followed instruction by adding another filter in my functions.php https://vibethemes.com/documentation/wplms/forums/topic/assignment-valid-attachment-types/   // Extension kodu2 add_filter('wplms_wplms-assignment_metabox','add_psd_metabox'); function add_psd_metabox($settings){ $settings[7]['options'][]=array ( 'value'=> 'xyz', 'label'=> 'xyz' ); return $settings; } However, when I submit the xyz file, it says <strong style="color: #444444; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 14px;">ERROR:<span style="color: #444444; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 14px;"> File you upload must be valid file type </span><strong style="color: #444444; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 14px;">(xyz)<span style="color: #444444; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 14px;">, and under 10MB(s)!</span> I was wondering if there is anything else I need to do after adding that function.  
    #92631
    Anshuman Sahu
    Keymaster
    Okay can you please share which extension you are trying to add in assignment settings ? Please share extension details . Please note here that the PSD extension has been already added in assignments settings long time ago.
    #93319
    edxacademy
    Participant
    Alex, My extension is a rare extension (.kodu2).
    #93474
    Anshuman Sahu
    Keymaster
    Well can you please specify the mime type of such file and also share an example file (upload it somewhere online and share its link here in private reply.)
    #93483
    edxacademy
    Participant
    This reply has been marked as private.
    #93513
    edxacademy
    Participant
    Alex, I can't find the mime type. However, why is it relevant here? You should be able to upload pretty much any file in any webform, unless it is blocked by browser or anti-virus.  
    #93702
    Anshuman Sahu
    Keymaster
    Well this is wordpress and it does not allow any file to be uploaded just like .That is why I asked you for mime type . I guess wordpress is not allowing to upload such file type .You have to zip your file and then upload it .Zip file format is allowed by wordpress .
    #130335
    daammon
    Spectator
    Hi Alex, I have the same problem. In an specific course I need my students to send me the assigments in *.RTF but that extension is not in the allowed list. Should I add this code to my customizer file changing psd by rtf? Thanks!

    add_filter('wplms_wplms-assignment_metabox','add_psd_metabox');

    function add_psd_metabox($settings){

    $settings[7]['options'][]=array ( 'value'=> 'PSD', 'label'=> 'PSD' );

    return $settings;

    }

    #130336
    daammon
    Spectator
    Ups, I am copying the code again below. It is the same code you wrote here; https://vibethemes.com/documentation/wplms/forums/topic/assignment-valid-attachment-types/ add_filter('wplms_wplms-assignment_metabox','add_psd_metabox'); function add_psd_metabox($settings){ $settings[7]['options'][]=array ( 'value'=> 'PSD', 'label'=> 'PSD' ); return $settings; }
    #130362
    Anshuman Sahu
    Keymaster
    Please try using this code :

    add_filter('wplms_wplms-assignment_metabox','add_psd_metabox');

    function add_psd_metabox($settings){

    $settings[7]['options'][]=array ( 'value'=> 'rtf', 'label'=> 'rtf' );

    return $settings;

    }

    #130399
    daammon
    Spectator
    Hi, I added that code and nothing happened. Find below the complete code of my wplms-customizer.php file. Thanks   if(class_exists('WPLMS_Customizer_Plugin_Class')) { // instantiate the plugin class $wplms_customizer = new WPLMS_Customizer_Plugin_Class(); add_action( 'pre_get_comments', 'wplms_remove_comments_admin_panel' ); function wplms_remove_comments_admin_panel( $query ){ if(is_admin()){ $page=get_current_screen(); if( $page->base =='edit-comments') $query->query_vars['post_type'] = array('post','unit','course','wplms-assignment','product'); } return $query; } //RTF part add_filter('wplms_wplms-assignment_metabox','add_psd_metabox'); function add_psd_metabox($settings){ $settings[7]['options'][]=array ( 'value'=> 'rtf', 'label'=> 'rtf' ); return $settings; }   }
    #130408
    daammon
    Spectator
    It works! Thank you!!
Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Unable to add a new extension in assignment submission’ is closed to new replies.