This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-08-26 14:08:03

ashbyr1
Scratcher
Registered: 2007-12-04
Posts: 100+

PHP text filter for moodle

I think I have an idea that would be easy to create for someone familiar with PHP.

I would like to make if easy for students to embed projects hosted on the scratch site into my moodle course.  Here's what I envision:

For a project at:

Code:

http://scratch.mit.edu/projects/ashbyr1/523947

a student could enter

Code:

[http://scratch.mit.edu/projects/ashbyr1/523947]

which could be converted (by PHP magic) to:

Code:

<applet id='ProjectApplet' style='display:block' code='ScratchApplet' codebase='http://scratch.mit.edu/static/misc' archive='ScratchApplet.jar' height='387' width='482'><param name='project' value='../../static/projects/ashbyr1/523947.sb'></applet> <a href='http://scratch.mit.edu/projects/ashbyr1/523947'>Learn more about this project</a>

This idea is based on the following moodle documentation
http://docs.moodle.org/en/Development:Filters

Last edited by ashbyr1 (2009-08-26 14:11:29)


Learn the basics with these video tutorials.
Or nominate an All Star Animation.

Offline

 

#2 2009-08-26 15:23:32

filo5
Scratcher
Registered: 2008-01-08
Posts: 1000+

Re: PHP text filter for moodle

Well, it could be done with BBcode library... From phpBB3 I made a BBcode once to embed a Scratch project:

Code:

[project={LOCAL URL to project, like ../prj/lol.sb}]{Description of project}[/project]

Of course it needed few tune-ups, but if it's possible to make moodle parse BBcode, this would be easy. As for [{http_link_to_project}], it needs brand new regexps, and it'd be more complicated than you think, or I don't know moodle's possibilities.


Converting my Scratch projects to Python!

Offline

 

Board footer