Nanogong Maximum Recording Duration

Nanogong Maximum Recording Duration

by Daniel Phillips -
Number of replies: 3

Hi all,

We've been using the Nanogong/Moodle integrated plugin at my place which includes the:

  • htmlarea addon
  • Nanogong assignment type
  • Nanogong activity type

Does anyone know how to set the maximum recording duration?

The Max Recording Duration is only configurable when adding a Nanogong activitiy through the Moodle interface but not when using Nanogong in htmlarea or Nanogong assignment.

Through testing I was able to record a maximum of 5mins recording duration when using the Nanogong assignment type.

I saved the 5min recording in WAV format using the Nanogong interface and the file was only 6.8MB

Our Moodle has a maximum upload file size of 128MB.

There is some reference on the Nanogong website regarding a parameter MAXDURATION here: http://gong.ust.hk/nanogong/info_config.html#MaxDuration - but this parameter is only configurable when setting up a Nanogong activity.  I want to set a MaxDuration for a Nanogong assignment.

There is also another thread here asking the same question How to set maximum recording time: http://moodle.org/mod/forum/discuss.php?d=167848

Any ideas out there ?

Many thanks in advance big grin

Average of ratings: -
In reply to Daniel Phillips

Re: Nanogong Maximum Recording Duration

by Joshua Wang -
 I'm happy that I solve the problem by myself! :D

I've spend a long time for search on the website

then I found this http://gong.ust.hk/nanogong/info_config.html like yours

and I found a file called "assignment.class.php" in "....\moodle\mod\assignment\type\nanogong"

My way is:

open the file "assignment.class.php" 
then add "<param name="MaxDuration" value="900" />
right after
line 80
echo '<applet archive="'.$CFG->wwwroot.'/mod/assignment/type/nanogong/nanogong.jar" id="recorder" name="recorder" code="gong.NanoGong" width="180px" height="40px">
but before
line 80
 </applet>'."\n";
 
 
 
 
 
 

 
 
 
 
then it work!!

I also add <param name="SamplingRate" value="32000" /> and <param name="ShowTime" value="true" />
between that
to make our students can know how long did they record and make the .WAV size can be smaller


then i found in line 259-263
there are similar words to line 80
I try to add "$output.='<param name="ShowTime" value="true" />';" in a new line

then I can see the time on students' recording
 
 
In reply to Joshua Wang

Re: Nanogong Maximum Recording Duration

by Frankie Kam -
Picture of Plugin developers

Hi Joshua Thanks for sharing this!

Just to be clear, is this what you added (in magenta bold text)?

echo '<form method="post">'."\n";
echo '<applet archive="'.$CFG->wwwroot.'/mod/assignment/type/nanogong/nanogong.jar" id="recorder" name="recorder" code="gong.NanoGong" width="180px" height="40px"></applet>'."\n";
echo '<param name="MaxDuration" value="900" />'."\n";
echo '<param name="SamplingRate" value="32000" />'."\n";
echo '<param name="ShowTime" value="true" />'."\n";
echo '<br />'."\n";

...

function print_student_answer($userid, $return = true){
     global $CFG, $USER;

     $filearea = $this->file_area_name($userid);

     $output = '';

     if ($basedir = $this->file_area($userid)) {
         if ($files = get_directory_list($basedir)) {
             require_once($CFG->libdir.'/filelib.php');
             foreach ($files as $key => $file) {
                 $ffurl = get_file_url("$filearea/$file");
                 $output.='<applet archive="'. $CFG->wwwroot.'/mod/assignment/type/nanogong/nanogong.jar" id="submittedrecording" name="submittedrecording" code="gong.NanoGong" width="130px" height="40px">';
                 $output.='<param name="SoundFileURL" value="'.$ffurl.'" />';
                
                 $output.='<param name="ShowTime" value="true" />';
                
                 $output.='<param name="ShowAudioLevel" value="false" />';
                 $output.='<param name="ShowRecordButton" value="false" />';
                 $output.='</applet>';
             }
         }
     }

Please confirm.

I'm asking because I tried the hack, but it didn't seem to make a difference. I couldn't get to see the remaining time left for recording (max time is set 900 seconds). Maybe you can upload some mini-screenshots of the final effect you achieved. That would be great.

FRankie Kam
http://moodurian.blogspot.com
http://scm.moodleace.com

In reply to Frankie Kam

Re: Nanogong Maximum Recording Duration

by Joshua Wang -

i think there are something different between your set and mine

that's my set (in red and magenta bold text)

----

echo '<form method="post">'."\n";
echo '<applet archive="'.$CFG->wwwroot.'/mod/assignment/type/nanogong/nanogong.jar" id="recorder" name="recorder" code="gong.NanoGong" width="180px" height="40px"><param name="MaxDuration" value="900" /><param name="SamplingRate" value="32000" /></applet>'."\n";
...

...

-----

the other one is the same

 if ($basedir = $this->file_area($userid)) {
         if ($files = get_directory_list($basedir)) {
             require_once($CFG->libdir.'/filelib.php');
             foreach ($files as $key => $file) {
                 $ffurl = get_file_url("$filearea/$file");
                 $output.='<applet archive="'. $CFG->wwwroot.'/mod/assignment/type/nanogong/nanogong.jar" id="submittedrecording" name="submittedrecording" code="gong.NanoGong" width="130px" height="40px">';
                 $output.='<param name="SoundFileURL" value="'.$ffurl.'" />';
                 $output.='<param name="ShowTime" value="true" />';
                 $output.='<param name="ShowAudioLevel" value="false" />';
                 $output.='<param name="ShowRecordButton" value="false" />';
                 $output.='</applet>';
             }
         }
     }

-----

hope it can be work in your moodlesmile