Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Code modifications to 5 existing files in the quiz directory directory 'login/CourseManagement/quiz/' is required. No new files are anticipated at this time.

File Name

Proposed Addition/Modification

/login/CourseManagement/quiz/qz_win_ques_list.cfm

Modifications to add the Added an Export Question Pool link to this page will be limited . Limited to code where mode=question, since this same list box is used for questions and quizzes under various pages. Code modifications include adding a link with JavaScript functionality function exportPool() to open a new window . No query calls will be made from this page./login/CourseManagement/quiz/as "qz_quiz_exportxml.cfm?quizID=0&export=questionPool" where no data is passed through the url.

qz_col_title.cfm

Modifications to add Added the Export Collection link to this page will be limited to . Limited to code for editing an existing collection. Code modifications include adding a link with JavaScript functionality function export_collection() to open a new window . No query calls will be made from this page. /login/CourseManagement/quiz/as "qz_quiz_exportxml.cfm?quizID=0&export=collection&collectionid=#collectionid#" so that the collection id is passed via the url.

qz_quiz_properties.cfm

Modified Export Quiz url to add export="quiz"

qz_quiz_exportxml.cfm

This file is currently used to display export instructions including a Download button and link for the export xml and media zip files. Text will be added to the reflect information specific to a Modified export instructions on this display page to reflect whether the export is a quiz, question pool or collection rather than a quiz. Text will be visible based on a variable passed in through the new window link./login/CourseManagement/quiz/. Added total number of questions, Download Pool button, and output for media files.

qz_quiz_exportxml.cfc

This component file contains functions for generating quiz information in string or array formats Separated out section functions from question functions. getSectionArray populates the section array from quiz data while setSectionArray populates the section array with sectionid=0 and name="Default". The section array is then fed into setSectionData for attaching items and their parameters for delivery to the xml file generation page. Additional functions will be added to pull and format the questions for a user's question pool or collection./login/CourseManagement/quiz/Added several functions specific to qpools and collections plus a media function. Modified certain functions where query output passed into a "where variable in ()" clause might exceed 1000 records due to Oracle limits.

qz_quiz_exportxmldoc.cfm

This file generates the downloadable xml file for a quiz/assessment. This file will be modified Modified file by adding logic based on quizid and export url values to determine which function calls (quiz, question pool, or collection) will be made. Modified the xml file generation to allow question pool or collection data to be delivered in the same downloadable xml format.

qz_quiz_exportfiles.cfm

The export media code is being developed at the same time and is an active link on qz_quiz_exportxml.cfm, so it needs to be released concurrently, even though the test plan will be separate.

Info
titleUseful Information

After struggling with multiple non-standard ascii issues, I discovered this ColdFusion code for dealing with the issue at http://www.octadyne.com/html_entity_acsii_table.cfm. Wrapping this function around user generated text solved the invalid xml issues I was running into.

Code Block

<cfscript>
/**
 * Coverts special characters to character entities, making a string safe for display in HTML.
 * 
 * @param string 	 String to format. (Required)
 * @return Returns a string. 
 * @author Gyrus (gyrus@norlonto.net) 
 * @version 1, April 30, 2003 
 */
