[Building Sakai] Skin Selector in Test and Quizzes

Paul Lukasewych plukasew at uwo.ca
Mon Jul 15 12:02:15 PDT 2013


Thanks Phil. Stock Sakai doesn't seem to have that file in the skin folders.

Does anyone on the list know how to do this for the standard release?

Paul Lukasewych
Applications Development Team
Information Technology Services
Support Services Building
Western University
(519) 661-2111 x80513
plukasew at uwo.ca

On July 15, 2013 18:32:21 McCullick, Philip Contractor, GDIT wrote:


Hi Paul,
 
NPS uses the rSmart version of Sakai. The skin files on our server are located in the 
webapps/library/skin/ folder. There is a portal.xslt file in each of the skin folders. 
 
Phil
___________________________________
Philip McCullick, Media Development Manager
*General Dynamics Information Technology*
Supporting the Center for Educational Design, Development, and Distribution (CED3)
Naval Postgraduate School
(831) 656-2443 

 
 
 
*From:* Paul Lukasewych [mailto:plukasew at uwo.ca] 

*Sent:* Monday, July 15, 2013 9:47 AM

*To:* McCullick, Philip Contractor, GDIT

*Cc:* sakai-dev at collab.sakaiproject.org

*Subject:* Re: [Building Sakai] Skin Selector in Test and Quizzes
 
Hi Phil,

I'm just starting to work on this now and I'm having trouble locating the portal.xslt file 
you are referring to. Which project is it in? Is the NPS source code available anywhere I 
could look at?

Thanks,

Paul Lukasewych
Applications Development Team
Information Technology Services
Support Services Building
Western University
(519) 661-2111 x80513
plukasew at uwo.ca[1]

On June 3, 2013 15:29:12 McCullick, Philip Contractor, GDIT wrote:
Hi Paul,
 
For the math skin, we used the portal.xslt file to include MathJax only on the Tests  & 
Quizzes pages. The Sakai headscripts.js makes an optional call to postIframeResize() if 
the method exists in the parent. So we used that callback to put the MathJax script 
into the quiz iframe each time it loads a page. It does have to scan the entire page for 
Latex tokens, so only classes that use a lot of complex Math use this skin. 
 
The area we changed in the portal.xslt is inside of
<xsl:template name="tool">
                …
                <div class="portletMainWrap">
<xsl:choose>
                …
</ xsl:choose>
                                                The following xslt/JavaScript code was put here.               
                                                
Here is the code we added:
                <!— Check for the Test & Quizzes tool -->
                <xsl:if test="contains($tool/toolHelp, 'samigo')">
                <!— Add a hidden input for the mainframe's id so scripts can point at it -->
                <input type="hidden"   id="mainFrameId">
                                <xsl:attribute name="value">
                                                <xsl:value-of select="$tool/escapedId"/>
                                </xsl:attribute>            
                </input>
 
                <script type="text/javascript">
                // <![CDATA[
                var mainFrameID = document.getElementById("mainFrameId").value;
                var mathJaxLocation = "/library/js";
                
                //headscripts.js calls the postIframeResize method after resizing finishes
                function postIframeResize() {
                                var script = 
document.getElementById(mainFrameID).contentWindow.document.createElement("
script");
                                script.type = "text/javascript";
                                script.src = mathJaxLocation + 
"/MathJax/MathJax.js?config=default";   // use the location of your MathJax folder
                                var config = 'MathJax.Hub.Startup.onload();';
 
                                if (window.opera) {
                                                script.innerHTML = config;
                                } else {
                                                script.text = config;                                                                         
                                }
                                                                                                
document.getElementById(mainFrameID).contentWindow.document.getElementsByT
agName("head")[0].appendChild(script);
                }                                              
                //]]>
 
                </script>
                </xsl:if>
 
 
Hope that helps,
Phil
 
___________________________________
Philip McCullick, Media Development Manager
*General Dynamics Information Technology*
Supporting the Center for Educational Design, Development, and Distribution (CED3)
Naval Postgraduate School
(831) 656-2443 
 
 
 
 
 
*From:* sakai-dev-bounces at collab.sakaiproject.org[2] [_mailto:sakai-dev-
bounces at collab.sakaiproject.org_] *On Behalf Of *Paul Lukasewych

*Sent:* Friday, May 31, 2013 7:45 AM

*To:* sakai-dev at collab.sakaiproject.org[3]; Help Desk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20130715/26a70421/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 3720 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20130715/26a70421/attachment.png 


More information about the sakai-dev mailing list