Plugin: IMS/LTI Provider: Implement quizzes as tool provider

Authored-by: Christian <christianbeeznest@users.noreply.github.com>
pull/3952/head
christianbeeznest 4 years ago committed by GitHub
parent 47915cfb17
commit 7101db8d2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      main/exercise/exercise_result.php
  2. 17
      main/exercise/exercise_submit.php
  3. 4
      main/exercise/overview.php
  4. 36
      plugin/lti_provider/Entity/Platform.php
  5. 66
      plugin/lti_provider/LtiProviderPlugin.php
  6. 1
      plugin/lti_provider/README.md
  7. 7
      plugin/lti_provider/create.php
  8. 5
      plugin/lti_provider/db/lti13_cookie.php
  9. 3
      plugin/lti_provider/edit.php
  10. 9
      plugin/lti_provider/lang/english.php
  11. 3
      plugin/lti_provider/lang/french.php
  12. 3
      plugin/lti_provider/lang/spanish.php
  13. 3
      plugin/lti_provider/src/Form/FrmAdd.php
  14. 4
      plugin/lti_provider/src/Form/FrmEdit.php
  15. 47
      plugin/lti_provider/src/LtiProvider.php
  16. 67
      plugin/lti_provider/tool/api/score.php
  17. 8
      plugin/lti_provider/tool/login.php
  18. 26
      plugin/lti_provider/tool/start.php
  19. 2
      plugin/lti_provider/view/admin.tpl
  20. 4
      plugin/lti_provider/web/api/score.php
  21. 4
      plugin/lti_provider/web/api/scoreboard.php
  22. 2
      plugin/lti_provider/web/configure.php
  23. 2
      plugin/lti_provider/web/game.php
  24. 2
      plugin/lti_provider/web/login.php

@ -377,5 +377,18 @@ function showEmbeddableFinishButton()
['class' => 'text-center']
);
// We check if a tool provider
if (isset($_REQUEST['lti_launch_id'])) {
$ltiLaunchId = Security::remove_XSS($_REQUEST['lti_launch_id']);
global $exeId;
$js .= '<script>
$(function () {
var url = "'.api_get_path(WEB_PLUGIN_PATH).'lti_provider/tool/api/score.php?'.api_get_cidreq().'&launch_id='.$ltiLaunchId.'&exeId='.$exeId.'";
$.get(url);
});
</script>';
}
return $js.PHP_EOL.$html;
}

@ -512,6 +512,14 @@ if (!empty($exercise_stat_info['questions_to_check'])) {
}
$params = "exe_id=$exe_id&exerciseId=$exerciseId&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&learnpath_item_view_id=$learnpath_item_view_id&".api_get_cidreq().'&reminder='.$reminder;
// It is a lti provider
$ltiLaunchId = '';
$ltiParams = '';
if (isset($_REQUEST['lti_launch_id'])) {
$ltiLaunchId = Security::remove_XSS($_REQUEST['lti_launch_id']);
$ltiParams = '&lti_launch_id='.$ltiLaunchId;
$params .= $ltiParams;
}
if (2 === $reminder && empty($myRemindList)) {
if ($debug) {
error_log('6.2 calling the exercise_reminder.php');
@ -838,13 +846,13 @@ if ($formSent && isset($_POST)) {
}
}
}
header("Location: exercise_result.php?".api_get_cidreq()."&exe_id=$exe_id&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&learnpath_item_view_id=$learnpath_item_view_id");
header("Location: exercise_result.php?".api_get_cidreq()."&exe_id=$exe_id&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&learnpath_item_view_id=$learnpath_item_view_id.$ltiParams");
exit;
} else {
if ($debug) {
error_log('10. Redirecting to exercise_result.php');
}
header("Location: exercise_result.php?".api_get_cidreq()."&exe_id=$exe_id&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&learnpath_item_view_id=$learnpath_item_view_id");
header("Location: exercise_result.php?".api_get_cidreq()."&exe_id=$exe_id&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&learnpath_item_view_id=$learnpath_item_view_id.$ltiParams");
exit;
}
} else {
@ -931,7 +939,7 @@ if ($question_count != 0) {
.api_get_cidreq()
."&exe_id=$exe_id&learnpath_id=$learnpath_id&learnpath_item_id="
.$learnpath_item_id
."&learnpath_item_view_id=$learnpath_item_view_id"
."&learnpath_item_view_id=$learnpath_item_view_id.$ltiParams"
);
exit;
}
@ -1610,6 +1618,9 @@ echo '<form id="exercise_form" method="post" action="'.
<input type="hidden" name="learnpath_id" value="'.$learnpath_id.'" />
<input type="hidden" name="learnpath_item_id" value="'.$learnpath_item_id.'" />
<input type="hidden" name="learnpath_item_view_id" value="'.$learnpath_item_view_id.'" />';
if (!empty($ltiLaunchId)) {
echo '<input type="hidden" name="lti_launch_id" value="'.$ltiLaunchId.'" />';
}
// Show list of questions
$i = 1;

