Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer Navigation Button/Event manager

    Evening everyone,

    I'm building a browser based multiple choice based test - what I want is for the questions in the test to be randomized on load- what I also want is that, if they have not selected an answer for a question, they cannot navigate to the next question.

    I can get the questions to shuffle without the navigation prevention and I can do the navigation prevention to work perfectly, but only if shuffling is disabled or if the question happens to be in same order as it is in the array. The function does work with shuffling, but only if by mere chance, the order in which the questions were shuffled is identical to the order of the questions in the array.

    Code:
    var CurrQNum = 0;
    function ChangeQ(ChangeBy){
    	if ((State[CurrQNum][0] == -1)){ShowMessage('You have not selected an answer yet!'); return;}
    	if (((CurrQNum + ChangeBy) < 0)||((CurrQNum + ChangeBy) >= QArray.length)){return;}
    	QArray[CurrQNum].style.display = 'none';
    	CurrQNum += ChangeBy;
    	QArray[CurrQNum].style.display = '';
    	ShowSpecialReadingForQuestion();
    	SetQNumReadout();
    	SetFocusToTextbox();
    }
    Code:
    var I=new Array();
    I[0]=new Array();I[0][0]=100;
    I[0][1]='';
    I[0][2]='0';
    I[0][3]=new Array();
    I[0][3][0]=new Array('Best Answer','Click OK, then "Next Question."',1,100,1);
    I[1]=new Array();I[1][0]=100;
    cI[0][3][1]=new Array('Worst Answer','Try again!',0,0,1);
    I[1][1]='';
    I[1][2]='0';
    I[1][3]=new Array();
    I[1][3][0]=new Array('Best Answer','Click OK, then "Next Question."',1,100,1);
    I[1][3][1]=new Array('Worst Answer','Click OK, then "Next Question."',0,0,1);
    Code:
    <p style="text-align: Center;">
    <input id="NextQButton" name="button" type="submit" value="Next Question" onclick="ChangeQ(1)">
    </p>
    Attached is the full exercise. The original authors of the code commented out the navigation handler... I wonder if they had issues as well.

    I would really appreciate anyone's advice or help. Thank you in advance,
    Spence.

    Evening everyone,

    Posted this originally in the wrong forum I think, but here is a copy.
    I'm building a browser based multiple choice based test - what I want is for the questions in the test to be randomized on load- what I also want is that, if they have not selected an answer for a question, they cannot navigate to the next question.

    I can get the questions to shuffle without the navigation prevention and I can do the navigation prevention to work perfectly, but only if shuffling is disabled or if the question happens to be in same order as it is in the array. The function does work with shuffling, but only if by mere chance, the order in which the questions were shuffled is identical to the order of the questions in the array.

    Code:
    var CurrQNum = 0;
    function ChangeQ(ChangeBy){
    	if ((State[CurrQNum][0] == -1)){ShowMessage('You have not selected an answer yet!'); return;}
    	if (((CurrQNum + ChangeBy) < 0)||((CurrQNum + ChangeBy) >= QArray.length)){return;}
    	QArray[CurrQNum].style.display = 'none';
    	CurrQNum += ChangeBy;
    	QArray[CurrQNum].style.display = '';
    	ShowSpecialReadingForQuestion();
    	SetQNumReadout();
    	SetFocusToTextbox();
    }
    Code:
    var I=new Array();
    I[0]=new Array();I[0][0]=100;
    I[0][1]='';
    I[0][2]='0';
    I[0][3]=new Array();
    I[0][3][0]=new Array('Best Answer','Click OK, then "Next Question."',1,100,1);
    I[1]=new Array();I[1][0]=100;
    cI[0][3][1]=new Array('Worst Answer','Try again!',0,0,1);
    I[1][1]='';
    I[1][2]='0';
    I[1][3]=new Array();
    I[1][3][0]=new Array('Best Answer','Click OK, then "Next Question."',1,100,1);
    I[1][3][1]=new Array('Worst Answer','Click OK, then "Next Question."',0,0,1);
    Code:
    <p style="text-align: Center;">
    <input id="NextQButton" name="button" type="submit" value="Next Question" onclick="ChangeQ(1)">
    </p>
    Attached is the full exercise. The original authors of the code commented out the navigation handler... I wonder if they had issues as well.

    I would really appreciate anyone's advice or help. Thank you in advance,
    Spence.
    Attached Files Attached Files
    Last edited by VIPStephan; 12-07-2012 at 06:33 PM.

  • #2
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    http://hotpot.uvic.ca/howto/hacking_.../task_08_2.htm

    These authors described implementing the navigation prevention, but explicitly said it will not work with shuffling.

    Does anyone have a solution?
    Last edited by Spency; 12-07-2012 at 05:13 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •