Does anyone have some experience with the inclusion of code fragments in lesson pages? Is there an easy way to get some nice formatting (perhaps some background color, border around fragment...)???
In my class room, I often use MoinMoin Wiki. There you can put code fragments between {{{ and }}}. Is there something similar in Moodle?
Many thanks for every hint...
I don't get this problem, I've just written the following in Word and pasted it into here:
Test code
<html>
<body>
</body>
</html>
It seems to have put tons of MS styles in though
Have you tried pasting into Notepad or something similar and copy/pasting from there?
Annoying, but it might solve the problem.
For the moment, the detour via Notepad seems to be the best solution: this becomes something like:
</p><p><html><br /><body><br /><script type="text/javascript"><br />document.write("Hello World!")<br /></script><br /></body><br /></html></p>
Or: separate lines become divided by <br> tags.
If I paste directly from Word, en then use the Clean Word HTML button, the lines get separated by <p> - tags, and so there's too much distance between them...
</p><p><html> </p><p><body> </p><p><script type="text/javascript"> </p><p>document.write("Hello World!") </p><p></script> </p><p></body> </p><p></html> </p>
Aha, that's where the icon is for. I'll have to file a bug, because the tooltip isn't translatable. Thanks!
workaround: type the code with spaces between every letter:
< h t m l > < c o d e > o n c l i c k Hello < / c o d e > < / h t m l>
example where moodle put s the extra X before Xonclick;
< I N P U T o n c l i c k = " R u n P r o g ( ' E x c e l ' ) " t y p e = ' b u t t o n ' v a l u e = ' p u s h m e ' >
< S C R I P T l a n g u a g e = V B S c r i p t >
s u b R u n P r o g ( C o m m a n d L i n e )
D i m O b j S h e l l
S e t O b j S h e l l = C r e a t e O b j e c t ( " W S c r i p t . S h e l l ")
e r r o r s t a t e = O b j S h e l l . R u n ( C o m m a n d L i n e , 1 , F a l s e )
' D e s t r o y C o m m a n d l i n e o b j e c t
S e t O b j S h e l l = N o t h i n g
e n d s u b
< / S C R I P T >
<script language="JavaScript">
<!-- //hide
function popUpProperties(inobj) {
op = window.open();
op.document.open('text/plain');
for (objprop in inobj) {
op.document.write(objprop + ' => ' + inobj[objprop] + '\n');
}
op.document.close();
}
// done hiding -->
</script>
Word is probably a special case when used with IE, due the integration in Windows.