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

Plus d'informations
il y a 8 ans 6 mois - il y a 8 ans 6 mois #4938 par annem
Restart button in the Gap Fill page type a été créé par 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
Dernière édition: il y a 8 ans 6 mois par annem.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 8 ans 6 mois #4948 par Fay
Réponse de Fay sur le sujet 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(); });
Les utilisateur(s) suivant ont remercié: annem

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 8 ans 6 mois #4950 par annem
Réponse de annem sur le sujet 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

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 8 ans 6 mois - il y a 8 ans 6 mois #4952 par Fay
Réponse de Fay sur le sujet 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
Dernière édition: il y a 8 ans 6 mois par Fay.

Connexion ou Créer un compte pour participer à la conversation.

Modérateurs: ingdon
Temps de génération de la page : 0.142 secondes
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo