MichalGoly / QuizTool

Audience response system enabling lecturers to embed interactive quizzes in lecture slides and broadcast them to students in real time - MEAN - Socket.io - AWS - Angular - Express - Docker - docker-compose - CircleCI - Multicontainer Elasticbeanstalk - Selenium Grid
GNU General Public License v2.0
5 stars 1 forks source link

Allow PDF slides to be uploaded and stored in the database alongside lecturer's ID #36

Closed MichalGoly closed 6 years ago

MichalGoly commented 6 years ago

There seem to be 2 major ways to store files in the mongodb:

  1. Have a Schema with a property of type BSON which is capable of storing binary files of up to 16MB
  2. Use GridFS which allows larger files to be stored in Mongodb. For any file being stored with GridFS, the file is chopped into 255KB chunks. Those chunks are saved in a bucket, called fs, and a collection in that bucket, fs.chunks. Metadata about the files is stored in another collection in the same bucket, fs.files, though you can have more buckets with different bucket names in the same database.
MichalGoly commented 6 years ago
  1. Store files in an external storage and store the reference to the file in mongo
MichalGoly commented 6 years ago

I will most likely go with the BSON and limit the upload size to 16MB as it seems like a reasonable size for a PDF presentation and will significantly simplify the implementation.

MichalGoly commented 6 years ago

ng2-file-upload is giving me a massive headache... I'm struggling to integrate it with my project and I'm not the only one as it seems: https://github.com/valor-software/ng2-file-upload/issues/418

MichalGoly commented 6 years ago

Uploaded the PDF, now trying to slice it into slides but run into licensing issue and awaiting response from the uni, but this will be most likely delayed by the 1inch of snow and RED weather alert in Wales.

MichalGoly commented 6 years ago

Finally implemented presentation upload, stored it in as a Lecture model in the mongo database, split the pdf into slides and stored each in the database as a Slide model.

Each slide contains a PNG image of the slide, has a number so they can streamed in order later on, has a boolean flag to indicate whether lecturer selected it to be a quiz and most importantly has a String field containing the extracted text of each slide. This should be especially useful for the automatic detection if a slide can become a quiz in the future.