function HTMLSafe(string)
{
	var badChars="#chr(128)#,#chr(130)#,#chr(131)#,#chr(132)#,#chr(133)#,#chr(134)#,#chr(135)#,
#chr(136)#,#chr(137)#,#chr(138)#,#chr(139)#,#chr(140)#,#chr(142)#,#chr(145)#,#chr(146)#,#chr(147)#,
#chr(148)#,#chr(149)#,#chr(150)#,#chr(151)#,#chr(152)#,#chr(153)#,#chr(154)#,#chr(155)#,#chr(156)#,
#chr(158)#,#chr(159)#,#chr(161)#,#chr(162)#,#chr(163)#,#chr(164)#,#chr(165)#,#chr(166)#,#chr(167)#,
#chr(168)#,#chr(169)#,#chr(170)#,#chr(171)#,#chr(172)#,#chr(173)#,#chr(174)#,#chr(175)#,#chr(176)#,
#chr(177)#,#chr(178)#,#chr(179)#,#chr(180)#,#chr(181)#,#chr(182)#,#chr(183)#,#chr(184)#,#chr(185)#,
#chr(186)#,#chr(187)#,#chr(188)#,#chr(189)#,#chr(190)#,#chr(191)#,#chr(192)#,#chr(193)#,#chr(194)#,
#chr(195)#,#chr(196)#,#chr(197)#,#chr(198)#,#chr(199)#,#chr(200)#,#chr(201)#,#chr(202)#,#chr(203)#,
#chr(204)#,#chr(205)#,#chr(206)#,#chr(207)#,#chr(208)#,#chr(209)#,#chr(210)#,#chr(211)#,#chr(212)#,
#chr(213)#,#chr(214)#,#chr(215)#,#chr(216)#,#chr(217)#,#chr(218)#,#chr(219)#,#chr(220)#,#chr(221)#,
#chr(222)#,#chr(223)#,#chr(224)#,#chr(225)#,#chr(226)#,#chr(227)#,#chr(228)#,#chr(229)#,#chr(230)#,
#chr(231)#,#chr(232)#,#chr(233)#,#chr(234)#,#chr(235)#,#chr(236)#,#chr(237)#,#chr(238)#,#chr(239)#,
#chr(240)#,#chr(241)#,#chr(242)#,#chr(243)#,#chr(244)#,#chr(245)#,#chr(246)#,#chr(247)#,#chr(248)#,
#chr(249)#,#chr(250)#,#chr(251)#,#chr(252)#,#chr(253)#,#chr(254)#,#chr(255)#";

        var goodChars="&euro;,&sbquo;,&fnof;,&bdquo;,&hellip;,&dagger;,&Dagger;,&circ;,&permil;,
&Scaron;,&lsaquo;,&OElig;,&##381;,&lsquo;,&rsquo;,&ldquo;,&rdquo;,&bull;,&ndash;,&mdash;,&tilde;
,&trade;,&scaron;,&rsaquo;,&oelig;,&##382;,&##376;,&iexcl;,&cent;,&pound;,&curren;,&yen;,&brvbar;
,&sect;,&uml;,&copy;,&ordf;,&laquo;,&not;,&shy;,&reg;,&macr;,&deg;,&plusmn;,&sup2;,&sup3;,&acute;
,&micro;,&para;,&middot;,&cedil;,&sup1;,&ordm;,&raquo;,&frac14;,&frac12;,&frac34;,&iquest;,&Agrave;,
&Aacute;,&Acirc;,&Atilde;,&Auml;,&Aring;,&AElig;,&Ccedil;,&Egrave;,&Eacute;,&Ecirc;,&Euml;,&Igrave;,
&Iacute;,&Icirc;,&Iuml;,&ETH;,&Ntilde;,&Ograve;,&Oacute;,&Ocirc;,&Otilde;,&Ouml;,&times;,&Oslash;,
&Ugrave;,&Uacute;,&Ucirc;,&Uuml;,&Yacute;,&THORN;,&szlig;,&agrave;,&aacute;,&acirc;,&atilde;,&auml;,
&aring;,&aelig;,&ccedil;,&egrave;,&eacute;,&ecirc;,&euml;,&igrave;,&iacute;,&icirc;,&iuml;,&eth;,
&ntilde;,&ograve;,&oacute;,&ocirc;,&otilde;,&ouml;,&divide;,&oslash;,&ugrave;,&uacute;,&ucirc;,
&uuml;,&yacute;,&thorn;,&yuml;";
	
	// if you like to go number route then comment the above goodChars and uncomment the following
	//var goodChars="&##8364;,&##8218;,&##402;,&##8222;,&##8230;,&##8224;,&##8225;,&##710;,&##8240;,
&##352;,&##8249;,&##338;,&##381;,&##8216;,&##8217;,&##8220;,&##8221;,&##8226;,&##8211;,&##8212;,&##732;,
&##8482;,&##353;,&##8250;,&##339;,&##382;,&##376;,&##161;,&##162;,&##163;,&##164;,&##165;,&##166;,&##167;,
&##168;,&##169;,&##170;,&##171;,&##172;,&##173;,&##174;,&##175;,&##176;,&##177;,&##178;,&##179;,&##180;,
&##181;,&##182;,&##183;,&##184;,&##185;,&##186;,&##187;,&##188;,&##189;,&##190;,&##191;,&##192;,&##193;,
&##194;,&##195;,&##196;,&##197;,&##198;,&##199;,&##200;,&##201;,&##202;,&##203;,&##204;,&##205;,&##206;,
&##207;,&##208;,&##209;,&##210;,&##211;,&##212;,&##213;,&##214;,&##215;,&##216;,&##217;,&##218;,&##219;,
&##220;,&##221;,&##222;,&##223;,&##224;,&##225;,&##226;,&##227;,&##228;,&##229;,&##230;,&##231;,&##232;,
&##233;,&##234;,&##235;,&##236;,&##237;,&##238;,&##239;,&##240;,&##241;,&##242;,&##243;,&##244;,&##245;,
&##246;,&##247;,&##248;,&##249;,&##250;,&##251;,&##252;,&##253;,&##254;,&##255;";


	// Return immediately if blank string
	if (NOT Len(Trim(string))) return string;
	
	// Do replacing
	return ReplaceList(string, badChars, goodChars);
}
</cfscript>

Code Review

Brian Donnelly, or another qualified member of the MyUCDavis team, will perform code review on these file changes.

QA Testing

A test document Question Pool Export Test Plan will be created to explain allow testers to step through the expected new feature behaviour and functional function results. This new feature Export question pools will be tested as a stand-alone feature and the same test will be used when all parts of the MyUCDavis-Samigo quiz/question pool migration features are accessible. The separate tests for each process encompass the test plan.

...