diff --git a/lib/Udoit.php b/lib/Udoit.php index 854dad671..ba4bac86b 100755 --- a/lib/Udoit.php +++ b/lib/Udoit.php @@ -48,6 +48,11 @@ class Udoit { */ public $content_types; + /** + * @var string - The course title + */ + public $course_title; + /** * @var string - The course id our content is in */ @@ -83,6 +88,7 @@ public function __construct($data) { $this->base_uri = $data['base_uri']; $this->content_types = $data['content_types']; $this->course_id = $data['course_id']; + $this->course_title = $data['course_title']; $this->total_results = ['errors' => 0, 'warnings' => 0, 'suggestions' => 0]; $this->module_urls = []; $this->unscannable = []; @@ -151,7 +157,7 @@ public function buildReport() { session_write_close(); $to_encode = [ - 'course' => $title, + 'course' => $this->course_title, 'total_results' => $this->total_results, 'content' => $this->bad_content, ]; diff --git a/public/process.php b/public/process.php index 2d13b4cc7..30af4b405 100755 --- a/public/process.php +++ b/public/process.php @@ -25,9 +25,10 @@ session_start(); -$base_url = $_SESSION['base_url']; -$user_id = $_SESSION['launch_params']['custom_canvas_user_id']; -$api_key = $_SESSION['api_key']; +$base_url = $_SESSION['base_url']; +$user_id = $_SESSION['launch_params']['custom_canvas_user_id']; +$course_title = $_SESSION['launch_params']['context_title']; +$api_key = $_SESSION['api_key']; if ( ! Utils::validate_api_key($user_id, $base_url, $api_key)) { $api_key = $_SESSION['api_key'] = Utils::refresh_api_key($oauth2_id, $oauth2_uri, $oauth2_key, $base_url, $_SESSION['refresh_token']); @@ -55,6 +56,7 @@ } $data = [ + 'course_title' => $course_title, 'api_key' => $api_key, 'base_uri' => $base_url, 'content_types' => $content,