If you have created activities with embedded videos and tried to use the “Give credit based on fraction watched” code, you may have noticed that some videos will play all the way through, but not show as 100% watched.
I developed this alternative:
<video name="v1" youtube="_P7AI5nghyo"><shortDescription>A youtube video where Ash says "Pikachu, I choose you!"</shortDescription></video>
<setup> <number name="watch">$v1.secondsWatched/($v1.duration-1)</number><number name="percent">$v1.secondsWatched/($v1.duration-1)*100</number> </setup>
<p>Video credit achieved:
<min>$percent 100</min><math>%</math></p>
<answer hide name="v1Credit">
<award credit="$watch">
<when>true</when>
</award>
</answer>
<callAction triggerWith="$v1" target="$v1Credit" actionName="submitAnswer" />
This works the same as the $v.fractionWatched, in that all you need to do is paste in the end of the YouTube URL. I think the problem with $v.fractionWatched is in how Youtube deals with the fractional part of the time in videos, as most videos are not an exact number of seconds long. It would give students full credit for a video if they pause it with less than a second left, but I’m not sure that I think that’s an issue.
I tested this with a few different videos to make sure that it showed the percentage correctly, AND that it is recording the score for the students accurately.
Hope this is helpful!