Verified Commit 8bd781e7 authored by David Beniamine's avatar David Beniamine
Browse files

Add link to mission edition

parent 4717c81f
......@@ -168,6 +168,21 @@ class user extends moodlefetcher
return $this->fetcher->encodeJwtToken('/v1/redirect', $payload);
}
/**
* Return a JWT token for the redirection page of LnB, pointing to mission edition page.
*
* @param int $missionid
* @return string JWT
* @throws \moodle_exception
*/
public function getMissionEditTokenForRedirect(int $missionId): string
{
$payload = [
'path' => "/authoring_tools/lb_mission_edit.php?idm=$missionId",
];
return $this->fetcher->encodeJwtToken('/v1/redirect', $payload);
}
/**
* Return a JWT token for the redirection page of LnB, pointing to the config of this teaming.
*
......
......@@ -63,6 +63,8 @@ $string['external_teaming'] = "Manage teaming";
$string['external_teaming_descr'] = "Advanced teaming configuration using LabNbook interface";
$string['external_reports'] = "Manage reports produced by students";
$string['external_reports_descr'] = "Acccess to the students' reports, with the capability to annotate the content.";
$string['external_mission'] = "Edit the mission";
$string['external_mission_descr'] = "Acces to the mission edition page.";
// view as student
$string['gotoreport'] = "Access to the report";
......
......@@ -63,6 +63,8 @@ $string['external_teaming'] = "Gérer la mise en équipes";
$string['external_teaming_descr'] = "Configuration avancée des équipes avec l'interface de LabNbook.";
$string['external_reports'] = "Administrer les rapports produits";
$string['external_reports_descr'] = "Accéder aux rapports produits par les étudiants, avec possibilité d'annoter le contenu.";
$string['external_mission'] = "Modifier la mission";
$string['external_mission_descr'] = "Accéder à la page d'édition de la mission.";
// view as student
$string['gotoreport'] = "Accéder au rapport";
......
......@@ -14,5 +14,11 @@
{{#str}}external_reports_descr, mod_labnbook{{/str}}
</p>
</li>
<li>
<a href="{{redirecturl}}?token={{token_mission}}" target="_blank">{{#str}}external_mission, mod_labnbook{{/str}}</a>
<p>
{{#str}}external_mission_descr, mod_labnbook{{/str}}
</p>
</li>
</ul>
</section>
......@@ -74,6 +74,7 @@ if ($isTeacher) {
$templateName = 'view_teacher';
$templateData['token_teaming'] = $fetcher->getTeamingTokenForRedirect($moduleinstance->labnbook_teamconfigid);
$templateData['token_reports'] = $fetcher->getReportsTokenForRedirect($moduleinstance->labnbook_teamconfigid);
$templateData['token_mission'] = $fetcher->getMissionEditTokenForRedirect($moduleinstance->labnbook_missionid);
$nStarted = $fetcher->getNumStartedReports($moduleinstance->labnbook_teamconfigid);
$templateData['started_reports'] = $nStarted." ".get_string('reports_started', 'labnbook');
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment