[LON-CAPA-users] "slider" as a question type?

Sally S Hunnicutt sshunnic at vcu.edu
Fri Jun 28 12:06:15 EDT 2019


Follow up to my previous question.

Using the coding below, I can get a slider to appear in my problem.
However, the script is not type="loncapa". I would like to be able to get
the slider bar response and save it in a variable that I can use elsewhere
in the problem. Also, I would like to be able to store the students'
confidence levels for research reasons.

Thanks,
Sally

Code:
<part id="p3">

<p>How confident are you that your answer is correct? Move the slider bar
to the right to indicate high confidence (100) and to the left to indicate
low confidence (1).</p>
<input type="range" min="1" max="100" value="50" id="myRange"></input>
<p>Your confidence is <span id="x"></span></p>


<script>
var slider = document.getElementById("myRange");
var output = document.getElementById("x");
output.innerHTML = slider.value;

slider.oninput = function() {
  output.innerHTML = this.value;
}
</script>

On Tue, Jun 18, 2019 at 2:32 PM Sally S Hunnicutt <sshunnic at vcu.edu> wrote:

> Hello,
>
> Has anyone developed a slider question as a type of question? For example,
> I would like to ask students to give their confidence, using a slider bar,
> that the question they have answered is the correct answer.
>
> Thanks,
> Sally Hunnicutt
> VCU
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20190628/ea2b667d/attachment.html>


More information about the LON-CAPA-users mailing list