You are here

function qformat_blackboard_6::process_choices in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/question/format/blackboard_6/format.php \qformat_blackboard_6::process_choices()
1 call to qformat_blackboard_6::process_choices()
qformat_blackboard_6::create_raw_question in includes/moodle/question/format/blackboard_6/format.php

File

includes/moodle/question/format/blackboard_6/format.php, line 444

Class

qformat_blackboard_6

Code

function process_choices($bb_choices, &$choices) {
  foreach ($bb_choices as $choice) {
    if (isset($choice['@']['ident'])) {
      $cur_choice = $choice['@']['ident'];
    }
    else {

      //for multiple answer
      $cur_choice = $choice['#']['response_label'][0];

      //['@']['ident'];
    }
    if (isset($choice['#']['flow_mat'][0])) {

      //for multiple answer
      $cur_block = $choice['#']['flow_mat'][0];

      // Reset $cur_choice to NULL because process_block is expecting an object
      // for the second argument and not a string, which is what is was set as
      // originally - CT 8/7/06
      $cur_choice = null;
      $this
        ->process_block($cur_block, $cur_choice);
    }
    elseif (isset($choice['#']['response_label'])) {

      // Reset $cur_choice to NULL because process_block is expecting an object
      // for the second argument and not a string, which is what is was set as
      // originally - CT 8/7/06
      $cur_choice = null;
      $this
        ->process_block($choice, $cur_choice);
    }
    $choices[] = $cur_choice;
  }
}