Closed truedat101 closed 10 years ago
Need to modify postNewIQSet() to handle saves of PICURL data into the FS.
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.
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.
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.
We have the PICURL. Just snarf the image from this data.
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!
Need to verify whether preloaded questions will load the image too!
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?
Doesn't completely work. Needed #62 to fix. Then need to look at putting the IQSet data for PIC into the world.
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).
The teacher app was ignoring the PIC URL field. Consequently, it doesn't send the right TYPE back up either.
This is working now. It's on the teacher app to handle the correct loading of the Question data into collections with PIC set.
Right now we ignore the images. We need to load them.