Stanford-Online / xblock-in-video-quiz

BSD 3-Clause "New" or "Revised" License
18 stars 25 forks source link

Fix in-video quiz questions not appearing properly over video #10

Closed karandikar closed 7 years ago

karandikar commented 7 years ago

If a video isn't the first component in the unit, the in-video-quiz questions appear incorrectly positioned on the page. This repositions the questions to properly cover the video while it's paused.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling cc49b3c3ec068f69789906c6227f849cf9be3ee9 on karandikar:fix-ivq-questions into on Stanford-Online:master.

stvstnfrd commented 7 years ago

@karandikar Screenshot?

And did you verify this behavior when video is the first component in the unit.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 8b0eb8afad881eb29ab84dcb6ab42a70f09b098f on karandikar:fix-ivq-questions into on Stanford-Online:master.

karandikar commented 7 years ago

@stvstnfrd Regarding behavior when video is first element: the question would appear in the correct position, but for the wrong reason. The way @caesar2164 explained it, the MVP assumed that a video would be the first component, so in-video quiz questions were hard-coded to align to where a video would be if it were the first component. When videos were no longer the first component, the in-video quiz questions would still appear over the first component area, creating the behavior described in the trello card. My fix works for all videos, whether or not they're the first component. Screenshots forthcoming

karandikar commented 7 years ago

with video as first component: image with video as second component: image

caesar2164 commented 7 years ago

@stvstnfrd this PR makes this xblock work the way it should work. When the JS is about to display a problem, it gets the position and height of the video and makes the problem match that.