|
|
|
@ -28,13 +28,13 @@ class ExerciseSignaturePlugin extends Plugin |
|
|
|
|
|
|
|
|
|
|
|
public static function exerciseHasSignatureActivated(Exercise $exercise) |
|
|
|
public static function exerciseHasSignatureActivated(Exercise $exercise) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (empty($exercise->iId)) { |
|
|
|
if (empty($exercise->iid)) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ('true' === api_get_plugin_setting('exercise_signature', 'tool_enable')) { |
|
|
|
if ('true' === api_get_plugin_setting('exercise_signature', 'tool_enable')) { |
|
|
|
$extraFieldValue = new ExtraFieldValue('exercise'); |
|
|
|
$extraFieldValue = new ExtraFieldValue('exercise'); |
|
|
|
$result = $extraFieldValue->get_values_by_handler_and_field_variable($exercise->iId, 'signature_activated'); |
|
|
|
$result = $extraFieldValue->get_values_by_handler_and_field_variable($exercise->iid, 'signature_activated'); |
|
|
|
if ($result && isset($result['value']) && 1 === (int) $result['value']) { |
|
|
|
if ($result && isset($result['value']) && 1 === (int) $result['value']) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|