Views of file uploads by student

picode
Forums
Hello, Is it possible to add a view that will list all files (and their download links) uploaded by a student whenever she took a fileupload question? Say I have a course with 10 lessons, all of which have a fileupload question. I would like to create a view so I can see on one page all the 10 file uploads by this one student. Preferably I would also like to be able to filter the files/links by student. Right now I have to go to each Lesson result and then look for the student, a bit troublesome since we have quite a few students, and they would not be submitting their answers (file uploads) at the same time. Thanks! Hope the above made sense. Gerry
valbudkin

Hi I have the same issues.

Hi I have the same issues.
Profile picture for user James Aparicio
James Aparicio

Hi,

Hi, Ofc this can be done. You should start be creating a view displaying all the files and users that uploaded for a given quiz. This may require creating a custom handler. Having done this, you can create another view that lists the quizzes for a given course where you add the previous view as a field. Best regards
Profile picture for user James Aparicio
James Aparicio

It can also be done in one

It can also be done in one view.
picode

Thanks for confirming and for

Thanks for confirming and for helping point me in the right direction. I'm not exactly an expert with Views but I will try your suggestion, hopefully I don't have to write a Views handler for this. :) This is what I am trying to go for
  • List of all file uploads -- all quizzes, all courses, by all students
  • Courses -- I should be able to filter by courses
  • Students -- I should be able to filter by students
If I make any progress on this I will post it here.
Profile picture for user James Aparicio
James Aparicio

Hi picode, 

Hi picode, 

I suspect you will have to create a handler, because the quiz question is a content type, but the responses are not Drupal entities (Views is not aware of them). This is what you will probably have to do, let views know that each quiz question has several responses consisting of files.

Best regards

 

picode

Sadly, yes, that was what was

Sadly, yes, that was what was bugging me when I first asked my question. I couldn't find the file uploads (the responses by students, not the questions) from within Views :( Time to hit the Drupal pages on Views handlers ... Thanks again!
picode

Just an update on my (slow)

Just an update on my (slow) progress :) Noticed that quizfileuploads by students are temporary, so their file uploads are removed on next cron, so I had to update the Opigno module quizfileupload. profiles/opigno_lms/modules/contrib/quizfileupload/quizfileupload.classes.inc class QuizfileuploadQuestion --> public function save() I added the following lines after `$this->file = file_save_upload('tries', $validator, 'public://');` if ($this->file) { /* set status to permanent */ $this->file->status = FILE_STATUS_PERMANENT; $this->file = file_save($this->file); } Is the above OK? Is there a better approach for this? I also plan to update the same quizfileupload module for the Views handlers for the quizfileupload answers from students. Am I on the right path with this plan? Thanks and Happy 2015!
wsoinake

I wanted to use it in my

I wanted to use it in my project now. Thanks very much! I couldn't find any knowledge on this matter prior to.Also operate a site and if you are ever interested in doing some fifacoingroup