0 votes

So I want to have a question but want to display text under the question, but display it only
after 5 minutes have passed. It's for a digital escape room game, where my students are supposed to think about the answer before receiving a hint.
The way it is now, anything under the question will not be displayed until an answer is submitted.
I don't quite get how you can use maintain to do what I'd like to do.
I could use
wait after the question, but not before the question, because then the question won't be displayed.
Any ideas?

Here's my code (I don't get why when I paste the code from my program, the indentations don't show):

*label: question1

>>answer = "wrong"
*while: answer = "wrong"

*question: What's the answer to everything?
	*type: number
	42
		>>answer = "correct"
		*goto: question2
	*other
		That's not yet correct.
		*goto: question1

*wait: 5.minutes
Here's a tip. It's an answer from Mr. Adams.

by (270 points)

2 Answers

+1 vote
Best answer

Try this:

*label: question1

*html
	<style>
		#countdown {
			display: none;
		}
	</style>
	
*question: What's the answer to everything?
	*countdown: 10.seconds
	*type: number
	42
		>>answer = "correct"
	*other
		That's not yet correct.
		*goto: question1

*if: not answer
	*label: question2
	*question: What's the answer to everything?
		*tip: Here's a tip. It's an answer from Mr. Adams.
		*type: number
		42
			>>answer = "correct"
		*other
			That's not yet correct.
			*goto: question2

The *html keyword isn't strictly necessary, it's just there to hide the countdown timer. You can adjust how long to wait before displaying the tip by changing the duration of *countdown.

by (690 points)
selected by

Oh yes! That looks amazing. Seems to do the trick I reckon. Let me try and implement this!
Thank you so much!

So it does work for sure, is there a way though to not put the countdown in, once the tip has been revealed? Otherwise the page loads again every time the countdown ends.
I guess I could just copy the question once with the timer and once without the timer and once the variable tip has been modified, only show the question without the countdown.
Is that the best way to modify this?

Yes, I think that's the best approach. I edited my answer to reflect these changes.

If the approach above works, could I ask you to accept the answer? That way others will see it first when they look up your question.

Yes will do!
I applied that and it works fine now!
Thank you very much!

0 votes

Could you do something like this?

>>answer = "wrong"

What is the answer to everything?
*wait: 2.seconds


*while: answer = "wrong"
	*question: Here's a tip: It's an answer from Mr. Adams
		*type: number
		42
			>>answer = "correct"
			*goto: question2
		*other
			That's not yet correct.

This is the best I could come up with without executing arbitrary javascript. If you have control over the website that this is being embedded in, you can style a component with some class and then in javascript you can do something like this:

function initialSetup() {
  if (document.getElementById("show_tip") != null) {
    setTimeout(function() {
      document.getElementById('show_tip').style.display = 'block';
    }, 2000);
  }
}

initialSetup();

And then in the CSS

.show_tip {
  display: none;
}
		
by (280 points)

Thank you for the answer,
I don't know javascript and don't use my own website though.
My students are supposed to access the program through the guidedtrack website directly.

Did you see the other, non-javascript answer, though? Does that work for you?

Yes, thank you. However, doesn't that solution mean that the question itself will only pop up after the specified time, not just the hint? Or am I missing something?

You're correct. It's just a hack -- you put the hint as the question title and force the students to read the actual question text for a certain amount of time before they're allowed to enter anything. I couldn't find another way of triggering the tip text after a specific amount of time.

Ok, that's not too bad. However, I think my students might be confused by not being able to answer right away. Not all of them are too bright, if you don't mind me saying and they scare easily, especially when it comes to online stuff. They don't read anything, just put their hands up and say: "Wait, what? I can't even.... I don't get it". And then I have to pick up the scraps. :-) Sorry, that's just my teaching from home burnout talking.

Welcome to Guidedtrack Q&A, where you can ask questions and receive answers from other members of the community.
104 questions
112 answers
50 comments
168 users