File tree Expand file tree Collapse file tree
bases/rsptx/web2py_server/applications/runestone Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -856,12 +856,6 @@ function insertReadyVote2Button() {
856856
857857 if ( ! container ) return ;
858858
859- const btn = document . createElement ( "button" ) ;
860- btn . id = "readyVote2Btn" ;
861- btn . className = "btn btn-warning" ;
862- btn . style . display = "none" ;
863- btn . style . marginTop = "10px" ;
864- btn . textContent = "I'm ready to vote again" ;
865859
866860 btn . addEventListener ( "click" , enableSecondVoteAsync ) ;
867861
Original file line number Diff line number Diff line change 1414 eBookConfig . isLoggedIn = true ;
1515</ script >
1616
17- <!-- <script>
18- window.eBookConfig = window.eBookConfig || {};
19- eBookConfig.course = "{{=course_id}}";
20- eBookConfig.basecourse = "{{=course.base_course}}";
21- eBookConfig.host = window.location.origin;
22- eBookConfig.isLoggedIn = true;
23- </script> -->
24- <!--
25- {{ if has_vote1: }}
26- <p><em>Vote 1 detected</em></p>
27- {{ else: }}
28- <p><em>No vote yet</em></p>
29- {{ pass }} -->
3017< div id ="peer_async_root " data-div_id ="{{=current_question.name}} ">
3118</ div >
3219
3926 eBookConfig . peer = true ;
4027 eBookConfig . peerMode = "async" ;
4128</ script >
42- <!-- <script>window.PI_LLM_MODE = false;</script> -->
4329
4430
4531< div class ="hidden-content " style ="display: none ">
@@ -224,6 +210,25 @@ <h3>Congratulations, you have completed this assignment!</h3>
224210</ script >
225211
226212< script >
213+ async function fetchWithRetry ( url , options , retries = 1 , delayMs = 400 ) {
214+ let lastError ;
215+ for ( let attempt = 0 ; attempt <= retries ; attempt ++ ) {
216+ try {
217+ const resp = await fetch ( url , options ) ;
218+ if ( resp . ok ) {
219+ return resp ;
220+ }
221+ lastError = new Error ( `HTTP ${ resp . status } ` ) ;
222+ } catch ( err ) {
223+ lastError = err ;
224+ }
225+ if ( attempt < retries ) {
226+ await new Promise ( resolve => setTimeout ( resolve , delayMs ) ) ;
227+ }
228+ }
229+ throw lastError ;
230+ }
231+
227232( function ( ) {
228233 const btn = document . getElementById ( "submitReflection" ) ;
229234 const ta = document . getElementById ( "messageText" ) ;
You can’t perform that action at this time.
0 commit comments