Skip to content

Commit

Permalink
Merge pull request #19 from Panopto/ahrnjica/2023083100-release-code
Browse files Browse the repository at this point in the history
2023083100 release code
  • Loading branch information
zeroAps authored Aug 31, 2023
2 parents 8e81ce0 + bfe6c24 commit 2ea32a3
Show file tree
Hide file tree
Showing 13 changed files with 511 additions and 63 deletions.
94 changes: 94 additions & 0 deletions classes/renderable/panoptosubmission_grading_summary.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?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/>.

/**
* This file contains the definition for the renderable classes for the submissions
*
* @package mod_panoptosubmission
* @copyright Panopto 2023
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

/**
* Renderable grading summary.
*
* @package mod_panoptosubmission
* @copyright Panopto 2023
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class panoptosubmission_grading_summary implements renderable {
/** @var int participantcount - The number of users who can submit to this submission */
public $participantcount = 0;
/** @var bool submissionsenabled - Allow submissions */
public $submissionsenabled = false;
/** @var int submissionssubmittedcount - The number of submissions in submitted status */
public $submissionssubmittedcount = 0;
/** @var int submissionsneedgradingcount - The number of submissions that need grading */
public $submissionsneedgradingcount = 0;
/** @var int duedate - The submission due date (if one is set) */
public $duedate = 0;
/** @var int cutoffdate - The submission cut off date (if one is set) */
public $cutoffdate = 0;
/** @var int timelimit - The submission time limit (if one is set) */
public $timelimit = 0;
/** @var int coursemoduleid - The submission course module id */
public $coursemoduleid = 0;
/** @var boolean relativedatesmode - Is the course a relative dates mode course or not */
public $courserelativedatesmode = false;
/** @var int coursestartdate - start date of the course as a unix timestamp*/
public $coursestartdate;
/** @var boolean isvisible - Is the submission's context module visible to students? */
public $isvisible = true;

/**
* constructor
*
* @param int $participantcount
* @param bool $submissionsenabled
* @param int $submissionssubmittedcount
* @param int $cutoffdate
* @param int $duedate
* @param int $timelimit
* @param int $coursemoduleid
* @param int $submissionsneedgradingcount
* @param bool $courserelativedatesmode true if the course is using relative dates, false otherwise.
* @param int $coursestartdate unix timestamp representation of the course start date.
* @param bool $isvisible
*/
public function __construct($participantcount,
$submissionsenabled,
$submissionssubmittedcount,
$cutoffdate,
$duedate,
$timelimit,
$coursemoduleid,
$submissionsneedgradingcount,
$courserelativedatesmode,
$coursestartdate,
$isvisible = true) {
$this->participantcount = $participantcount;
$this->submissionsenabled = $submissionsenabled;
$this->submissionssubmittedcount = $submissionssubmittedcount;
$this->duedate = $duedate;
$this->cutoffdate = $cutoffdate;
$this->timelimit = $timelimit;
$this->coursemoduleid = $coursemoduleid;
$this->submissionsneedgradingcount = $submissionsneedgradingcount;
$this->courserelativedatesmode = $courserelativedatesmode;
$this->coursestartdate = $coursestartdate;
$this->isvisible = $isvisible;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?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/>.

/**
* This file contains the definition for the renderable classes for the submissions
*
* @package mod_panoptosubmission
* @copyright Panopto 2023
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

/**
* Renderable feedback status
*
* @package mod_panoptosubmission
* @copyright Panopto 2023
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class panoptosubmission_submissions_feedback_status implements renderable {

/** @var string $gradefordisplay the student grade rendered into a format suitable for display */
public $gradefordisplay = '';
/** @var mixed the graded date (may be null) */
public $gradeddate = 0;
/** @var mixed the grader (may be null) */
public $grader = null;
/** @var stdClass grade record */
public $grade = null;
/** @var int coursemoduleid */
public $coursemoduleid = 0;
/** @var bool canviewfullnames */
public $canviewfullnames = false;

/**
* Constructor
* @param string $gradefordisplay
* @param mixed $gradeddate
* @param mixed $grader
* @param mixed $grade
* @param int $coursemoduleid
* @param bool $canviewfullnames
*/
public function __construct($gradefordisplay,
$gradeddate,
$grader,
$grade,
$coursemoduleid,
$canviewfullnames) {
$this->gradefordisplay = $gradefordisplay;
$this->gradeddate = $gradeddate;
$this->grader = $grader;
$this->grade = $grade;
$this->coursemoduleid = $coursemoduleid;
$this->canviewfullnames = $canviewfullnames;
}
}
2 changes: 1 addition & 1 deletion contentitem.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
$courseid = required_param('courseid', PARAM_INT);

