Skip to content

Commit

Permalink
Merge pull request #27 from nolmac/post-results-fix
Browse files Browse the repository at this point in the history
Undefined Score Fix
  • Loading branch information
nolmac authored Sep 23, 2022
2 parents 42af2c3 + 39c7399 commit a8da532
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions scormcloud/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scormcloud/scormcloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion scormcloud/scormcloudcontenthandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 .= '<table class="result_table"><tr>' .
'<td class="head">' . __( 'Completion', 'scormcloud' ) . '</td>' .
Expand Down
2 changes: 1 addition & 1 deletion scormcloud/scormcloudplugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit a8da532

Please sign in to comment.