Jump to content
pconkie

Yearbook admin

Recommended Posts

@Graham Quince

Hey Graham,

Could you find out what line to add to this to so that the file uploader only uploads image files?

Also, if is it possible to limit the number of files to say one?

Thanks

 

 '[data-action=upload] click': function(el, ev) {
   ev.preventDefault();
   $('.os_core:first').trigger('os.app.upload', {
     "data": {
       "upload_type": "asset",
       "file_ext": "jpg",
       "site_uuid": "54AE54F3200254FB47F31FCC1EA58705E082717C10860FE0",
       "callback": function(result) {

       }
     }
   });
 },

 

Link to comment
Share on other sites

Hi @pconkie

I've asked the developers - hopefully someone will be able to advise.  In the meantime, have you considered using a Form - you've got the review capability via the data viewer.  I've built several workflows, which use the hidden field option for submission review.  

Graham

Link to comment
Share on other sites

Thanks Graham.  I'd thought about that (and using a file drop in an assignment as well) but I'm worried about a few things with the form approach.

1. Students can upload files if a file uploader is placed on the form, but I can't find a way that they can delete a previous upload.  If they upload more than one photo, how will I know which photo to use?

2. I could easily download all of the files as this is built into the data viewer (and they come in a nice zip folder), but how difficult is it going to be to work out which photo has come form which student?  My little test suggests that this is going to be really difficult.

3. It also isn't going to be that easy to work out who hasn't submitted an entry as the form is based on submissions rather than the members of a group.

 

Link to comment
Share on other sites

@pconkie - hmm, so good points, I'd not considered.  I'll bring these up with the product team.

 

In the meantime, Adam O has replied to me:

$('.os_core:first').trigger('os.app.upload', {
     "data": {
       "upload_type": "asset",
       "filter": ["image"],
       "site_uuid": "54AE54F3200254FB47F31FCC1EA58705E082717C10860FE0",
       "callback": function(result) {

       }
     }
   });
Quote
You can pass filter array in the API filter: ['image']
other options to pass to filter if you want are: video, audio, generic, pdf, tgz, csv and filename

EDIT

Doesn't sound like there's an option to limit the number of files though

 

EDIT 2

The filename filter intrigued me, so I asked about how to use it:

Quote
hey, good question, it looks like you need to provide a full resource object as extra param so:
filter: ['filename'],
uploadResource: resource_object
it then uses that resources object r.getName()+'.'+r.getExtension()

 

Edited by Graham Quince
Added more info
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, pconkie said:

3. It also isn't going to be that easy to work out who hasn't submitted an entry as the form is based on submissions rather than the members of a group.

 

The Who has Completed my Form widget could help with this - but I think you approach for files is probably the deciding factor.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...