Skip to content

Commit

Permalink
makes sure the title makes it into the report
Browse files Browse the repository at this point in the history
  • Loading branch information
iturgeon committed Dec 14, 2016
1 parent a917427 commit 9c768e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 7 additions & 1 deletion lib/Udoit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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,
];
Expand Down
8 changes: 5 additions & 3 deletions public/process.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down Expand Up @@ -55,6 +56,7 @@
}

$data = [
'course_title' => $course_title,
'api_key' => $api_key,
'base_uri' => $base_url,
'content_types' => $content,
Expand Down

0 comments on commit 9c768e4

Please sign in to comment.