File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ <h5 id="{{ qindex }}question_text" class="card-title mb-2">
150150
151151
152152
153- < button class ="btn btn-primary " onclick ="{{q.type}}_getfeedback(this); enableNextButton(this); scrollToFeedback() "> Check
153+ < button class ="btn btn-primary checkanswer " onclick ="{{q.type}}_getfeedback(this); enableNextButton(this); scrollToFeedback() " disabled > Check
154154 Answer</ button >
155155 <!-- TODO: Disable this, and then re-enable -->
156156 < button class ="btn btn-primary next " disabled > Next Question</ button >
@@ -258,6 +258,18 @@ <h4 class="card-title">What Next?</h4>
258258 $ ( '#done' ) . show ( ) ;
259259 }
260260 } ) ;
261+
262+ // Disable all "Check Answer" buttons initially
263+ $ ( '.checkanswer' ) . prop ( 'disabled' , true ) ;
264+
265+ // Add event listeners to radio buttons
266+ $ ( 'input[type="radio"]' ) . on ( 'change' , function ( ) {
267+ // Find the parent question card
268+ const questionCard = $ ( this ) . closest ( '.question' ) ;
269+
270+ // Enable the "Check Answer" button within the same question card
271+ questionCard . find ( '.checkanswer' ) . prop ( 'disabled' , false ) ;
272+ } ) ;
261273 } ) ;
262274 </ script >
263275
You can’t perform that action at this time.
0 commit comments