[system] / trunk / wwmoodle / wwquestion / questiontype.php Repository:
ViewVC logotype

Diff of /trunk/wwmoodle/wwquestion/questiontype.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 5175 Revision 5176
201 $result = get_record('question_webwork_derived','id',$derivedid); 201 $result = get_record('question_webwork_derived','id',$derivedid);
202 $unparsedhtml = base64_decode($result->html); 202 $unparsedhtml = base64_decode($result->html);
203 203
204 //new array keyed by field 204 //new array keyed by field
205 $fieldhash = $state->responses['answers']; 205 $fieldhash = $state->responses['answers'];
206 $answerfields = $fieldhash; 206 $answerfields = array();
207 207
208 $parser = new HtmlParser($unparsedhtml); 208 $parser = new HtmlParser($unparsedhtml);
209 $currentselect = ""; 209 $currentselect = "";
210 while($parser->parse()) { 210 while($parser->parse()) {
211 //change some attributes of html tags for moodle compliance 211 //change some attributes of html tags for moodle compliance
215 //handle generic change of node's attribute name 215 //handle generic change of node's attribute name
216 if(($nodename == "INPUT") || ($nodename == "SELECT") || ($nodename == "TEXTAREA")) { 216 if(($nodename == "INPUT") || ($nodename == "SELECT") || ($nodename == "TEXTAREA")) {
217 $parser->iNodeAttributes['name'] = 'resp' . $question->id . '_' . $name; 217 $parser->iNodeAttributes['name'] = 'resp' . $question->id . '_' . $name;
218 if(($state->event == QUESTION_EVENTGRADE) && (isset($fieldhash[$name]))) { 218 if(($state->event == QUESTION_EVENTGRADE) && (isset($fieldhash[$name]))) {
219 $parser->iNodeAttributes['class'] = $parser->iNodeAttributes['class'] . question_get_feedback_class($fieldhash[$name]['score']); 219 $parser->iNodeAttributes['class'] = $parser->iNodeAttributes['class'] . question_get_feedback_class($fieldhash[$name]['score']);
220 }
221 if(!strstr($name,'previous')) {
222 $answerfields[$name] = $fieldhash[$name];
220 } 223 }
221 } 224 }
222 //handle specific change 225 //handle specific change
223 if($nodename == "INPUT") { 226 if($nodename == "INPUT") {
224 //put submitted value into field 227 //put submitted value into field
251 //get code 254 //get code
252 //echo "GRADE"; 255 //echo "GRADE";
253 //var_dump($state); 256 //var_dump($state);
254 $code = base64_encode($question->code); 257 $code = base64_encode($question->code);
255 $seed = $state->responses['seed']; 258 $seed = $state->responses['seed'];
256 echo $seed;
257 //get answers 259 //get answers
258 $answerarray = array(); 260 $answerarray = array();
259 foreach($state->responses as $key => $value) { 261 foreach($state->responses as $key => $value) {
260 array_push($answerarray, array('field' => $key, 'answer'=> $value)); 262 array_push($answerarray, array('field' => $key, 'answer'=> $value));
261 } 263 }

Legend:
Removed from v.5175  
changed lines
  Added in v.5176

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9