SMILEConsortium / node-smile-server

3 stars 4 forks source link

SMILE IQManager should be able to put pictures into a session when a teacher uses prepared questions #64

Closed truedat101 closed 10 years ago

truedat101 commented 10 years ago

Right now we ignore the images. We need to load them.

truedat101 commented 10 years ago

Need to modify postNewIQSet() to handle saves of PICURL data into the FS.

truedat101 commented 10 years ago

I think what this needs is to save the image as < ID >< QNUM >.data under static/iqdata. When starting a session, we'd match the IQSet _ID to the IQSet being loaded, and if there are any questions TYPE QUESTION_PIC, then we will load the image from the FS, and put the image into the Question.PIC.

truedat101 commented 10 years ago

Now that I think about this .... the question submission either contains a PIC attribute or not. If so, we then store this in the iqdata questions. End of story.

truedat101 commented 10 years ago

However, thinking on this, we have to make sure the PICURL matches the current order of the question in the new IQSet. So let's stick with handling on the server, but we'll inject the PIC before we write via Persisteus.

truedat101 commented 10 years ago

We have the PICURL. Just snarf the image from this data.

truedat101 commented 10 years ago

OK, so right way to do this is as follows. When we add questions (via the client) we store the PIC into a listOfQuestions[] array in the Question object. We want to use the PICURL to get the index of the question, and then use that to get the question picture, store that piicture in the iqdata[index].PIC. Done!

truedat101 commented 10 years ago

Need to verify whether preloaded questions will load the image too!

truedat101 commented 10 years ago

I think what will be needed is a way to load the questions + for each Question TYPE.QUESTION_PIC is to add the PIC data into the list of questions. Though, I'm thinking maybe this already will work?

truedat101 commented 10 years ago

Doesn't completely work. Needed #62 to fix. Then need to look at putting the IQSet data for PIC into the world.

truedat101 commented 10 years ago

Ok, now I think the next thing is that while we've stored the PIC data, we don't pick up the PIC in the teacher app. The teacher app needs to submit the PIC back to the server (yes, this is getting redundant how many times we store and pass around the images).

truedat101 commented 10 years ago

The teacher app was ignoring the PIC URL field. Consequently, it doesn't send the right TYPE back up either.

truedat101 commented 10 years ago

This is working now. It's on the teacher app to handle the correct loading of the Question data into collections with PIC set.