MDL-52954 assign: Fix the reasonable cibot warnings.

This commit is contained in:
Damyon Wiese 2016-03-30 14:07:28 +08:00
parent 07a7d9a5f1
commit 6853cd5ed4
15 changed files with 51 additions and 47 deletions

View File

@ -2408,8 +2408,8 @@ class file_storage {
$rs->close();
mtrace('done.');
// remove orphaned converted files (that is files in the core documentconversion filearea without
// the existing original file)
// Remove orphaned converted files (that is files in the core documentconversion filearea without
// the existing original file).
mtrace('Deleting orphaned document conversion files... ', '');
cron_trace_time_and_memory();
$sql = "SELECT p.*

View File

@ -161,7 +161,8 @@ abstract class moodleform {
* @param bool $editable
* @param array $ajaxformdata Forms submitted via ajax, must pass their data here, instead of relying on _GET and _POST.
*/
public function __construct($action=null, $customdata=null, $method='post', $target='', $attributes=null, $editable=true, $ajaxformdata=null) {
public function __construct($action=null, $customdata=null, $method='post', $target='', $attributes=null, $editable=true,
$ajaxformdata=null) {
global $CFG, $FULLME;
// no standard mform in moodle should allow autocomplete with the exception of user signup
if (empty($attributes)) {

View File

@ -18,7 +18,6 @@
* Test unoconv functionality.
*
* @package core
* @category phpunit
* @copyright 2016 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@ -30,13 +29,14 @@ defined('MOODLE_INTERNAL') || die();
* A set of tests for some of the unoconv functionality within Moodle.
*
* @package core
* @category phpunit
* @copyright 2016 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class core_unoconv_testcase extends advanced_testcase {
/** @var $testfile1 */
private $testfile1 = null;
/** @var $testfile2 */
private $testfile2 = null;
public function setUp() {

View File

@ -42,17 +42,17 @@ use stdClass;
class grading_app implements templatable, renderable {
/**
* The initial user id.
* @var $userid - The initial user id.
*/
public $userid = 0;
/**
* The initial group id.
* @var $groupid - The initial group id.
*/
public $groupid = 0;
/**
* The assignment instance.
* @var $assignment - The assignment instance.
*/
public $assignment = null;

View File

@ -1537,9 +1537,11 @@ class mod_assign_external extends external_api {
require_once($CFG->dirroot . '/mod/assign/gradeform.php');
$params = self::validate_parameters(self::submit_grading_form_parameters(),
array('assignmentid' => $assignmentid,
'userid' => $userid,
'jsonformdata' => $jsonformdata));
array(
'assignmentid' => $assignmentid,
'userid' => $userid,
'jsonformdata' => $jsonformdata
));
$cm = get_coursemodule_from_instance('assign', $params['assignmentid'], 0, false, MUST_EXIST);
$context = context_module::instance($cm->id);
@ -1554,10 +1556,12 @@ class mod_assign_external extends external_api {
$warnings = array();
$options = array('userid'=>$params['userid'],
'attemptnumber'=>$data['attemptnumber'],
'rownum'=>0,
'gradingpanel' => true);
$options = array(
'userid' => $params['userid'],
'attemptnumber' => $data['attemptnumber'],
'rownum' => 0,
'gradingpanel' => true
);
$customdata = (object) $data;
$formparams = array($assignment, $customdata, $options);
@ -2582,7 +2586,7 @@ class mod_assign_external extends external_api {
'filter' => new external_value(PARAM_RAW, 'search string to filter the results'),
'skip' => new external_value(PARAM_INT, 'number of records to skip', VALUE_DEFAULT, 0),
'limit' => new external_value(PARAM_INT, 'maximum number of records to return', VALUE_DEFAULT, 0),
'onlyids' => new external_value(PARAM_BOOL, 'Do not return all user fields - only the id and flags (requiresgrading etc)', VALUE_DEFAULT, false),
'onlyids' => new external_value(PARAM_BOOL, 'Do not return all user fields', VALUE_DEFAULT, false),
)
);
}

View File

@ -24,7 +24,9 @@
namespace assignfeedback_editpdf\event;
/**
* Simple task to run the grade cron.
* An event observer.
* @copyright 2016 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class observer {

View File

@ -210,8 +210,10 @@ class assignfeedback_editpdf_renderer extends plugin_renderer_base {
$canvas = html_writer::div($loading, 'drawingcanvas');
$canvas = html_writer::div($canvas, 'drawingregion');
$changesmessage = html_writer::tag('div',
get_string('draftchangessaved', 'assignfeedback_editpdf'),
array('class'=>'assignfeedback_editpdf_unsavedchanges warning label label-info'));
get_string('draftchangessaved', 'assignfeedback_editpdf'),
array(
'class' => 'assignfeedback_editpdf_unsavedchanges warning label label-info'
));
$changesmessage = html_writer::div($changesmessage, 'unsaved-changes');
$canvas .= $changesmessage;

View File

@ -29,7 +29,9 @@ use context_module;
use assign;
/**
* Simple task to run the grade cron.
* Simple task to convert submissions to pdf in the background.
* @copyright 2016 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class convert_submissions extends scheduled_task {

View File

@ -15,13 +15,9 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Definition of core scheduled tasks.
* Definition of editpdf scheduled tasks.
*
* The handlers defined on this file are processed and registered into
* the Moodle DB after any install or upgrade operation. All plugins
* support this.
*
* @package core
* @package mod_assign
* @category task
* @copyright 2016 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

View File

@ -65,7 +65,5 @@ function xmldb_assignfeedback_editpdf_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2016021600, 'assignfeedback', 'editpdf');
}
return true;
}

View File

@ -834,7 +834,7 @@ class assign_grading_table extends table_sql implements renderable {
if (!$this->is_downloading() && $this->hasgrade) {
$urlparams = array('id' => $this->assignment->get_course_module()->id,
'rownum'=> 0,
'rownum' => 0,
'action' => 'grader',
'userid' => $row->userid);
$url = new moodle_url('/mod/assign/view.php', $urlparams);

View File

@ -1426,7 +1426,6 @@ class assign {
* If this is a group assignment, group info is also returned.
*
* @param int $currentgroup
* @param bool $idsonly
* @return array List of user records with extra fields 'submitted', 'notsubmitted', 'requiregrading', 'groupid', 'groupname'
*/
public function list_participants_with_filter_status_and_group($currentgroup) {
@ -3250,17 +3249,17 @@ class assign {
$allsubmissions = $this->get_all_submissions($userid);
if ($attemptnumber != -1 && ($attemptnumber + 1) != count($allsubmissions)) {
$params = array('attemptnumber'=>$attemptnumber + 1,
'totalattempts'=>count($allsubmissions));
$params = array('attemptnumber' => $attemptnumber + 1,
'totalattempts' => count($allsubmissions));
$message = get_string('editingpreviousfeedbackwarning', 'assign', $params);
$o .= $this->get_renderer()->notification($message);
}
$pagination = array('rownum'=>$rownum,
'useridlistid'=>0,
'last'=>$last,
'userid'=>$userid,
'attemptnumber'=>$attemptnumber,
$pagination = array('rownum' => $rownum,
'useridlistid' => 0,
'last' => $last,
'userid' => $userid,
'attemptnumber' => $attemptnumber,
'gradingpanel' => true);
if (!empty($args['formdata'])) {
@ -3272,7 +3271,7 @@ class assign {
$formparams,
'post',
'',
array('class'=>'gradeform'));
array('class' => 'gradeform'));
if (!empty($args['formdata'])) {
// If we were passed form data - we want the form to check the data
@ -6735,7 +6734,7 @@ class assign {
if (!$gradingpanel) {
$buttonarray=array();
$buttonarray = array();
$name = get_string('savechanges', 'assign');
$buttonarray[] = $mform->createElement('submit', 'savegrade', $name);
if (!$last) {
@ -6745,7 +6744,7 @@ class assign {
$buttonarray[] = $mform->createElement('cancel', 'cancelbutton', get_string('cancel'));
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
$mform->closeHeaderBefore('buttonar');
$buttonarray=array();
$buttonarray = array();
if ($rownum > 0) {
$name = get_string('previous', 'assign');

View File

@ -634,8 +634,8 @@ class assign_attempt_history_chooser implements renderable, templatable {
$submissionsummary = get_string('nosubmission', 'assign');
}
$attemptsummaryparams = array('attemptnumber'=>$submission->attemptnumber+1,
'submissionsummary'=>$submissionsummary);
$attemptsummaryparams = array('attemptnumber' => $submission->attemptnumber + 1,
'submissionsummary' => $submissionsummary);
$submission->attemptsummary = get_string('attemptheading', 'assign', $attemptsummaryparams);
$submission->statussummary = get_string('submissionstatus_' . $submission->status, 'assign');

View File

@ -337,10 +337,10 @@ class mod_assign_renderer extends plugin_renderer_base {
// Link to the grading page.
$o .= '<center>';
$o .= $this->output->container_start('submissionlinks btn-group');
$urlparams = array('id' => $summary->coursemoduleid, 'action'=>'grading');
$urlparams = array('id' => $summary->coursemoduleid, 'action' => 'grading');
$url = new moodle_url('/mod/assign/view.php', $urlparams);
$o .= '<a href="' . $url . '" class="btn">' . get_string('viewgrading', 'mod_assign') . '</a>';
$urlparams = array('id' => $summary->coursemoduleid, 'action'=>'grader');
$urlparams = array('id' => $summary->coursemoduleid, 'action' => 'grader');
$url = new moodle_url('/mod/assign/view.php', $urlparams);
$o .= '<a href="' . $url . '" class="btn btn-primary">' . get_string('grade') . '</a>';
$o .= $this->output->container_end();
@ -478,7 +478,7 @@ class mod_assign_renderer extends plugin_renderer_base {
$members = $status->submissiongroupmemberswhoneedtosubmit;
$userslist = array();
foreach ($members as $member) {
$urlparams = array('id' => $member->id, 'course'=>$status->courseid);
$urlparams = array('id' => $member->id, 'course' => $status->courseid);
$url = new moodle_url('/user/view.php', $urlparams);
if ($status->view == assign_submission_status::GRADER_VIEW && $status->blindmarking) {
$userslist[] = $member->alias;
@ -1456,7 +1456,7 @@ class mod_assign_renderer extends plugin_renderer_base {
/**
* Defer to template..
*
* @param grading_app - All the data to render the grading app.
* @param grading_app $app - All the data to render the grading app.
*/
public function render_grading_app(grading_app $app) {
$context = $app->export_for_template($this);

View File

@ -955,7 +955,7 @@
}
.path-mod-assign [data-region="grade-panel"] .mform .fitem .fcheckbox > span,
.path-mod-assign [data-region="grade-panel"] .mform .fitem .fradio > span,
.path-mod-assign [data-region="grade-panel"] .mform .fitem .fgroup > span,
.path-mod-assign [data-region="grade-panel"] .mform .fitem .fgroup > span {
margin-top: 4px;
}
.path-mod-assign [data-region="grade-panel"] .mform .femptylabel .fitemtitle {