Hidden Question - Forced Answer

dunnjo98 Community Member Posts: 25
Ok, so this is a tricky one I am working on.

I have a course I built with a 12-question quiz and then I have a survey question and the only way you can see it, is if you are on mobile.  That seems great and fine, except that my LMS is not reporting the actual responses, so the question answer is not important, but because the LMS also doesn't have mobile tracking, we are using the attempts on this question as the tracker to see who is taking the course on mobile.  So being as the question is not important, what I was hoping to do was force a response based on the variable set to detect the mobile browser and then the user wouldn't have to answer the question.


Can I force a variable to force an answer in a multiple choice question?  Learner never sees the question.




  • clammers
    clammers Community Member Posts: 133 ♪ Opening Act ♪
    You should be able to have a multiple choice question like "Are you viewing this course on a mobile device" with Yes and No as your selections. Add an action to the question text - On: Show, Action: Modify Variable, Target: (Question #), Type: Set Equal To, Value: Yes.
  • klaatu
    klaatu Community Member Posts: 986 ☆ Roadie ☆
    The attached uses a script from http://detectmobilebrowsers.com/ and will automatically, on load of the page, detect if a mobile (not tablet) is being used. You can alter the script to include tablets as well.

    see https://stackoverflow.com/questions/11381673/detecting-a-mobile-browser) if you need that script.

    I added a Lectora variable browtype (browserType is a Lectora reserved variable and fairly useless imo) and populate it with "true" for mobile, "false" for anything else. Seems to work well in my tests.
  • dunnjo98
    dunnjo98 Community Member Posts: 25
    Wow, thanks to both of you.


    I did have the code to detect the browser, the problem I was having was that the LMS doesn't have a catch all variable, even in SCORM2004.  So, I hid some unweighted questions in the quiz and based on the mobile browser detection, it would force a true answer.  I can actually track questions in the reports, so that was my only way to be able to record if the user was using a mobile device.  At this point.  I needed something in a hurry.

    My next test will be, what if the course doesn't already have a quiz?
  • clammers
    clammers Community Member Posts: 133 ♪ Opening Act ♪
    Are you just looking to track who views your courses on a mobile device? What about adding a one-question survey to achieve this? You could probably hide a survey in the course (at least, not bring it to the users' attention that it's a survey) and using the CurrentView variable to submit a one-question survey result: if CurrentView is not Desktop, Modify Variable - Survey Question [Is the user viewing this on a mobile device?] to Yes.
  • jvalley4735
    jvalley4735 Community Member Posts: 1,310 ♪ Opening Act ♪
    You could also just use a form element to collect the information.  They come with preset variables which won't be confused with a question variable.
  • dunnjo98
    dunnjo98 Community Member Posts: 25
    @clammers, I tried the survey, I even had it forcing the answer, but there was this show the page issue.  The 2 questions within the test is actually forming the best solution because I check the device twice.  Did they start on mobile, did the end on mobile.

    @jvalley4735, I have not explored the form element.  I can look into that.  the problem I am having and tracking the variables in the LMS.  I can see the questions, but when I try any other element I can't seem to get them to report.

    I'm using Cornerstone by the way.

    The solution I have, albeit rushed and not perfect, is providing the feedback we wanted so far.