Blackboard

Adding a hint button to test questions

rated by 0 users
Not Answered This post has 0 verified answers | 3 Replies | 1 Follower

Not Ranked
2 Posts
Michael Seery posted on 11 Jun 2012 3:58 PM

Hi

In BB CE8 I was able to incorporate a small bit of Javascript into a quiz question text to provide a hint button which would pop up:

<script type="text/javascript">
function show_alert(){alert("This is the hint text");}
</script>
<p>This is the question</p>
<input onclick="show_alert()" type="button" value="Show hint" />

We're moving to BB9.1, and while I can access the html editor, and the button works in preview, when I submit, it puts this code in a <div class="vtbegenerated">...</div> rendering it useless.

Is there a way to avoid this, or any other suggestions for including a link to a hint page/pop-up would be much appreciated. I've looked at including a weblink to a new page, but it's not as neat as the JS original, above.

Thanks,

Michael

All Replies

Top 10 Contributor
Male
6,271 Posts

Michael,

An alternative to the javascript pop-up would be to embed a "hint button" as part of an HTML form in the question with your hint text as the 'title" (aka tooltip) for the button, something like:

<form>
<input type="button" value="Hint" title="This is the hint text.">
</form>


It's actually only necessary to mouse over the button to get the text to pop up, but they will be naturally inclined to click on it.

Mike

Not Ranked
2 Posts

Hi Mike,

Thanks for the code, which is neater. But the main problem still remains - BB strips out the code so it doesn't actually manifest in the question when the students do it.

I'll check locally to see if it is a local setting that can be amended.

Thanks again,

Michael

Top 10 Contributor
Male
6,271 Posts

Hi Michael,

Interesting, I got different results depending on whether I tried the form code on my production server (which has the old text editor) or my Service Pack 8 test server, which has a newer text editor for testing purposes. 

The old text editor does indeed strip out the form code.  However, you can do the same thing with "title" on an embedded image, and it doesn't seem to strip that code out.  So, you could make a "help button" jpeg, post it in some publicly accessible place, and do something like

<img src="[image URL]" title="This is the help text">

Not quite as simple and elegant as the form code, but you might see if that works on your server.

Mike

Page 1 of 1 (4 items) | RSS