Commit c3f1650d authored by Lückemeyer's avatar Lückemeyer
Browse files

restored util directory

1 merge request!1Coding style and recommendations
Showing with 36 additions and 35 deletions
+36 -35
No preview for this file type
......@@ -16,11 +16,6 @@
namespace assignsubmission_dta\privacy;
use core_privacy\local\metadata\collection;
use core_privacy\local\request\writer;
use core_privacy\local\request\contextlist;
use mod_assign\privacy\assign_plugin_request_data;
/**
* provider for data privacy
*
......@@ -28,6 +23,11 @@ use mod_assign\privacy\assign_plugin_request_data;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright Gero Lueckemeyer and student project teams
*/
use core_privacy\local\metadata\collection;
use core_privacy\local\request\writer;
use core_privacy\local\request\contextlist;
use mod_assign\privacy\assign_plugin_request_data;
class provider implements \core_privacy\local\metadata\provider,
\mod_assign\privacy\assignsubmission_provider,
\mod_assign\privacy\assignsubmission_user_provider {
......@@ -39,9 +39,9 @@ class provider implements \core_privacy\local\metadata\provider,
/**
* This is the metadata information for the assignsubmission_dta plugin.
* @param stdClass $collection the collection of metadata filled by the plugin
* @param collection $collection the collection of metadata filled by the plugin
*/
public static function get_metadata(stdClass $collection): collection {
public static function get_metadata(collection $collection): collection {
$collection->add_subsystem_link(
'core_files',
[],
......
......@@ -37,9 +37,9 @@ function assignsubmission_dta_pluginfile(
$course,
$cm,
context $context,
string $filearea,
$filearea,
$args,
bool $forcedownload
$forcedownload
) {
global $DB, $CFG;
......
......@@ -226,7 +226,7 @@ class assign_submission_dta extends assign_submission_plugin {
*
* @param int $submissionid submission id to check
* @param string $areaid filearea id to count
* @return int
* @return int number of files submitted in the filearea
*/
private function count_files(int $submissionid, string $areaid) {
$fs = get_file_storage();
......
......@@ -143,9 +143,9 @@ class DtaResultSummary {
/**
* Decodes the JSON result summary returned by the backend service call into the plugin PHP data structure.
* @param string $jsonstring jsonString containing DtaResultSummary
* @return DtaResultSummary
* @return DtaResultSummary the result summary
*/
public static function decodejson($jsonstring): DtaResultSummary {
public static function decodejson(string $jsonstring): DtaResultSummary {
$response = json_decode($jsonstring);
$summary = new DtaResultSummary();
......@@ -188,6 +188,7 @@ class DtaResultSummary {
return $ret;
}
/**
* Returns the number of detail results attached to the summary.
* @return int count of occurences
......
......@@ -14,6 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains the backend webservice contact functionality for the DTA plugin
*
* @package assignsubmission_dta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright Gero Lueckemeyer and student project teams
*/
/**
* backend webservice contact utility class
*
......@@ -40,11 +48,11 @@ class DtaBackendUtils {
/**
* Sends the configuration textfile uploaded by prof to the backend.
*
* @param stdClass $assignment assignment this test-config belongs to
* @param stdClass $file uploaded test-config
* @param $assignment assignment this test-config belongs to
* @param $file uploaded test-config
* @return bool true if no error occurred
*/
public static function sendtestconfigtobackend(stdClass $assignment, $file): bool {
public static function sendtestconfigtobackend($assignment, $file): bool {
$backendaddress = self::getbackendbaseurl();
if (empty($backendaddress)) {
return true;
......@@ -70,11 +78,11 @@ class DtaBackendUtils {
/**
* Sends sumbission config or archive to backend to be tested.
*
* @param stdClass $assignment assignment this submission is done for
* @param stdClass $file submission config file or archive with submission
* @param $assignment assignment this submission is done for
* @param $file submission config file or archive with submission
* @return string json string with testresults or null on error
*/
public static function sendsubmissiontobackend(stdClass $assignment, $file): ?string {
public static function sendsubmissiontobackend($assignment, $file): ?string {
$backendaddress = self::getbackendbaseurl();
if (empty($backendaddress)) {
return true;
......
......@@ -14,14 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* persistence layer utility class
*
* @package assignsubmission_dta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright Gero Lueckemeyer and student project teams
*/
/**
* persistence layer utility class
*
......@@ -45,7 +37,7 @@ class DbUtils {
*
* @param int $assignmentid assignment id to search for
* @param int $submissionid submission id to search for
* @return DtaResultSummary representing given submission
* @return DttResultSummary representing given submission
*/
public static function getresultsummaryfromdatabase(
int $assignmentid,
......@@ -96,9 +88,9 @@ class DbUtils {
* save given result summary and single results to database
* under given assignment and submission id
*
* @param int $assignmentid assigment this is submission is linked to
* @param int $submissionid submission of this result
* @param DtaResultSummary $summary instance to persist
* @param $assignmentid assigment this is submission is linked to
* @param $submissionid submission of this result
* @param $summary instance to persist
*/
public static function storeresultsummarytodatabase(
int $assignmentid,
......
......@@ -31,8 +31,8 @@ class view_submission_utils {
/**
* generates a short summary html
*
* @param int $assignmentid id of the assignment
* @param int $submissionid id of the submission for which to create a report
* @param $assignmentid assignment
* @param $submissionid submission to create a report for
* @return string html
*/
public static function generatesummaryhtml(
......@@ -87,8 +87,8 @@ class view_submission_utils {
/**
* generates detailed view html
*
* @param int $assignmentid id of the assignment
* @param int $submissionid id of the submission for which to create a report
* @param $assignmentid assignment
* @param $submissionid submission to create a report for
*/
public static function generatedetailhtml(
int $assignmentid,
......
......@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 3000000;
$plugin->requires = 2020061525; // Moodle 3.9 LTS. Will likely run with unsupported older versions of the 3.x branch.
$plugin->requires = 2020061525; // Moodle 3.9 LTS. Older unsupported versions from the 3.x branch should also work.
$plugin->component = 'assignsubmission_dta';
$plugin->maturity = MATURITY_STABLE;
$plugin->release = "3.0.0";
Supports Markdown
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