function qformat_blackboard_6::process_responses in Quiz 6.6
Same name and namespace in other branches
- 6.5 includes/moodle/question/format/blackboard_6/format.php \qformat_blackboard_6::process_responses()
1 call to qformat_blackboard_6::process_responses()
- 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 487
Class
- qformat_blackboard_6
Code
function process_responses($bb_responses, &$responses) {
foreach ($bb_responses as $bb_response) {
$response = null;
if (isset($bb_response['@']['title'])) {
$response->title = $bb_response['@']['title'];
}
else {
$reponse->title = $bb_response['#']['displayfeedback'][0]['@']['linkrefid'];
}
$reponse->ident = array();
if (isset($bb_response['#']['conditionvar'][0]['#'])) {
$response->ident[0] = $bb_response['#']['conditionvar'][0]['#'];
}
else {
if (isset($bb_response['#']['conditionvar'][0]['#']['other'][0]['#'])) {
$response->ident[0] = $bb_response['#']['conditionvar'][0]['#']['other'][0]['#'];
}
}
if (isset($bb_response['#']['conditionvar'][0]['#']['and'])) {
$responseset = $bb_response['#']['conditionvar'][0]['#']['and'];
foreach ($responseset as $rs) {
$response->ident[] = $rs['#'];
if (!isset($response->feedback) and isset($rs['@'])) {
$response->feedback = $rs['@']['respident'];
}
}
}
else {
$response->feedback = $bb_response['#']['displayfeedback'][0]['@']['linkrefid'];
}
if (isset($bb_response['#']['setvar'])) {
switch ($bb_response['#']['setvar'][0]['#']) {
case "SCORE.max":
$response->fraction = 1;
break;
default:
$response->fraction = 0;
break;
}
}
else {
$response->fraction = 0;
}
$responses[] = $response;
}
}