Sunday, June 5, 2011

Adding video feedback to the Assignment activity

Hi. An important element of the Moodle assignment activity is feedback from the facilitator. Do you give feedback to students inside the Assignment activity? I don't know about you, but I personally find giving feedback a chore. Especially when one is bogged down with lots of paperwork and preparation. It shouldn't be a chore since quality feedback is very important to students' learning.

By default, Moodle 1.9's feedback section of the activity is text-mode. How many of you had at one point or other had wished that you could give video feedback? Well, the good news is that Kevin Brake has created a Forum Video Recorder that works inside Moodle forums. I am also happy to announce that I have used Kevin Brake's excellent code, some sleuthing and hacking of a Moodle 1.9.7 core file to enable video feedback within the assignment activity itself.

To give video feedback, you will need to:
1. use a working webcam (obviously)
2. install Kevin Brake's excellent Forum Video Recorder. For instructions on how to use it, click here.
    To know how to install it, click here.
3. have Java Runtime installed
4. have the QuickTime plugin installed. In case QuickTime gives your Wbb browser problems,
    download and install QuickTime alternative
5. insert some code inside /mod/assignment/submissions.php.
    To see the Moodle 1.9.7 file that I used, download the submissions.php file.

If you have successfully installed the Forum Video Recorder, you should be able to embed MP4 videos inside Moodle forums activities and label resources. Congratulations so far!

The next step is actually to add video feedback to the Assignment activity. Here's what I did. I edited the /mod/assignment/submissions.php file. At line 92, you should see this code:


Insert Kevin's code just before the $assignmentinstance->submissions($mode); line.



//My Forum Video Recorder Code

$prefix = 'W'; // a universal prefix prefix 

$my_random_id = $prefix;
$my_random_id .= chr(rand(65,90));
$my_random_id .= time();
$my_random_id .= uniqid($prefix);

//Set the path to the location of the videoapplet index.php found on your server 

$my_moodle_url = "/moodle/videoapplet/index.php";
$my_moodle_url .= "?random_id=$my_random_id";
echo <<< HTML
function showhide(id)
if (document.getElementById)
obj = document.getElementById(id);
if ( == "none"){ = "";
} else { = "none";


<a href="#" onClick="showhide('$my_random_id'); return(false);">
<img src="/moodle/videoapplet/webcam.png" alt="Webcam reply"></a>

<div style="display: none;" id="$my_random_id">
<iframe src="$my_moodle_url" width="560" height="400" frameborder="1" scroller="no">

  <p>Your browser does not support iframes.</p>



To save you time, you can download the submissions.php file that contains the hack code. The code works for Moodle 1.9.7. Make sure you backup your original submissions.php file first! Also, here is the zip file of the videoapplet files that I am using on my production site. You can find the png image of the webcam (shown in the Youtube video below), and the code that loads it, inside this zip file.

Lastly, I leave you a Youtube video explaining the process. Please bear with me that somehow I was unable to get Camtasia 6.0 to capture the webcam window's output. Perhaps someone out there can help me know how to do it right.

If you face any problems installing and getting the Video Recorder to work, please do not hesitate to contact me! You can leave a message for me on this blog, or email me at boonsengkam[at] Until the next time, have a great day Moodling.

Frankie Kam

If you like this post or site
a small donation would be nice but would last only a day,
otherwise leaving a comment (or a compliment) below will last me a month!

Ratings and Recommendations by outbrain