javascript: get page to go full full screen

Joined
12 Feb 2006
Posts
17,643
Location
Surrey
i have a website im making for college which is a test for whatever i choose. I have the tutorial all working but wondering now if it's possible to get it so when the user starts the test the screen goes full screen, i mean like over take everything leaving nothing but the page they are on and the minimise and exit button at the top right?

i have googled but found nothing. Reason i want this is because i want it so the user can't cheat and look at the tutorial at the same time as taking the test.

thanks
 
also while got this thread open...

i have radio buttons for each possible anwser which names is called radioAnswer. how would i get it so javascript checks if a radio button is selected for radioAnswer?
 
I'd advise against doing this for 2 reasons, first, modern browsers like IE7 (and 6 with updates IIRC) and FF2 will stop any javascript executing which attempts to make the browser full screen.

And secondly...
Mammalian said:
Reason i want this is because i want it so the user can't cheat and look at the tutorial at the same time as taking the test.
... because there's nothing to stop the user simply pressing F11 to come out of fullscreen mode.

TBH there is very little that can be done, from a web technology perspective, to stop someone having two windows open side by side and copying from one to the other.
 
dang ok then. well what about the second problem, getting js to check if any radio button is selected, i have thoughts about ways around it but im sure there is a simple, if anyradioname=checked then blah blah.
 
it depends whether you are clicking a radio button then a "Next Button" or just clicking a radio button. If clicking just the radio button use the "onclick" event, otherwise check the status of the radio buttons one at a time, I can't remember the exact syntax right now but a quick google search should reveal all.
 
well i do have a next button but not to the next page showing the next question, but instead it increases the question and answer and then refreshes the function which display the correct stuff.

i have googled and stuggling to find what im after, maybe my wording is bad or something.

im really hoping that there is some keyword that simply checks if the set of radio buttons is selected by using the name of the buttons as an identifier. so something like this:
Code:
if (radioAnswer == null) {
alert("answer the quesiton you spanner");
}

else {
nextQuestion();
}


somethinh along those lines but everything i try doesn't work :(
 
I think you're looking for the checked attribute - not sure if that works for radios as well as checks, but there's no harm in trying

Code:
  if (document.form.radiobutton1.checked == false) { //obviously use whatever variable you're holding the radio button to be checked in
    alert('answer the question you spanner');
  } else {
    nextQuestion();
  }
 
dang it didn't work, googled the code aswell and got a few other methods to try but none worked so i think it's to do with my wonderful code.

if think what im going to have to do instead is make it so the next button is greyed out and doesn't work until the user chooses a button which will call a function to make the next button useable again.
 
Back
Top Bottom