Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
[FIX] issue with lrn-items when old code injected act_temp_id all the…
Browse files Browse the repository at this point in the history
… times
  • Loading branch information
Dmitry Kochnev committed Apr 20, 2018
1 parent ae2e242 commit 5fac4c5
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions classes/Learnosity/Shortcodes/ItemsEmbed.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct($options, $mode)
$options = $this->parse_options($options);
$this->config = array_merge($defaults, $options);

//Force ther rendering type based based on mode called
//Force their rendering type based based on mode called
// lrn-items:inline or lrn-assess:assess
$this->config['renderingtype'] = $mode;
}
Expand All @@ -68,7 +68,6 @@ public function render()
$this->config['rendersubmit']
);
}

}
return ob_get_clean();
}
Expand Down Expand Up @@ -127,7 +126,7 @@ private function generate_signed_request()
}

// If activitytemplateid then add it to the request
if ($this->config['activitytemplateid']) {
if (isset($this->config['activitytemplateid']) AND !empty($this->config['activitytemplateid'])) {
$request['activity_template_id'] = $this->config['activitytemplateid'];
}

Expand All @@ -138,12 +137,6 @@ private function generate_signed_request()
$request
);
$signed_request = $request_helper->generateRequest();
if (isset($this->config['activitytemplateid'])) {
$signed_request = json_decode($signed_request, true);
$ati = $this->config['activitytemplateid'];
$signed_request['request']['activity_template_id'] = $ati;
$signed_request = json_encode($signed_request);
}
return $signed_request;
}

Expand Down

0 comments on commit 5fac4c5

Please sign in to comment.