@ -65,6 +65,10 @@ $extra_params = '';
if (isset($_GET['preview'])) {
$extra_params = '&preview=1';
}
// It is a lti provider
if (isset($_GET['lti_launch_id'])) {
$extra_params .= '&lti_launch_id='.Security::remove_XSS($_GET['lti_launch_id']);
}
$exercise_url = api_get_path(WEB_CODE_PATH).'exercise/exercise_submit.php?'.
api_get_cidreq().'&exerciseId='.$objExercise->iid.'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.'&learnpath_item_view_id='.$learnpathItemViewId.$extra_params;

@ -65,6 +65,12 @@ class Platform
* @ORM\Column(name="deployment_id", type="text")
*/
private $deploymentId;
/**
* @var string
*
* @ORM\Column(name="tool_provider", type="text")
*/
private $toolProvider;
/**
* Get id.
@ -84,10 +90,26 @@ class Platform
return $this;
}
/**
* @return string
*/
public function getToolProvider()
{
return $this->toolProvider;
}
/**
* @param string $toolProvider
*/
public function setToolProvider(?string $toolProvider): void
{
$this->toolProvider = $toolProvider;
}
/**
* Get key id.
*/
public function getKid(): string
public function getKid()
{
return $this->kid;
}
@ -105,7 +127,7 @@ class Platform
/**
* Get Issuer.
*/
public function getIssuer(): string
public function getIssuer()
{
return $this->issuer;
}
@ -123,7 +145,7 @@ class Platform
/**
* Get client ID.
*/
public function getClientId(): string
public function getClientId()
{
return $this->clientId;
}
@ -141,7 +163,7 @@ class Platform
/**
* Get auth login URL.
*/
public function getAuthLoginUrl(): string
public function getAuthLoginUrl()
{
return $this->authLoginUrl;
}
@ -159,7 +181,7 @@ class Platform
/**
* Get auth token URL.
*/
public function getAuthTokenUrl(): string
public function getAuthTokenUrl()
{
return $this->authTokenUrl;
}
@ -177,7 +199,7 @@ class Platform
/**
* Get key set URL.
*/
public function getKeySetUrl(): string
public function getKeySetUrl()
{
return $this->keySetUrl;
}
@ -195,7 +217,7 @@ class Platform
/**
* Get Deployment ID.
*/
public function getDeploymentId(): string
public function getDeploymentId()
{
return $this->deploymentId;
}

