jQuizzy 是一款輕量級的 jQuery 答題插件,支援自定義題目、計分與結果評語。若需在滿分或分數大於 90 時自動跳轉至註冊頁,可在 judgeSkills 函數中加入跳轉邏輯。
function judgeSkills(score) {
if (score === 100) {
location.href = "register.html?score=100"; // 跳轉註冊頁
return config.resultComments.perfect;
} else if (score > 90) {
location.href = "register.html?score=" + score; // 高分同樣跳轉
return config.resultComments.excellent;
}
// ... 其餘分數區間保持原樣
}
建議在跳轉前先將分數通過 URL 參數傳遞,註冊頁可據此顯示專屬優惠或紀錄成績。
resultComments 文字。judgeSkills(score)。location.href 跳轉。此法無需修改插件核心代碼,僅擴展評分邏輯,維護成本極低。