forked from FranckDevops/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
220 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/** | ||
* Capability definitions for the youtubevideo module. | ||
* | ||
* @package mod_youtubevideo | ||
* @copyright 2024 NYX-EI {@link http://nyx-ei.tech} | ||
* @author NYX-EI <help@nyx-ei.tech> | ||
*/ | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
$capabilities = [ | ||
'mod/youtubevideo:addinstance' => [ | ||
'riskbitmask' => RISK_XSS, | ||
'captype' => 'write', | ||
'contextlevel' => CONTEXT_COURSE, | ||
'archetypes' => array( | ||
'editingteacher' => CAP_ALLOW, | ||
'manager' => CAP_ALLOW | ||
), | ||
'clonepermissionsfrom' => 'moodle/course:manageactivities' | ||
], | ||
|
||
'mod/youtubevideo:view' => [ | ||
'captype' => 'read', | ||
'contextlevel' => CONTEXT_MODULE, | ||
'archetypes' => array( | ||
'guest' => CAP_ALLOW, | ||
'student' => CAP_ALLOW, | ||
'teacher' => CAP_ALLOW, | ||
'editingteacher' => CAP_ALLOW, | ||
'manager' => CAP_ALLOW | ||
) | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<XMLDB PATH="mod/youtubevideo/db" VERSION="2024080800" COMMENT="YouTube Video Plugin Database Schema" > | ||
<TABLES> | ||
<TABLE NAME="youtubevideo" ID="id" COMMENT="YouTube Video Plugin Table"> | ||
<FIELDS> | ||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/> | ||
<FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true"/> | ||
<FIELD NAME="video_url" TYPE="text" NOTNULL="true"/> | ||
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true"/> | ||
</FIELDS> | ||
<KEYS> | ||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/> | ||
</KEYS> | ||
</TABLE> | ||
</TABLES> | ||
<XMLDB PATH="mod/youtubevideo/db" VERSION="2024080800" COMMENT="YouTube Video module Database Schema"> | ||
<TABLES> | ||
<TABLE NAME="youtubevideo" ID="id" COMMENT="Stores YouTube video information"> | ||
<FIELDS> | ||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/> | ||
<FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Course youtubevideo activity belongs to"/> | ||
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="name field for moodle instances"/> | ||
<FIELD NAME="intro" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="General introduction of the youtubevideo activity"/> | ||
<FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Format of the intro field (MOODLE, HTML, MARKDOWN...)"/> | ||
<FIELD NAME="youtubeurl" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="YouTube video URL"/> | ||
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> | ||
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/> | ||
</FIELDS> | ||
<KEYS> | ||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/> | ||
</KEYS> | ||
<INDEXES> | ||
<INDEX NAME="course" UNIQUE="false" FIELDS="course"/> | ||
</INDEXES> | ||
</TABLE> | ||
</TABLES> | ||
</XMLDB> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
/** | ||
* @package youtubevideo | ||
* @copyright 2024 NYX-EI {@link https://nyx-ei.tech} | ||
* @author NYX-EI <help@nyx-ei.tech> | ||
*/ | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
require_once($CFG->dirroot . '/course/moodleform_mod.php'); | ||
|
||
class mod_youtubevideo_mod_form extends moodleform_mod | ||
{ | ||
|
||
function definition() | ||
{ | ||
global $CFG; | ||
|
||
$mform = $this->_form; | ||
|
||
$mform->addElement('header', 'general', get_string('general', 'form')); | ||
$mform->addElement('text', 'name', get_string('name'), array('size' => '64')); | ||
|
||
if (!empty($CFG->formatstringstriptags)) { | ||
$mform->setType('name', PARAM_TEXT); | ||
} else { | ||
$mform->setType('name', PARAM_CLEANHTML); | ||
} | ||
|
||
$mform->addRule('name', null, 'required', null, 'client'); | ||
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); | ||
|
||
$this->standard_intro_elements(); | ||
|
||
$mform->addElement('text', 'youtubeurl', get_string('youtubeurl', 'youtubevideo'), array('size' => '64')); | ||
$mform->setType('youtubeurl', PARAM_URL); | ||
$mform->addRule('youtubeurl', null, 'required', null, 'client'); | ||
$mform->addHelpButton('youtubeurl', 'youtubeurl', 'youtubevideo'); | ||
|
||
$this->standard_coursemodule_elements(); | ||
$this->add_action_buttons(); | ||
} | ||
|
||
function validated_url($data, $files) | ||
{ | ||
$errors = parent::validation($data, $files); | ||
if (!preg_match('/^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.?be)\/.+$/', $data['youtubeurl'])) { | ||
$errors['youtubeurl'] = get_string('invalidyoutubeurl', 'youtubevideo'); | ||
} | ||
return $errors; | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Module Vidéo YouTube pour Moodle | ||
|
||
Ce module permet aux enseignants d'intégrer facilement des vidéos YouTube dans leurs cours Moodle. | ||
|
||
## Fonctionnalités | ||
|
||
- Intégration directe des vidéos YouTube dans les cours Moodle | ||
- Interface simple pour les enseignants pour ajouter des vidéos | ||
- Lecture des vidéos dans l'environnement Moodle | ||
|
||
## Utilisation | ||
|
||
1. Activez le mode édition dans votre cours. | ||
2. Cliquez sur "Ajouter une activité ou une ressource" et sélectionnez "Vidéo YouTube" dans la liste. | ||
3. Donnez un nom à votre vidéo et collez l'URL YouTube dans le champ "URL YouTube". | ||
4. Enregistrez et retournez au cours. | ||
5. La vidéo sera maintenant intégrée dans votre cours. | ||
|
||
|
||
## Support | ||
|
||
Si vous rencontrez des problèmes ou avez des questions, veuillez ouvrir un ticket (issue) sur le dépôt [GitHub](https://github.com/nyx-ei/Mood-NYX/issues). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters