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

restored util directory

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