Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Disabling Back Button?

Hi,

My competitive theatre class in high school has the students write up their own final exams for their classmates to take, and the best one is actually chosen to be the final. I thought "Hey, why don't I turn it into a text adventure game", and here I am.

So, my question is, how can I disable the back button functionality in Twine 2.0 so that students are unable to cheat and add to their score?

Comments

  • If you're using Harlowe, the default story formatter in Twine 2.0, you might consider just adding this to Edit Story Stylesheet.
    tw-sidebar {
    display: none;
    }
    But I do have a question about your target audience: Twine as a final exam sounds AWESOME. But have any of them seen Twine before? Are any of them familiar enough with front-end web development or theming--even something like Tumblr--to know their way around a browser's web inspector tool or 'View Source'? I ask because it occurs to me that many of the experienced Twine folks here would have no trouble picking out the correct answers from the source code of your HTML file.


  • That may not be an issue if the exam was designed so that you got no feedback while playing as to which answer was correct (like a typical multiple choice exam).

    Perhaps after every answer, it updated a variable, then you used a print function to display a list of all the game's variables at exam complete to provide an easy summary of the given answers.

    To do this I strongly suggest using SugarCube since it has a "Save to file" function that students could save to at the end, and then send you their answers. If using SugarCube, to disable the back button you put this in your Javascript area:

    config.disableHistoryControls = true;
  • Oh, that's good thinking, Claretta. I was focused on "how should they make it TOTALLY SELF-CONTAINED?" as the problem to solve. :)

    Seconding SugarCube.
  • Thank you for this! I also wanted to disable the back button.
  • edited February 2016
    Hey there. Sorry to revive an old thread but I just made this account to warn anyone that stumbles across this (maybe over a Google search, like I did) that @Claretta's code is for Sugarcube 1.x.

    2.x users will instead need to use the following code:
    config.history.controls = false;
    
Sign In or Register to comment.