File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -186,12 +186,12 @@ function render_directory($dirdetails) {
186186 </div>
187187 <h2 id="stackapi_score" style="display: none">Score: <span id="score"></span></h2>
188188 <div id="stackapi_summary" class="col-lg-10" style="display: none">
189- <h2><?php echo stack_string ( ' api_response ' ) ?> :</h2>
189+ <h2>Response summary :</h2>
190190 <div id="response_summary" class="feedback outcome"></div>
191191 </div>
192192 <div id="stackapi_correct" class="col-lg-10" style="display: none">
193+ <h2>Correct response:</h2>
193194 <div class="noninfo">
194- <h2>Response summary:</h2>
195195 <div id="formatcorrectresponse" class="feedback outcome"></div>
196196 </div>
197197 </div>
Original file line number Diff line number Diff line change 111111 if ( possible !== null ) {
112112 return possible ;
113113 }
114+ possible = iter . querySelector ( 'textarea[id$="_' + name + '"]' ) ;
115+ if ( possible !== null ) {
116+ return possible ;
117+ }
114118 // Radios have interesting ids, but the name makes sense
115119 possible = iter . querySelector ( 'input[id$="_' + name + '_1"][type=radio]' ) ;
116120 if ( possible !== null ) {
274278 switch ( msg . type ) {
275279 case 'register-input-listener' :
276280 // 1. Find the input.
277- input = vle_get_input_element ( msg . name , msg . src ) ;
281+ input = vle_get_input_element ( msg . name , msg . src , ! msg [ 'limit-to-question' ] ) ;
278282
279283 if ( input === null ) {
280284 // Requested something that is not available.
296300 response . value = input . value ;
297301 response [ 'input-type' ] = 'select' ;
298302 response [ 'input-readonly' ] = input . hasAttribute ( 'disabled' ) ;
303+ } else if ( input . nodeName . toLowerCase ( ) === 'textarea' ) {
304+ response . value = input . value ;
305+ if ( input . dataset . stackInputType === 'freetext' ) {
306+ response [ 'input-type' ] = 'freetext' ;
307+ } else {
308+ response [ 'input-type' ] = 'textarea' ;
309+ }
310+ response [ 'input-readonly' ] = input . hasAttribute ( 'disabled' ) ;
299311 } else if ( input . type === 'checkbox' ) {
300312 response . value = input . checked ;
301313 response [ 'input-type' ] = 'checkbox' ;
You can’t perform that action at this time.
0 commit comments