Creating A New Module from newmodule_template.z ip

Creating A New Module from newmodule_template.z ip

by Matt P -
Number of replies: 5

We are trying to build a brand new module for our school that uses a Macromedia Flash based interface to display vocab exercises (right now just flashcards). We have succesfully linked flash to the database using AMF-PHP as a remoting service, and we would now like to create a Moodle module which allows teachers to select vocabulary words from a DB (sorted by lesson and word level) and display them in flash as flashcards (easy enough).

The module is called, simply, flashcards. What is the proper way to add instances of the flashcards module into the database? I keep getting an error that seems to indicate that the information from the mod.html form is not entering the database properly.

Any help would be greatly appreciated big grin

 Thanks,

][V][ATEO

Average of ratings: -
In reply to Matt P

Re: Creating A New Module from newmodule_template.z ip

by W Page -
Cannot help you with the coding but, this would be a great tool to use in improving the science literacy of students.

Please share the code and what you did to get it to work when ready.

WP1

In reply to Matt P

Re: Creating A New Module from newmodule_template.z ip

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
It sounds like you're using a very old version of the newmodule template - the latest is here:

http://moodle.org/download.php/modules/NEWMODULE.zip
In reply to Martin Dougiamas

Re: Creating A New Module from newmodule_template.z ip

by Matt P -

Here's what we've done so far:

  downloaded NEWMODULE.zip  (latest one)
  configured the template for the flashcards module (including mod.html)
  added new tables to database

We're getting an error when you try to create a new instance :

"Could not add new instance of flashcards"

could this be a problem with the table structure? Ours currently has the following fields:
  id, course, name, level, lesson, notes, sql_query, time_modified

The table name is mdl_flashcards_lesson, and the error seems to be originating from the mod/flashcards/lib.php file in the flashcards_add_instance() function.

Any suggestions?

In reply to Matt P

Re: Creating A New Module from newmodule_template.z ip

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Ah!   Trap for new players that one ... the main table needs to have the same name as the module.  ie "prefix_flashcards"
In reply to Martin Dougiamas

Re: Creating A New Module from newmodule_template.z ip

by Matt P -

Yeah!!big grinbig grinbig grinbig grinbig grinbig grinbig grinbig grinbig grinbig grin

That part is working! this module format is very nice!

Now to get AMF-PHP working again...thoughtful