/**
* Student Submission path.
* @var string Student Submission path.
*/
const STUDENT_SUBMISSION_PATH = '/mod/panoptosubmission/contentitem_return.php';

Expand Down
3 changes: 2 additions & 1 deletion grade_preferences_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ public function definition() {
$filters = array(
PANOPTOSUBMISSION_ALL => get_string('all', 'panoptosubmission'),
PANOPTOSUBMISSION_REQ_GRADING => get_string('reqgrading', 'panoptosubmission'),
PANOPTOSUBMISSION_SUBMITTED => get_string('submitted', 'panoptosubmission')
PANOPTOSUBMISSION_SUBMITTED => get_string('submitted', 'panoptosubmission'),
PANOPTOSUBMISSION_NOT_SUBMITTED => get_string('not_submitted', 'panoptosubmission')
);

$mform->addElement('select', 'filter', get_string('show'), $filters);
Expand Down
2 changes: 1 addition & 1 deletion grade_submissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
$userid, $gradedata->submissioncomment) && empty($gradedata->submissioncomment[$userid]
);

if ($emptygrade && $emptycomment ) {
if ($emptygrade && $emptycomment) {
continue;
}

Expand Down
16 changes: 16 additions & 0 deletions lang/en/panoptosubmission.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,22 @@
$string['fullname'] = 'Name';
$string['gradeverb'] = 'Grade';
$string['gradenoun'] = 'Grade';
$string['gradedon'] = 'Graded on';
$string['gradedby'] = 'Graded by';
$string['gradingsummary'] = 'Grading summary';
$string['numberofparticipants'] = 'Participants';
$string['numberofsubmittedassignments'] = 'Submitted';
$string['numberofsubmissionsneedgrading'] = 'Needs grading';
$string['timeremaining'] = 'Time remaining';
$string['hiddenfromstudents'] = 'Hidden from students';
$string['yes'] = 'Yes';
$string['no'] = 'No';
$string['submissionisdue'] = 'Submission is due';
$string['relativedatessubmissiontimeleft'] = 'Calculated for each student';
$string['latesubmissions'] = 'Late submissions';
$string['latesubmissionsaccepted'] = 'Allowed until {$a}';
$string['submissioncomment'] = 'Comment';
$string['submissioncommentfeedback'] = 'Comment Feedback';
$string['timemodified'] = 'Last modified (Submission)';
$string['grademodified'] = 'Last modified (Grade)';
$string['finalgrade'] = 'Final grade';
Expand All @@ -67,6 +82,7 @@
$string['all'] = 'All';
$string['reqgrading'] = 'Require grading';
$string['submitted'] = 'Submitted';
$string['not_submitted'] = 'Not submitted';
$string['pagesize'] = 'Submissions shown per page';
$string['pagesize_help'] = 'Set the number of assignment to display per page';
$string['show'] = 'Show';
Expand Down
10 changes: 3 additions & 7 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ function panoptosubmission_add_instance($newactivity) {
$newactivity->id = $DB->insert_record('panoptosubmission', $newactivity);

if ($newactivity->timedue) {
$event = new stdClass();

$event = new stdClass();
$event->name = $newactivity->name;
$event->description = format_module_intro('panoptosubmission', $newactivity, $newactivity->coursemodule, false);
$event->format = FORMAT_HTML;
Expand Down Expand Up @@ -262,12 +262,6 @@ function panoptosubmission_scale_used_anywhere($scaleid) {
*/
function panoptosubmission_supports($feature) {
switch($feature) {
case FEATURE_GROUPS:
return true;
case FEATURE_GROUPINGS:
return true;
case FEATURE_GROUPMEMBERSONLY:
return true;
case FEATURE_MOD_INTRO:
return true;
case FEATURE_COMPLETION_TRACKS_VIEWS:
Expand All @@ -280,6 +274,8 @@ function panoptosubmission_supports($feature) {
return true;
case FEATURE_BACKUP_MOODLE2:
return true;
case FEATURE_SHOW_DESCRIPTION;
return true;
default:
return null;
}
Expand Down
Loading

0 comments on commit 2ea32a3

Please sign in to comment.