@ -1,6 +1,7 @@
<?php
/* For license terms, see /license.txt */
use Chamilo\PluginBundle\Entity\LtiProvider\Platform;
use Chamilo\PluginBundle\Entity\LtiProvider\PlatformKey;
use Doctrine\DBAL\DBALException;
use Doctrine\ORM\OptimisticLockException;
@ -51,6 +52,44 @@ class LtiProviderPlugin extends Plugin
parent::__construct($version, $author, $settings);
}
/**
* Get a selectbox with quizzes in courses , used for a tool provider.
*
* @param null $issuer
* @return string
*/
public function getQuizzesSelect($issuer = null)
{
$courses = CourseManager::get_courses_list();
$toolProvider = $this->getToolProvider($issuer);
$htmlcontent = '<div class="form-group">
<label for="lti_provider_create_platform_kid" class="col-sm-2 control-label">'.$this->get_lang('ToolProvider').'</label>
<div class="col-sm-8">
<select name="tool_provider">';
$htmlcontent .= '<option value="">-- '.$this->get_lang('SelectOneActivity').' --</option>';
foreach ($courses as $course) {
$courseInfo = api_get_course_info($course['code']);
$optgroupLabel = "{$course['title']} : ".get_lang('Quizzes');
$htmlcontent .= '<optgroup label="'.$optgroupLabel.'">';
$exerciseList = ExerciseLib::get_all_exercises_for_course_id(
$courseInfo,
0,
$course['id'],
false
);
foreach ($exerciseList as $key => $exercise) {
$selectValue = "{$course['code']}@@quiz-{$exercise['iid']}";
$htmlcontent .= '<option value="'.$selectValue.'" '.($toolProvider == $selectValue?' selected="selected"':'').'>'.Security::remove_XSS($exercise['title']).'</option>';
}
$htmlcontent .= '</optgroup>';
}
$htmlcontent .= "</select>";
$htmlcontent .= ' </div>
<div class="col-sm-2"></div>
</div>';
return $htmlcontent;
}
/**
* Get the public key.
*/
@ -68,6 +107,32 @@ class LtiProviderPlugin extends Plugin
return $publicKey;
}
/**
* Get the tool provider.
*/
public function getToolProvider($issuer): string
{
$toolProvider = '';
$platform = Database::getManager()
->getRepository('ChamiloPluginBundle:LtiProvider\Platform')
->findOneBy(['issuer' => $issuer]);
if ($platform) {
$toolProvider = $platform->getToolProvider();
}
return $toolProvider;
}
public function getToolProviderVars($issuer): array
{
$toolProvider = $this->getToolProvider($issuer);
list($courseCode, $tool) = explode('@@', $toolProvider);
list($toolName, $toolId) = explode('-', $tool);
$vars = ['courseCode' => $courseCode, 'toolName' => $toolName, 'toolId' => $toolId];
return $vars;
}
/**
* Get the class instance.
*
@ -216,6 +281,7 @@ class LtiProviderPlugin extends Plugin
auth_token_url varchar(255) NOT NULL,
key_set_url varchar(255) NOT NULL,
deployment_id varchar(255) NOT NULL,
tool_provider varchar(255) NULL,
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB",
"CREATE TABLE plugin_lti_provider_platform_key (

@ -33,6 +33,7 @@ CREATE TABLE plugin_lti_provider_platform (
auth_token_url varchar(255) NOT NULL,
key_set_url varchar(255) NOT NULL,
deployment_id varchar(255) NOT NULL,
tool_provider varchar(255) NULL,
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB;

@ -1,12 +1,11 @@
<?php
/* For license terms, see /license.txt */
use Chamilo\PluginBundle\Entity\LtiProvider\Platform;
use Chamilo\PluginBundle\LtiProvider\Form\FrmAdd;
$cidReset = true;
require_once __DIR__.'/../../main/inc/global.inc.php';
use Chamilo\PluginBundle\Entity\LtiProvider\Platform;
use Chamilo\PluginBundle\LtiProvider\Form\FrmAdd;
require_once __DIR__.'/LtiProviderPlugin.php';
api_protect_admin_script();
@ -28,6 +27,8 @@ if ($form->validate()) {
$platform->setKeySetUrl($formValues['key_set_url']);
$platform->setDeploymentId($formValues['deployment_id']);
$platform->setKid($formValues['kid']);
$toolProvider = (isset($formValues['tool_provider']) ? $formValues['tool_provider'] : $_POST['tool_provider']);
$platform->setToolProvider($toolProvider);
$em->persist($platform);
$em->flush();

@ -7,6 +7,11 @@ class Lti13Cookie implements Lti1p3Cookie
{
public function getCookie($name)
{
if (isset($_REQUEST['state']) && $name === 'lti1p3_'.$_REQUEST['state']) {
return $_REQUEST['state'];
}
if (isset($_COOKIE[$name])) {
return $_COOKIE[$name];
}

@ -37,7 +37,6 @@ $form->build();
if ($form->validate()) {
$formValues = $form->exportValues();
$platform->setIssuer($formValues['issuer']);
$platform->setClientId($formValues['client_id']);
$platform->setAuthLoginUrl($formValues['auth_login_url']);
@ -45,6 +44,8 @@ if ($form->validate()) {
$platform->setKeySetUrl($formValues['key_set_url']);
$platform->setDeploymentId($formValues['deployment_id']);
$platform->setKid($formValues['kid']);
$toolProvider = (isset($formValues['tool_provider']) ? $formValues['tool_provider'] : $_POST['tool_provider']);
$platform->setToolProvider($toolProvider);
$em->persist($platform);
$em->flush();

@ -21,10 +21,13 @@ $strings['AuthLoginUrl'] = 'OIDC Auth URL';
$strings['AuthTokenUrl'] = 'OAuth2 Access Token URL';
$strings['KeySetUrl'] = 'Keyset URL';
$strings['DeploymentId'] = 'Deployment ID';
$strings['KeyId'] = 'key id (kid)';
$strings['KeyId'] = 'Key id (kid)';
$strings['PublicKey'] = 'Public key';
$strings['Name'] = 'Provider name';
$strings['Enabled'] = 'Enabled';
$strings['GenerateKeyPairInfo'] = 'A new private and public key pair will be created when enabling.';
$strings['URLs'] = 'Endpoints Urls';
$strings['PlatformConnectionAdded'] = 'A platform connection is added.';
$strings['URLs'] = 'Endpoints URLs';
$strings['PlatformConnectionAdded'] = 'A platform connection has been added.';
$strings['ToolProvider'] = 'Provider tool';
$strings['SelectOneActivity'] = 'Select one activity';
$strings['Quizzes'] = 'Exercises';

@ -26,3 +26,6 @@ $strings['Enabled'] = 'Activé';
$strings['GenerateKeyPairInfo'] = 'Une nouvelle paire de clés privée et publique sera créée lors de l\'activation.';
$strings['URLs'] = 'URLs Endpoints';
$strings['PlatformConnectionAdded'] = 'La nouvelle connexion inter-plateforme a été ajoutée.';
$strings['ToolProvider'] = 'Outil fournisseur';
$strings['SelectOneActivity'] = 'Sélectionnez une activité';
$strings['Quizzes'] = 'Exercices';

@ -28,3 +28,6 @@ $strings['Enabled'] = 'Habilitado';
$strings['GenerateKeyPairInfo'] = 'Se creará un nuevo par de claves pública y privada cuando se habilite.';
$strings['URLs'] = 'URL de puntos finales';
$strings['PlatformConnectionAdded'] = 'Se agrega una conexión de plataforma.';
$strings['ToolProvider'] = 'Herramienta del proveedor';
$strings['SelectOneActivity'] = 'Selecccione una actividad';
$strings['Quizzes'] = 'Ejercicios';

@ -45,7 +45,8 @@ class FrmAdd extends FormValidator
$this->addUrl('key_set_url', $plugin->get_lang('KeySetUrl'));
$this->addText('client_id', $plugin->get_lang('ClientId'));
$this->addText('deployment_id', $plugin->get_lang('DeploymentId'));
$this->addText('kid', $plugin->get_lang('KeyId'));
$this->addText('kid', $plugin->get_lang('KeyId'), false);
$this->addElement('html', $plugin->getQuizzesSelect());
$this->addButtonCreate($plugin->get_lang('AddPlatform'));
$this->applyFilter('__ALL__', 'trim');

@ -45,7 +45,8 @@ class FrmEdit extends FormValidator
$this->addUrl('key_set_url', $plugin->get_lang('KeySetUrl'));
$this->addText('client_id', $plugin->get_lang('ClientId'));
$this->addText('deployment_id', $plugin->get_lang('DeploymentId'));
$this->addText('kid', $plugin->get_lang('KeyId'));
$this->addText('kid', $plugin->get_lang('KeyId'), false);
$this->addElement('html', $plugin->getQuizzesSelect($this->platform->getIssuer()));
$this->addButtonCreate($plugin->get_lang('EditPlatform'));
$this->addHidden('id', $this->platform->getId());
@ -66,6 +67,7 @@ class FrmEdit extends FormValidator
$defaults['client_id'] = $this->platform->getClientId();
$defaults['deployment_id'] = $this->platform->getDeploymentId();
$defaults['kid'] = $this->platform->getKid();
$defaults['tool_provider'] = $this->platform->getToolProvider();
$this->setDefaults($defaults);
}

@ -33,17 +33,18 @@ class LtiProvider
*
* @throws Lti1p3\OidcException
*/
public function login($request = null)
public function login(?array $request = null)
{
$launchUrl = Security::remove_XSS($request['target_link_uri']);
LtiOidcLogin::new(new Lti13Database(), new Lti13Cache(), new Lti13Cookie())
->doOidcLoginRedirect(api_get_path(WEB_PLUGIN_PATH)."lti_provider/web/game.php", $request)
->doOidcLoginRedirect($launchUrl, $request)
->doRedirect();
}
/**
* Lti Message Launch.
*/
public function launch(bool $fromCache = false, ?int $launchId = null): LtiMessageLaunch
public function launch(bool $fromCache = false, ?string $launchId = null): LtiMessageLaunch
{
if ($fromCache) {
$launch = LtiMessageLaunch::fromCache($launchId, new Lti13Database(), new Lti13Cache());
@ -53,4 +54,44 @@ class LtiProvider
return $launch;
}
/**
* Verify if email user is in the platform to create it and login (true) or not (false)
*/
public function validateUser(array $launchData, string $courseCode): bool
{
if (empty($launchData)) {
return false;
}
$firstName = $launchData['given_name'];
$lastName = $launchData['family_name'];
$email = $launchData['email'];
$status = STUDENT;
$userInfo = api_get_user_info_from_email($email);
if (empty($userInfo)) {
// We create the user
$username = $launchData['https://purl.imsglobal.org/spec/lti/claim/ext']['user_username'];
$password = api_generate_password();
$userId = UserManager::create_user(
$firstName,
$lastName,
$status,
$email,
$username,
$password
);
} else {
$userId = $userInfo['user_id'];
}
if (!CourseManager::is_user_subscribed_in_course($userId, $courseCode)) {
CourseManager::subscribeUser($userId, $courseCode, $status);
}
$login = UserManager::loginAsUser($userId, false);
return $login;
}
}

@ -0,0 +1,67 @@
<?php
/* For license terms, see /license.txt */
require_once __DIR__.'/../../../../main/inc/global.inc.php';
require_once __DIR__.'/../../src/LtiProvider.php';
$launch = LtiProvider::create()->launch(true, $_REQUEST['launch_id']);
if (!$launch->hasAgs()) {
throw new Exception("Don't have grades!");
}
if (!isset($_REQUEST['exeId'])) {
throw new Exception("Any Exercise result");
}
$launchData = $launch->getLaunchData();
$label = 'Score';
$courseClient = $launchData['https://purl.imsglobal.org/spec/lti/claim/resource_link']['title'];
if (!empty($courseClient)) {
$label = $courseClient;
}
$exeId = (int) $_REQUEST['exeId'];
$trackInfo = Exercise::get_stat_track_exercise_info_by_exe_id($exeId);
$score = $trackInfo['exe_result'];
$weight = $trackInfo['exe_weighting'];
$duration = $trackInfo['duration'];
$timestamp = date(DateTime::ISO8601);
$grades = $launch->getAgs();
$score = Packback\Lti1p3\LtiGrade::new()
->setScoreGiven($score)
->setScoreMaximum($weight)
->setTimestamp($timestamp)
->setActivityProgress('Completed')
->setGradingProgress('FullyGraded')
->setUserId($launch->getLaunchData()['sub']);
$scoreLineitem = Packback\Lti1p3\LtiLineitem::new()
->setTag('score')
->setScoreMaximum($weight)
->setLabel($label)
->setResourceId($launch->getLaunchData()['https://purl.imsglobal.org/spec/lti/claim/resource_link']['id']);
$grades->putGrade($score, $scoreLineitem);
$time = Packback\Lti1p3\LtiGrade::new()
->setScoreGiven($duration)
->setScoreMaximum(999)
->setTimestamp($timestamp)
->setActivityProgress('Completed')
->setGradingProgress('FullyGraded')
->setUserId($launch->getLaunchData()['sub']);
$timeLineitem = Packback\Lti1p3\LtiLineitem::new()
->setTag('time')
->setScoreMaximum(999)
->setLabel('Time Taken')
->setResourceId('time'.$launch->getLaunchData()['https://purl.imsglobal.org/spec/lti/claim/resource_link']['id']);
$grades->putGrade($time, $timeLineitem);
echo '{"success" : true}';

@ -0,0 +1,8 @@
<?php
/* For license terms, see /license.txt */
require_once __DIR__.'/../../../main/inc/global.inc.php';
require_once __DIR__.'/../src/LtiProvider.php';
use Packback\Lti1p3;
LtiProvider::create()->login($_REQUEST);

@ -0,0 +1,26 @@
<?php
/* For license terms, see /license.txt */
require_once __DIR__.'/../../../main/inc/global.inc.php';
require_once __DIR__.'/../src/LtiProvider.php';
require_once __DIR__.'/../LtiProviderPlugin.php';
use Packback\Lti1p3;
$launch = LtiProvider::create()->launch();
if (!$launch->hasNrps()) {
throw new Exception("Don't have names and roles!");
}
$launchData = $launch->getLaunchData();
$plugin = LtiProviderPlugin::create();
$toolVars = $plugin->getToolProviderVars($launchData['iss']);
$login = LtiProvider::create()->validateUser($launchData, $toolVars['courseCode']);
$cidReq = 'cidReq='.$toolVars['courseCode'].'&id_session=0&gidReq=0&gradebook=0';
$launchUrl = api_get_path(WEB_CODE_PATH).'exercise/overview.php?'.$cidReq.'&origin=embeddable&exerciseId='.$toolVars['toolId'].'&lti_launch_id='.$launch->getLaunchId();
header('Location: '.$launchUrl);
exit;

@ -17,7 +17,6 @@
<th>{{ 'PlatformName'|get_plugin_lang('LtiProviderPlugin') }}</th>
<th>{{ 'ClientId'|get_plugin_lang('LtiProviderPlugin') }}</th>
<th class="text-center">{{ 'DeploymentId'|get_plugin_lang('LtiProviderPlugin') }}</th>
<th class="text-center">{{ 'KeyId'|get_plugin_lang('LtiProviderPlugin') }}</th>
<th class="text-center">{{ 'URLs'|get_plugin_lang('LtiProviderPlugin') }}</th>
<th class="text-right">{{ 'Actions'|get_lang }}</th>
</tr>
@ -29,7 +28,6 @@
<td>{{ platform.getIssuer }}</td>
<td>{{ platform.getClientId }}</td>
<td>{{ platform.getDeploymentId }}</td>
<td>{{ platform.getKid }}</td>
<td>
<p><strong>{{ 'AuthLoginUrl'|get_plugin_lang('LtiProviderPlugin') }}:</strong><br> {{ platform.getAuthLoginUrl }}</p>
<p><strong>{{ 'AuthTokenUrl'|get_plugin_lang('LtiProviderPlugin') }}:</strong><br> {{ platform.getAuthTokenUrl }}</p>

@ -2,7 +2,7 @@
/* For license terms, see /license.txt */
require_once __DIR__.'/../../../../main/inc/global.inc.php';
require_once __DIR__ . '/../../src/LtiProvider.php';
require_once __DIR__.'/../../src/LtiProvider.php';
$launch = LtiProvider::create()->launch(true, $_REQUEST['launch_id']);
@ -46,4 +46,4 @@ $timeLineitem = Packback\Lti1p3\LtiLineitem::new()
$grades->putGrade($time, $timeLineitem);
echo '{"success" : true}';
echo '{"success" : true}';

@ -2,7 +2,7 @@
/* For license terms, see /license.txt */
require_once __DIR__.'/../../../../main/inc/global.inc.php';
require_once __DIR__ . '/../../src/LtiProvider.php';
require_once __DIR__.'/../../src/LtiProvider.php';
$launch = LtiProvider::create()->launch(true, $_REQUEST['launch_id']);
@ -48,4 +48,4 @@ foreach ($scores as $score) {
}
$scoreboard[] = $result;
}
echo json_encode($scoreboard);
echo json_encode($scoreboard);

@ -2,7 +2,7 @@
/* For license terms, see /license.txt */
require_once __DIR__.'/../../../main/inc/global.inc.php';
require_once __DIR__ . '/../src/LtiProvider.php';
require_once __DIR__.'/../src/LtiProvider.php';
use Packback\Lti1p3;
$launch = LtiProvider::create()->launch(true, $_REQUEST['launch_id']);

@ -2,7 +2,7 @@
/* For license terms, see /license.txt */
require_once __DIR__.'/../../../main/inc/global.inc.php';
require_once __DIR__ . '/../src/LtiProvider.php';
require_once __DIR__.'/../src/LtiProvider.php';
use Packback\Lti1p3;
$launch = LtiProvider::create()->launch();

@ -2,7 +2,7 @@
/* For license terms, see /license.txt */
require_once __DIR__.'/../../../main/inc/global.inc.php';
require_once __DIR__ . '/../src/LtiProvider.php';
require_once __DIR__.'/../src/LtiProvider.php';
use Packback\Lti1p3;
LtiProvider::create()->login($_REQUEST);

Loading…
Cancel
Save