|
|
|
@ -245,52 +245,6 @@ class CourseController extends ToolBaseController |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Get session-career diagram |
|
|
|
|
$diagram = ''; |
|
|
|
|
/*$allow = api_get_configuration_value('allow_career_diagram'); |
|
|
|
|
if (true === $allow) { |
|
|
|
|
$htmlHeadXtra[] = api_get_js('jsplumb2.js'); |
|
|
|
|
$extra = new ExtraFieldValue('session'); |
|
|
|
|
$value = $extra->get_values_by_handler_and_field_variable( |
|
|
|
|
api_get_session_id(), |
|
|
|
|
'external_career_id' |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (!empty($value) && isset($value['value'])) { |
|
|
|
|
$careerId = $value['value']; |
|
|
|
|
$extraFieldValue = new ExtraFieldValue('career'); |
|
|
|
|
$item = $extraFieldValue->get_item_id_from_field_variable_and_field_value( |
|
|
|
|
'external_career_id', |
|
|
|
|
$careerId, |
|
|
|
|
false, |
|
|
|
|
false, |
|
|
|
|
false |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (!empty($item) && isset($item['item_id'])) { |
|
|
|
|
$careerId = $item['item_id']; |
|
|
|
|
$career = new Career(); |
|
|
|
|
$careerInfo = $career->get($careerId); |
|
|
|
|
if (!empty($careerInfo)) { |
|
|
|
|
$extraFieldValue = new ExtraFieldValue('career'); |
|
|
|
|
$item = $extraFieldValue->get_values_by_handler_and_field_variable( |
|
|
|
|
$careerId, |
|
|
|
|
'career_diagram', |
|
|
|
|
false, |
|
|
|
|
false, |
|
|
|
|
0 |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (!empty($item) && isset($item['value']) && !empty($item['value'])) { |
|
|
|
|
// @var Graph $graph |
|
|
|
|
$graph = UnserializeApi::unserialize('career', $item['value']); |
|
|
|
|
$diagram = Career::renderDiagram($careerInfo, $graph); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
// Deleting the objects |
|
|
|
|
$session->remove('toolgroup'); |
|
|
|
|
$session->remove('_gid'); |
|
|
|
@ -306,10 +260,14 @@ class CourseController extends ToolBaseController |
|
|
|
|
$shortcuts = $shortcutQuery->getQuery()->getResult(); |
|
|
|
|
} |
|
|
|
|
$responseData = [ |
|
|
|
|
'course' => $course, |
|
|
|
|
'course' => [ |
|
|
|
|
'id' => $course->getId(), |
|
|
|
|
'title' => $course->getTitle(), |
|
|
|
|
'resourceNode' => $course->getResourceNode(), |
|
|
|
|
], |
|
|
|
|
'session' => $courseSession, |
|
|
|
|
'shortcuts' => $shortcuts, |
|
|
|
|
'diagram' => $diagram, |
|
|
|
|
'diagram' => '', |
|
|
|
|
'tools' => $tools, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|