Displaying fractions in CLOZE

Displaying fractions in CLOZE

by James Brown -
Number of replies: 4

Hi,

I'm writing a cloze question which requires the students to fill in both the numerator and denominator of a fraction (215/356) but don't know how to do them properly. The following 

<p>{1:SHORTANSWER:%100%215#smile~*#sad}<br />_____<br />{1:SHORTANSWER:%100%356#smile~*#sad}</p>

works but is it possible to reduce the space between the bar and the top box? 

Cheers
James 

Attachment Fraction.png
Average of ratings: -
In reply to James Brown

Re: Displaying fractions in CLOZE

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi James,

Day before yesterday when I saw your question, I had no idea how to do it any better than you already had. But yesterday, I stumbled across the the Combined question type (Thanks TIm Hunt, Phil Butcher, and Jamie Pratt) and in the documentation for it, there was an example of how to do what you need. http://www.open.edu/openlearnworks/mod/oucontent/view.php?id=52747&section=4.4

I tried it out, and with a very slight modification, it looks pretty good.

<div><span style="border-bottom: 2px solid black; padding-bottom: 8px;">{1:SHORTANSWER:%100%215#smile~*#sad}</span></div>
<div style="padding-top: 4px;">{1:SHORTANSWER:%100%356#smile~*#sad}</div>

HTH,

AL

Average of ratings: Useful (2)
In reply to AL Rachels

Displaying fractions in CLOZE

by James Brown -

Thanks a lot Al, great stuff. James



In reply to James Brown

Displaying fractions in CLOZE

by James Brown -

I used table as below to do fraction addition:

<table border="0">

<tbody>

<tr>

<td>

<div style="border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: black; padding-bottom: 4px; font-size: medium; font-family: verdana;">1</div>

<div style="padding-top: 4px; font-size: medium; font-family: verdana;">2</div>

</td>

<td><span style="font-size: medium; font-family: verdana;">+</span></td>

<td>

<div style="border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: black; padding-bottom: 4px; font-size: medium; font-family: verdana;">1</div>

<div style="padding-top: 4px; font-size: medium; font-family: verdana;">3</div>

</td>

<td><span style="font-size: medium; font-family: verdana;">=</span></td>

<td>

<div style="border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: black; padding-bottom: 4px; font-size: small; font-family: verdana;">{1:SHORTANSWER:%100%5#smile~*#sad}</div>

<div style="padding-top: 4px; font-size: small; font-family: verdana;">{1:SHORTANSWER:%100%6#smile~*#sad}</div>

</td>

</tr>

</tbody>

</table>


Did I make things overly complex?


Attachment Fraction.png
Average of ratings: Useful (1)
In reply to James Brown

Re: Displaying fractions in CLOZE

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi James,

Looks great to me although I personally like to use MathJax as much as I can. MathJax easily handles some things easily that would be a little more messy to get working right, like this mixed number:

<table>
<caption>Do the indicated operation.</caption>
<thead>
<tr>
<th scope="col">\(\large 2\frac{1}{2}+3\frac{1}{3}=\)</th>
<th style="text-align: right;" scope="col">{1:SHORTANSWER:%100%5#smile~*#sad}</th>
<th scope="col"><div style="border-bottom: 2px solid black; padding-bottom: 1px; font-size: small; font-family: verdana; text-align: center;">{1:SHORTANSWER:%100%5#smile~*#sad}</div>

{1:SHORTANSWER:%100%6#smile~*#sad}</th>
</tr>
</thead>
<tbody>
</tbody>
</table>

EDIT: I just noticed part of what I entered above is being filtered so here is a picture of it so you can see the MathJax text.



Average of ratings: Useful (1)