This is the place for questions about learning design and pedagogy; how to use different page types for different purposes.

Restart button in the Gap Fill page type

  • annem
  • Onderwerp Auteur
  • Offline
  • Elite lid
  • Elite lid
Meer
8 jaren 6 maanden geleden - 8 jaren 6 maanden geleden #4938 door annem
Hi All,
Hopefully you can help me.

I have been asked if it is possible to add a 'Restart' button (like the Retart button in the Decision Tree page type) in the 'Gap Fill' page type?

Can a code be written in the script?

I look forward to hearing from you.
Anne
Laatst bewerkt 8 jaren 6 maanden geleden door annem.

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
8 jaren 6 maanden geleden #4948 door Fay
Beantwoord door Fay in topic Restart button in the Gap Fill page type
Hi Anne

You'd have to add a script to add a restart button and then have some code that restarts the activity when it's clicked.

This works on the version I'm running but may need some changes for your install (the gap fill page has slightly changed recently to fix some bugs):
Code:
$("#mainPanel").append('<button id="restartBtn">Restart</button>'); $("#restartBtn").button().click(function() { // change the variables storing when the activity is complete etc. currvalue = undefined; correct_answers = 0; total = 0; labelAnswers = {}; $("#pageContents").data({ "score": 0, "attempts": 0 }); // then reset what's on screen $("#targetHolder input") .val('') .attr("readonly", false) .addClass("incorrect"); $("#pageContents").find("#hint").remove(); $("#feedbackTxt").hide(); });
De volgende gebruiker (s) zei dank u: annem

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • annem
  • Onderwerp Auteur
  • Offline
  • Elite lid
  • Elite lid
Meer
8 jaren 6 maanden geleden #4950 door annem
Beantwoord door annem in topic Restart button in the Gap Fill page type
Hi Fay,
Thank you for the code.

I guess that if I add this code or suggest to the academic that they add the code, when the new Xerte version install takes place, there could be a problem with the customisation of that page type? Will the upgrade version overwrite it?

Best wishes
Anne

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
8 jaren 6 maanden geleden - 8 jaren 6 maanden geleden #4952 door Fay
Beantwoord door Fay in topic Restart button in the Gap Fill page type
If you add the code to the script field in the projects the academic is working on then it will work after upgrade & won't be overwritten. It's possible in the future that something more fundamental in the page could be changed that would stop the code from working (this applies to any css or scripts that are written in individual projects too). We try to avoid renaming elements though so you should be ok.

I hope this helps
Fay
Laatst bewerkt 8 jaren 6 maanden geleden door Fay.

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Moderators: ingdon
Tijd voor maken pagina: 0.150 seconden
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo