From 25d33e55e1f6ae09a0b7306aae7c84abae9a5245 Mon Sep 17 00:00:00 2001 From: nolmac <81175961+nolmac@users.noreply.github.com> Date: Tue, 20 Sep 2022 11:35:23 -0500 Subject: [PATCH 1/2] Fix score result when score is null --- scormcloud/scormcloudcontenthandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scormcloud/scormcloudcontenthandler.php b/scormcloud/scormcloudcontenthandler.php index cb53612..3687b04 100644 --- a/scormcloud/scormcloudcontenthandler.php +++ b/scormcloud/scormcloudcontenthandler.php @@ -110,7 +110,7 @@ public static function make_blog_entry( $content ) { $completion = (string) $registration_result->getRegistrationCompletion(); $success = (string) $registration_result->getRegistrationSuccess(); $seconds = $registration_result->getTotalSecondsTracked(); - $score = $registration_result->getScore()->getScaled(); + $score = is_null($registration_result->getScore()) ? 'unknown' : $registration_result->getScore()->getScaled(); $invite_html .= '' . '' . From 39c7399365390be29f58f6c0a5ef9511e97fd5f5 Mon Sep 17 00:00:00 2001 From: nolmac <81175961+nolmac@users.noreply.github.com> Date: Thu, 22 Sep 2022 17:16:41 -0500 Subject: [PATCH 2/2] Fixed display issue for training posts with undefined score --- scormcloud/readme.txt | 12 ++++++++++++ scormcloud/scormcloud.php | 2 +- scormcloud/scormcloudplugin.php | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/scormcloud/readme.txt b/scormcloud/readme.txt index ad1763b..e637db0 100644 --- a/scormcloud/readme.txt +++ b/scormcloud/readme.txt @@ -48,6 +48,12 @@ The SCORM Cloud For WordPress basic functionality works with BuddyPress without == Changelog == += 2.0.6 = +Fixes an issue displaying results when registration score is undefined / null + += 2.0.5 = +Fixes a bug displaying training results in posts + = 2.0.4 = * Updates 3rd party libraries * Adds dependency on SCORM Cloud v2 API client library @@ -173,6 +179,12 @@ The SCORM Cloud For WordPress basic functionality works with BuddyPress without * Original Release. == Upgrade Notice == += 2.0.6 = +Fixes an issue displaying results when registration score is undefined / null + += 2.0.5 = +Fixes a bug displaying training results in posts + = 2.0.4 = * Updates to third party libraries * Fixes bugs from missing require statements: PHP Fatal error: Uncaught Error: Class '\RusticiSoftware\Cloud\V2\Model\...' not found in .../ObjectSerializer.php:299 diff --git a/scormcloud/scormcloud.php b/scormcloud/scormcloud.php index fbd3c39..43de90b 100644 --- a/scormcloud/scormcloud.php +++ b/scormcloud/scormcloud.php @@ -4,7 +4,7 @@ Plugin URI: http://scorm.com/wordpress Description: Tap the power of SCORM to deliver and track training right from your WordPress-powered site. Just add the SCORM Cloud widget to the sidebar or use the SCORM Cloud button to add a link directly in a post or page. Author: Rustici Software -Version: 2.0.4 +Version: 2.0.6 Author URI: http://www.scorm.com */ diff --git a/scormcloud/scormcloudplugin.php b/scormcloud/scormcloudplugin.php index 7fba2b2..a287c99 100644 --- a/scormcloud/scormcloudplugin.php +++ b/scormcloud/scormcloudplugin.php @@ -97,7 +97,7 @@ public static function get_cloud_service( $force_network_settings = false ) { $proxy = get_option( 'proxy' ); } - $origin = ScormEngineUtilities::getCanonicalOriginString( 'Rustici Software', 'WordPress', '2.0.4' ); + $origin = ScormEngineUtilities::getCanonicalOriginString( 'Rustici Software', 'WordPress', '2.0.6' ); if ( strlen( $engine_url ) < 1 ) { $engine_url = 'https://cloud.scorm.com/api/v2';
' . __( 'Completion', 'scormcloud' ) . '