Home › Forums › Legacy Support › Support queries › Setup issues › Unable to add a new extension in assignment submission
Tagged: assignment, extension
- This topic has 11 replies, 3 voices, and was last updated 6 years, 7 months ago by daammon.
Viewing 12 posts - 1 through 12 (of 12 total)
-
AuthorPosts
-
January 30, 2017 at 7:34 am #92578edxacademyParticipantHi, 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.January 30, 2017 at 11:52 am #92631Anshuman SahuKeymasterOkay 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.February 2, 2017 at 10:27 am #93319edxacademyParticipantAlex, My extension is a rare extension (.kodu2).February 3, 2017 at 7:02 am #93474Anshuman SahuKeymasterWell 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.)February 3, 2017 at 7:51 am #93483edxacademyParticipantThis reply has been marked as private.February 3, 2017 at 9:35 am #93513edxacademyParticipantAlex, 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.February 4, 2017 at 10:57 am #93702Anshuman SahuKeymasterWell 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 .September 28, 2017 at 10:33 am #130335daammonSpectatorHi 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;
}
September 28, 2017 at 10:36 am #130336daammonSpectatorUps, 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; }September 28, 2017 at 12:52 pm #130362Anshuman SahuKeymasterPlease 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;
}
September 28, 2017 at 3:33 pm #130399daammonSpectatorHi, 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; } }September 28, 2017 at 4:17 pm #130408daammonSpectatorIt works! Thank you!! -
AuthorPosts
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.