first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
<div class="journal-addentry">
<div class="mb-3">
<div class="font-weight-bold">[[Title#name]]</div>
[[Title]]
</div>
<div class="mb-3">
<div class="font-weight-bold">[[Content#name]]</div>
[[Content]]
</div>
##otherfields##
</div>
@@ -0,0 +1,21 @@
<div class="journal-asearch container">
<div class="row row-cols-3">
<div class="mb-3 col">
<div class="font-weight-bold mb-2">First name</div>
##firstname##
</div>
<div class="mb-3 col">
<div class="font-weight-bold mb-2">Last name</div>
##lastname##
</div>
<div class="mb-3 col">
<div class="font-weight-bold mb-2">[[Title#name]]</div>
[[Title]]
</div>
<div class="mb-3 col">
<div class="font-weight-bold mb-2">[[Content#name]]</div>
[[Content]]
</div>
</div>
</div>
@@ -0,0 +1,37 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace datapreset_journal\privacy;
/**
* Privacy provider implementation for datapreset_journal.
*
* @package datapreset_journal
* @copyright 2022 Sara Arjona <sara@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\null_provider {
/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
*
* @return string
*/
public static function get_reason(): string {
return 'privacy:metadata';
}
}
+16
View File
@@ -0,0 +1,16 @@
/****** List View CSS ******/
.truncate-overflow {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
/***** Add entry CSS *****/
.journal-addentry .form-group label,
.journal-asearch .form-group label {
font-weight: bold;
padding-top: 20px;
}
@@ -0,0 +1,28 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Strings for component 'datapreset_journal', language 'en'.
*
* @package datapreset_journal
* @copyright 2022 Sara Arjona <sara@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['modulename'] = 'Journal';
$string['modulename_help'] = 'Use this preset for a journal, diary, reflections tool or research log.';
$string['pluginname'] = 'Journal';
$string['privacy:metadata'] = 'The Journal plugin doesn\'t store any personal data.';
+28
View File
@@ -0,0 +1,28 @@
<div class="card my-3">
<div class="card-body">
<div class="row">
<div class="col-4 col-sm-8 my-auto">
<h2 class="card-title"><a href="##moreurl##">[[Title]]</a></h2>
</div>
<div class="col-auto ml-auto d-flex flex-row-reverse">
<div>##actionsmenu##</div>
<div class="ml-auto my-auto ##approvalstatusclass##">##approvalstatus##</div>
</div>
</div>
<div class="card-text truncate-overflow mb-4">[[Content]]</div>
<div class="row my-4 mr-1">
<div class="col-auto">##userpicture##</div>
<div class="col">
<div class="row h-100">
<div class="col-4 col-md-3 align-self-center">
##user##<br/><span class="data-timeinfo">##timeadded##</span>
</div>
<div class="col-8 col-md-6 text-right align-self-center data-timeinfo">
<span class="font-weight-bold ">Last edited:</span> ##timemodified##
</div>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1 @@
</div>
@@ -0,0 +1 @@
<div id="journal-list">
+32
View File
@@ -0,0 +1,32 @@
<preset>
<settings>
<intro></intro>
<comments>0</comments>
<requiredentries>0</requiredentries>
<requiredentriestoview>0</requiredentriestoview>
<maxentries>0</maxentries>
<rssarticles>0</rssarticles>
<approval>0</approval>
<manageapproved>1</manageapproved>
<defaultsortdir>0</defaultsortdir>
<defaultsort>0</defaultsort>
</settings>
<field>
<type>text</type>
<name>Title</name>
<required>0</required>
</field>
<field>
<type>textarea</type>
<name>Content</name>
<required>0</required>
<param2>60</param2>
<param3>10</param3>
<param4>1</param4>
<param5>0</param5>
</field>
</preset>
+27
View File
@@ -0,0 +1,27 @@
<div class="journal-rss my-5">
<div class="row my-4">
<div class="col-auto">##userpicture##</div>
<div class="col">
<div class="row h-100">
<div class="col-3 align-self-center">
##user##<br/><span class="data-timeinfo">##timeadded##</span>
</div>
<div class="col-4 col-md-6 text-right align-self-center data-timeinfo">
<span class="font-weight-bold ">Last edited:</span> ##timemodified##
</div>
<div class="col-4 col-md-3 ml-auto align-self-center d-flex flex-row-reverse">
<div class="ml-auto my-auto ##approvalstatusclass##">##approvalstatus##</div>
</div>
</div>
</div>
</div>
<hr/>
<h2 class="card-title mt-4">[[title]]</h2>
<div class="journal-single-body my-5">
<div class="singleentry-content">
[[Content]]
</div>
</div>
</div>
@@ -0,0 +1 @@
[[Title]]
@@ -0,0 +1,29 @@
<div class="journal-single my-5">
<div class="row my-4">
<div class="col-auto">##userpicture##</div>
<div class="col">
<div class="row h-100">
<div class="col-3 align-self-center">
##user##<br/><span class="data-timeinfo">##timeadded##</span>
</div>
<div class="col-4 col-md-6 text-right align-self-center data-timeinfo">
<span class="font-weight-bold ">Last edited:</span> ##timemodified##
</div>
<div class="col-4 col-md-3 ml-auto align-self-center d-flex flex-row-reverse">
<div>##actionsmenu##</div>
<div class="ml-auto my-auto ##approvalstatusclass##">##approvalstatus##</div>
</div>
</div>
</div>
</div>
<hr/>
<h2 class="card-title mt-4">[[title]]</h2>
<div class="journal-single-body my-5">
<div class="singleentry-content">
[[Content]]
</div>
##otherfields##
</div>
</div>
@@ -0,0 +1,102 @@
@mod @mod_data @datapreset @datapreset_journal
Feature: Users can use the Journal preset
In order to create a Journal database
As a user
I need to apply and use the Journal preset
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Alice | Student | student1@example.com |
| teacher1 | Pau | Teacher | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| data | Student reflections | Database intro | C1 | data1 |
And I am on the "Student reflections" "data activity" page logged in as teacher1
And I follow "Presets"
And I click on "fullname" "radio" in the "Journal" "table_row"
And I click on "Use this preset" "button"
And the following "mod_data > entries" exist:
| database | user | Title | Content |
| data1 | student1 | Reflection created by student | This is the content for the entry 1 |
| data1 | teacher1 | Reflection created by teacher | And this is the content for the entry 2 |
@javascript
Scenario: Journal. Users view entries
When I am on the "Student reflections" "data activity" page logged in as student1
Then I should see "Reflection created by student"
And I should see "This is the content for the entry 1"
And "Actions" "icon" should exist in the "#journal-list" "css_element"
And I should see "Reflection created by teacher"
And I should see "And this is the content for the entry 2"
# Single view.
And I select "Single view" from the "jump" singleselect
And I should see "Reflection created by student"
And I should see "This is the content for the entry 1"
And "Actions" "icon" should exist in the ".journal-single" "css_element"
And I should not see "Reflection created by teacher"
And I should not see "And this is the content for the entry 2"
And I follow "Next"
And I should see "Reflection created by teacher"
And I should see "And this is the content for the entry 2"
# This student can't edit or delete this entry, so the Actions menu shouldn't be displayed.
And "Actions" "icon" should not exist in the ".journal-single" "css_element"
And I should not see "Reflection created by student"
And I should not see "This is the content for the entry 1"
@javascript
Scenario: Journal. Users can search entries
Given I am on the "Student reflections" "data activity" page logged in as student1
And "Reflection created by student" "text" should appear before "Reflection created by teacher" "text"
When I click on "Advanced search" "checkbox"
And I should see "First name"
And I should see "Last name"
And I set the field "Title" to "student"
And I click on "Save settings" "button" in the "data_adv_form" "region"
Then I should see "Reflection created by student"
And I should not see "Reflection created by teacher"
But I set the field "Title" to "Reflection"
And I set the field "Order" to "Descending"
And I click on "Save settings" "button" in the "data_adv_form" "region"
And "Reflection created by teacher" "text" should appear before "Reflection created by student" "text"
@javascript
Scenario: Journal. Users can add entries
Given I am on the "Student reflections" "data activity" page logged in as student1
When I press "Add entry"
And I set the field "Title" to "This is the title"
And I set the field "Content" to "This is the content for the new entry."
And I press "Save"
Then I should see "This is the title"
And I should see "This is the content for the new entry."
@javascript
Scenario: Journal. Renaming a field should affect the template
Given I am on the "Student reflections" "data activity" page logged in as teacher1
And I navigate to "Fields" in current page administration
And I open the action menu in "Content" "table_row"
And I choose "Edit" in the open action menu
And I set the field "Field name" to "Edited field name"
And I press "Save"
And I should see "Field updated"
When I navigate to "Database" in current page administration
Then I click on "Advanced search" "checkbox"
And I should see "Edited field name"
And I click on "Add entry" "button"
And I should see "Edited field name"
@javascript
Scenario: Journal. Has otherfields tag
Given the following "mod_data > fields" exist:
| database | type | name | description |
| data1 | text | Extra field | Test field description |
And I am on the "Student reflections" "data activity" page logged in as teacher1
When I click on "Add entry" "button"
Then I should see "Extra field"
+29
View File
@@ -0,0 +1,29 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Data Journal preset version information.
*
* @package datapreset_journal
* @copyright 2022 Sara Arjona <sara@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2024042200; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2024041600; // Requires this Moodle version.
$plugin->component = 'datapreset_journal'; // Full name of the plugin (used for diagnostics).