It would be nice to add some module_invoke_all()s so other modules can receive notification of scorm activities, even if it's just after scorm_insert_track() with the value that was inserted.

Right now I have to do some tricky things to detect the /datamodel call, look for a row in the database, etc...

Thanks!

Comments

pgerling’s picture

Assigned: Unassigned » pgerling
Priority: Normal » Minor
pgerling’s picture

hey,
I am not sure if i realy understood what you want to do. My suggestion is to add

	module_invoke_all('scorm_getnotification', 'scorm_insert_track', array('scormid' => $scormid, 'track' => $track));

on line 2516 in SCORM.module (last line of scorm_insert_track()).

A method using this could look like

	foo_scorm_getnotificaiton($caller, $data) {
		switch($caller) {
			case: 'scorm_insert_track':
				//.. do some magic using $data
		}
	}

Is this what you want to get? If so, we could discuss additinal positions in cck_scorm which should sent notifications.

philipp

djdevin’s picture

Pretty much, I would call something like hook_scorm_track_saved() instead of using things like $op and $caller which Drupal7 seemed to move away from.

pgerling’s picture

Since we do not inted to release a D7 version of cck_scorm, I see no problem using D6-practices. But since the "how to call the hook" question should only be secondary, are there any other places through the sourcecode you would recommend me to set a "notification-point"?

pgerling’s picture

Status: Active » Closed (fixed)

I just implemented the feature.. it would be kind if you could give me some feedback if it worked as you wanted to..

/Philipp