WebCT fixer

By Splondike Last update Aug 11, 2008 — Installed 441 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 2 posts, 2 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
ArShui Scriptwright

Thank for you great work and I have just extended your script to be more powerful by converting link in the "Content Module" to direct link, which is much faster than go through the extra step in webct.

Test on webct 4.1 Campus Version

just insert the following code before if(useFramesInHref){


/*
  The Purpose is to the path from this format http://webct2.polyu.edu.hk//SCRIPT/COMP433_20071_A/scripts/student/serve_page.pl/COMP433_20071_A/lec11.ZIP?959112278+2479103960 to http://webct2.polyu.edu.hk/web-ct/courses/COMP433_20071_A/2479103960.ZIP

where:
2479103960 is the filename
ZIP is the extension
COMP433_20071_A is the course name
web-ct/courses is the actual directory storing the file

*/
			if (chunks[2].indexOf("/serve_page.pl/")!=-1 && chunks[2].indexOf("#")==-1) {
				chunks[2]=chunks[2].substr(chunks[2].indexOf("/serve_page.pl/") + "/serve_page.pl/".length);
				var filename=chunks[2].substr(chunks[2].indexOf("+")+1);
				filename=chunks[2].substring(0, chunks[2].indexOf("/")+1) + filename + chunks[2].substring(chunks[2].indexOf(".", 2), chunks[2].indexOf

("?",2));
				href = baseURL + "/web-ct/courses/" + filename;

				link.setAttribute("target", "_blank");
				link.removeAttribute("onclick");




//COMP433_20071_A/lec11.ZIP?959112278+2479103960
//alert(filename);
//break;
//serve_page.pl/
//http://webct2.polyu.edu.hk/web-ct/courses/COMP433_20071_A/2502401951.ZIP
			} else 

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel