Index: temp_moodle_dev/moodle/mod/choice/lib.php =================================================================== RCS file: /usr/local/cvsroot/temp_moodle_dev/moodle/mod/choice/lib.php,v diff -u -r1.6 -r1.7 --- temp_moodle_dev/moodle/mod/choice/lib.php 17 Dec 2008 23:41:13 -0000 1.6 +++ temp_moodle_dev/moodle/mod/choice/lib.php 12 Jan 2009 05:43:02 -0000 1.7 @@ -881,18 +881,23 @@ * LAMS Function * Return a statistic for a given user in this Moodle choice for use in branching */ -function choice_get_tool_output($id, $userid,$optionid) { +function choice_get_tool_output($id, $userid,$orderID) { $cm = get_record('course_modules', 'id', $id); if ($cm) { $choice=get_record('choice', 'id', $cm->instance); if ($choice) { - $option = get_record('choice_answers', 'choiceid', $choice->id, 'userid', $userid); - - if($option->optionid==$optionid){ - + $useroption = get_record('choice_answers', 'choiceid', $choice->id, 'userid', $userid); + $options = get_records('choice_options', 'choiceid', $choice->id); + $i=1; + foreach ($options as $option) { + $num=$option->id; + $orderoptions[$num]=$i; + $i++; + } + $num=$useroption->optionid; + if($orderID==$orderoptions[$num]){ return true; }else{ - return false; } } @@ -914,12 +919,12 @@ header('Content-Type: text/plain'); echo(""); - echo(''); + echo(''); + $i=1; foreach ($options as $option) { $text=mb_ereg_replace('#', '_', $option->text); - //addslashes( - echo(''); - + echo(''); + $i++; } echo(''); }