Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mdl26 uon fixes #7

Open
wants to merge 9 commits into
base: MOODLE_26_STABLE
Choose a base branch
from
64 changes: 32 additions & 32 deletions db/install.xml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="mod/kalvidassign/db" VERSION="20111206" COMMENT="XMLDB file for Moodle mod/kalvidassign"
<XMLDB PATH="mod/kalvidassign/db" VERSION="20140606" COMMENT="XMLDB file for Moodle mod/kalvidassign"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="kalvidassign" COMMENT="Kaltura video assignment module instances are stored here" NEXT="kalvidassign_submission">
<TABLE NAME="kalvidassign" COMMENT="Kaltura video assignment module instances are stored here">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="course"/>
<FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Course id" PREVIOUS="id" NEXT="name"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="course" NEXT="intro"/>
<FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="name" NEXT="introformat"/>
<FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="intro" NEXT="timeavailable"/>
<FIELD NAME="timeavailable" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Time the assignment is available for student submission" PREVIOUS="introformat" NEXT="timedue"/>
<FIELD NAME="timedue" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="The time the assignment submissions are due by" PREVIOUS="timeavailable" NEXT="preventlate"/>
<FIELD NAME="preventlate" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Prevent late submissions" PREVIOUS="timedue" NEXT="resubmit"/>
<FIELD NAME="resubmit" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Allow for resubmissions" PREVIOUS="preventlate" NEXT="emailteachers"/>
<FIELD NAME="emailteachers" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Email submissions to the teacher" PREVIOUS="resubmit" NEXT="grade"/>
<FIELD NAME="grade" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Maximum grade the assignment is worth" PREVIOUS="emailteachers" NEXT="timecreated"/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Time the assignment was created" PREVIOUS="grade" NEXT="timemodified"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="The time the assignment settings were modified" PREVIOUS="timecreated"/>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Course id"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="intro" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="timeavailable" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Time the assignment is available for student submission"/>
<FIELD NAME="timedue" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The time the assignment submissions are due by"/>
<FIELD NAME="preventlate" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Prevent late submissions"/>
<FIELD NAME="resubmit" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Allow for resubmissions"/>
<FIELD NAME="emailteachers" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Email submissions to the teacher"/>
<FIELD NAME="grade" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Maximum grade the assignment is worth"/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Time the assignment was created"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The time the assignment settings were modified"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
Expand All @@ -27,29 +27,29 @@
<INDEX NAME="kal_course_idx" UNIQUE="false" FIELDS="course" COMMENT="index on course"/>
</INDEXES>
</TABLE>
<TABLE NAME="kalvidassign_submission" COMMENT="Kaltura video assignment submissions" PREVIOUS="kalvidassign">
<TABLE NAME="kalvidassign_submission" COMMENT="Kaltura video assignment submissions">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="vidassignid"/>
<FIELD NAME="vidassignid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Foreign key to the kalvidassign table" PREVIOUS="id" NEXT="userid"/>
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Moodle user id" PREVIOUS="vidassignid" NEXT="entry_id"/>
<FIELD NAME="entry_id" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" COMMENT="Kaltura entry id" PREVIOUS="userid" NEXT="grade"/>
<FIELD NAME="grade" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Grade score for the submission" PREVIOUS="entry_id" NEXT="submissioncomment"/>
<FIELD NAME="submissioncomment" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" COMMENT="Submission teacher comment" PREVIOUS="grade" NEXT="format"/>
<FIELD NAME="format" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="submissioncomment" NEXT="teacher"/>
<FIELD NAME="teacher" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Moodle userId of the teacher who marked the submission" PREVIOUS="format" NEXT="mailed"/>
<FIELD NAME="mailed" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether the assignment submission notification has been emailed to the teacher." PREVIOUS="teacher" NEXT="timemarked"/>
<FIELD NAME="timemarked" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Time the assignment submission was marked" PREVIOUS="mailed" NEXT="timecreated"/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Time the submission record was created" PREVIOUS="timemarked" NEXT="timemodified"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Time the assignment submission was modified" PREVIOUS="timecreated"/>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="vidassignid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Foreign key to the kalvidassign table"/>
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Moodle user id"/>
<FIELD NAME="entry_id" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" COMMENT="Kaltura entry id"/>
<FIELD NAME="grade" TYPE="int" LENGTH="11" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Grade score for the submission"/>
<FIELD NAME="submissioncomment" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="Submission teacher comment"/>
<FIELD NAME="format" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="teacher" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Moodle userId of the teacher who marked the submission"/>
<FIELD NAME="mailed" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether the assignment submission notification has been emailed to the teacher."/>
<FIELD NAME="timemarked" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Time the assignment submission was marked"/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Time the submission record was created"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Time the assignment submission was modified"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
<INDEXES>
<INDEX NAME="kal_vid_assign_idx" UNIQUE="false" FIELDS="vidassignid" COMMENT="Index on the kaltura assignment id" NEXT="kal_userid_idx"/>
<INDEX NAME="kal_userid_idx" UNIQUE="false" FIELDS="userid" COMMENT="Index on the Moodle userid" PREVIOUS="kal_vid_assign_idx" NEXT="kal_marked_idx"/>
<INDEX NAME="kal_marked_idx" UNIQUE="false" FIELDS="timemarked" COMMENT="Index on the submission marked field" PREVIOUS="kal_userid_idx" NEXT="kal_mailed_idx"/>
<INDEX NAME="kal_mailed_idx" UNIQUE="false" FIELDS="mailed" COMMENT="Index on the mailed field" PREVIOUS="kal_marked_idx"/>
<INDEX NAME="kal_vid_assign_idx" UNIQUE="false" FIELDS="vidassignid" COMMENT="Index on the kaltura assignment id"/>
<INDEX NAME="kal_userid_idx" UNIQUE="false" FIELDS="userid" COMMENT="Index on the Moodle userid"/>
<INDEX NAME="kal_marked_idx" UNIQUE="false" FIELDS="timemarked" COMMENT="Index on the submission marked field"/>
<INDEX NAME="kal_mailed_idx" UNIQUE="false" FIELDS="mailed" COMMENT="Index on the mailed field"/>
</INDEXES>
</TABLE>
</TABLES>
Expand Down
6 changes: 3 additions & 3 deletions grade_preferences_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@
class kalvidassign_gradepreferences_form extends moodleform {

function definition() {
global $CFG, $COURSE, $USER;
global $COURSE, $USER;

$mform =& $this->_form;

$mform->addElement('hidden', 'cmid', $this->_customdata['cmid']);
$mform->setType('cmid', PARAM_INT);

$mform->addElement('header', 'kal_vid_subm_hdr', get_string('optionalsettings', 'kalvidassign'));


$context = get_context_instance(CONTEXT_MODULE, $this->_customdata['cmid']);
$context = context_module::instance($this->_customdata['cmid']);

$group_opt = array();
$groups = array();
Expand Down
4 changes: 2 additions & 2 deletions grade_submissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
print_error('invalidcoursemodule');
}

if (! $course = $DB->get_record('course', array('id' => $cm->course))) {
if (! $course = get_course($cm->course)) {
print_error('coursemisconf');
}

Expand Down Expand Up @@ -115,7 +115,7 @@

echo $OUTPUT->header();

require_capability('mod/kalvidassign:gradesubmission', get_context_instance(CONTEXT_MODULE, $cm->id));
require_capability('mod/kalvidassign:gradesubmission', context_module::instance($cm->id));

add_to_log($course->id, 'kalvidassign', 'view submissions page', 'grade_submissions.php?cmid='.$cm->id, $kalvidassignobj->id, $cm->id);

Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

$id = required_param('id', PARAM_INT); // Course ID.

$course = $DB->get_record('course', array('id' => $id), '*', MUST_EXIST);
$course = get_course($id);

require_login($course);

Expand Down
1 change: 0 additions & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ function kalvidassign_supports($feature) {
* @return int, 0 if ok, error code otherwise
*/
function kalvidassign_grade_item_update($kalvidassign, $grades=NULL) {
global $CFG;

require_once(dirname(dirname(dirname(__FILE__))) . '/lib/gradelib.php');

Expand Down
11 changes: 4 additions & 7 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ function kalvidassign_assignemnt_submission_expired($kalvidassign) {
}

function kalvidassign_submissions($mode) {
//make user global so we can use the id
global $USER, $OUTPUT, $DB, $PAGE;

$mailinfo = optional_param('mailinfo', null, PARAM_BOOL);

Expand Down Expand Up @@ -83,11 +81,11 @@ function kalvidassign_submissions($mode) {

/**
* Retrieve a list of users who have submitted assignments
*
*
* @param int - assignment instance id
* @param string - filter results by assignments that have been submitted or
* assignment that need to be graded or no filter at all
*
*
* @return mixed - collection of users or false
*/
function kalvidassign_get_submissions($kalvidassignid, $filter = '') {
Expand Down Expand Up @@ -359,11 +357,10 @@ function kalvidassign_email_teachers_html($info) {


function kalvidassign_get_assignment_students($cm) {
global $CFG;

$context = get_context_instance(CONTEXT_MODULE, $cm->id);
$context = context_module::instance($cm->id);
$users = get_enrolled_users($context, 'mod/kalvidassign:submit', 0, 'u.id');

return $users;
}

Expand Down
Binary file removed pix/icon.gif
Binary file not shown.
Binary file added pix/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading