You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

171 lines
12 KiB

<?xml version="1.0" encoding="UTF-8" ?>
Qr rotation dev (#400) * Fix #378 - Removing sesskey requirement for viewing attendance.php * Fix #378 - Show password icon when only QR code is selected. * Fix #378 - Refactor/Add functionality for QR Code &amp; No Password * Changes to DB structure for rotateqrcode feature * Added Rotate QR code function * Adding new field to settings and DB create/update functions * Added function to check QR code pass and cookies, error messages. * Added function to return QR passwords as JSON * Moved unix timestamp generation to PHP * Added function that outputs JS to render the rotation code * Add QR code library qrcode.js * Added code to display and rotate the QR code. * Ammended password.php to not show text password when rotating. * Load information from database earlier, fixed check for password * Set expiry time for cookie * Autofill password for authenticated rotateqrcode users * Disable conflicting settings if rotateqr is enabled * Updating version number * Added maximum length to password field and amended key, name for table * Ammend upgrade.php to update db structure for qrcode rotation * Add id column to attendance_rotate_passwords * Removed interval setting from session. Using plugin setting instead. * Amend return passwords function * Update version numbers for DB/version.php * Hide rotate option when students cannot mark on update page. * Show QR icon when rotateqrcode is enabled. * Rename qrcoderotate JS file, frakenstyle * Add qrcode.js to thirdpartylibs.xml * Generate random password when rotateqrcode session is updated. * Add qrcodesecret column to database * Use separate password for rotateqrcode cookie * Remove unnecessary qrcodeinterval database field * Replacing $_GET with optional_param * Clarified time unit (seconds) for Rotate QR Code strings. * Moved rotateqrcodeinterval under studentscanmark setting * Fix code formatting in attendance.php and locallib.php * Add rotateqrcodesecret to structure * Add task to clear temporary qrrotation passwords * Functionality to allow password to be accepted if expired within 2sec * Documenting class clear_temporary_passwords * Updating delete temporary passwords task
6 years ago
<XMLDB PATH="mod/attendance/db" VERSION="20190622" COMMENT="XMLDB file for Moodle mod/attendance"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="attendance" COMMENT="Attendance module table">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" COMMENT="id of the table, please edit me"/>
<FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="grade" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="100" SEQUENCE="false" COMMENT="This is maximum grade for instance"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The time the settings for this attendance instance were last modified."/>
<FIELD NAME="intro" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="This field is a requirement for activity modules."/>
<FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="This field is a requirement for activity modules."/>
<FIELD NAME="subnet" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="Default subnet used when creating sessions."/>
<FIELD NAME="sessiondetailspos" TYPE="char" LENGTH="5" NOTNULL="true" DEFAULT="left" SEQUENCE="false" COMMENT="Position for the session detail columns related to summary columns."/>
<FIELD NAME="showsessiondetails" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="Define if session details should be shown in reports."/>
<FIELD NAME="showextrauserdetails" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="Define if extra user details should be shown in reports."/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for attendance"/>
</KEYS>
<INDEXES>
<INDEX NAME="course" UNIQUE="false" FIELDS="course"/>
</INDEXES>
</TABLE>
<TABLE NAME="attendance_sessions" COMMENT="attendance_sessions table">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="attendanceid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="sessdate" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="duration" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="lasttaken" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="lasttakenby" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="description" TYPE="text" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="descriptionformat" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="studentscanmark" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="autoassignstatus" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="studentpassword" TYPE="char" LENGTH="50" NOTNULL="false" DEFAULT="" SEQUENCE="false"/>
<FIELD NAME="subnet" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="Restrict ability for students to mark by subnet."/>
<FIELD NAME="automark" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="automarkcompleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="statusset" TYPE="int" LENGTH="5" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Which set of statuses to use"/>
<FIELD NAME="absenteereport" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
<FIELD NAME="preventsharedip" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="preventsharediptime" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="caleventid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="calendarevent" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
<FIELD NAME="includeqrcode" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Include a QR code image when displaying the password"/>
Qr rotation dev (#400) * Fix #378 - Removing sesskey requirement for viewing attendance.php * Fix #378 - Show password icon when only QR code is selected. * Fix #378 - Refactor/Add functionality for QR Code &amp; No Password * Changes to DB structure for rotateqrcode feature * Added Rotate QR code function * Adding new field to settings and DB create/update functions * Added function to check QR code pass and cookies, error messages. * Added function to return QR passwords as JSON * Moved unix timestamp generation to PHP * Added function that outputs JS to render the rotation code * Add QR code library qrcode.js * Added code to display and rotate the QR code. * Ammended password.php to not show text password when rotating. * Load information from database earlier, fixed check for password * Set expiry time for cookie * Autofill password for authenticated rotateqrcode users * Disable conflicting settings if rotateqr is enabled * Updating version number * Added maximum length to password field and amended key, name for table * Ammend upgrade.php to update db structure for qrcode rotation * Add id column to attendance_rotate_passwords * Removed interval setting from session. Using plugin setting instead. * Amend return passwords function * Update version numbers for DB/version.php * Hide rotate option when students cannot mark on update page. * Show QR icon when rotateqrcode is enabled. * Rename qrcoderotate JS file, frakenstyle * Add qrcode.js to thirdpartylibs.xml * Generate random password when rotateqrcode session is updated. * Add qrcodesecret column to database * Use separate password for rotateqrcode cookie * Remove unnecessary qrcodeinterval database field * Replacing $_GET with optional_param * Clarified time unit (seconds) for Rotate QR Code strings. * Moved rotateqrcodeinterval under studentscanmark setting * Fix code formatting in attendance.php and locallib.php * Add rotateqrcodesecret to structure * Add task to clear temporary qrrotation passwords * Functionality to allow password to be accepted if expired within 2sec * Documenting class clear_temporary_passwords * Updating delete temporary passwords task
6 years ago
<FIELD NAME="rotateqrcode" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="rotateqrcodesecret" TYPE="char" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="automarkcmid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for attendance_sessions"/>
</KEYS>
<INDEXES>
<INDEX NAME="attendanceid" UNIQUE="false" FIELDS="attendanceid"/>
<INDEX NAME="groupid" UNIQUE="false" FIELDS="groupid"/>
<INDEX NAME="sessdate" UNIQUE="false" FIELDS="sessdate"/>
<INDEX NAME="caleventid" UNIQUE="false" FIELDS="caleventid"/>
</INDEXES>
</TABLE>
<TABLE NAME="attendance_log" COMMENT="attendance_log table retrofitted from MySQL">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="sessionid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="studentid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="statusid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="link with attendance_status table"/>
<FIELD NAME="statusset" TYPE="char" LENGTH="1333" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="timetaken" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="When attendance of this student was taken"/>
<FIELD NAME="takenby" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="remarks" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="ipaddress" TYPE="char" LENGTH="45" NOTNULL="false" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for attendance_log"/>
</KEYS>
<INDEXES>
<INDEX NAME="sessionid" UNIQUE="false" FIELDS="sessionid"/>
<INDEX NAME="studentid" UNIQUE="false" FIELDS="studentid"/>
<INDEX NAME="statusid" UNIQUE="false" FIELDS="statusid"/>
</INDEXES>
</TABLE>
<TABLE NAME="attendance_statuses" COMMENT="attendance_statuses table retrofitted from MySQL">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="attendanceid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="acronym" TYPE="char" LENGTH="2" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="description" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="grade" TYPE="number" LENGTH="5" NOTNULL="true" DEFAULT="0" SEQUENCE="false" DECIMALS="2"/>
<FIELD NAME="studentavailability" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" COMMENT="How many minutes this status is available when self marking is enabled."/>
<FIELD NAME="setunmarked" TYPE="int" LENGTH="2" NOTNULL="false" SEQUENCE="false" COMMENT="Set this status if unmarked at end of session."/>
<FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
<FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="setnumber" TYPE="int" LENGTH="5" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Allows different sets of statuses to be allocated to different sessions"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for attendance_settings"/>
</KEYS>
<INDEXES>
<INDEX NAME="attendanceid" UNIQUE="false" FIELDS="attendanceid"/>
<INDEX NAME="visible" UNIQUE="false" FIELDS="visible"/>
<INDEX NAME="deleted" UNIQUE="false" FIELDS="deleted"/>
</INDEXES>
</TABLE>
<TABLE NAME="attendance_tempusers" COMMENT="Stores temporary users details">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="studentid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" COMMENT="student id"/>
<FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" COMMENT="course id"/>
<FIELD NAME="fullname" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false" COMMENT="temp user fullname"/>
<FIELD NAME="email" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false" COMMENT="temporary user email"/>
<FIELD NAME="created" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" COMMENT="unix timestamp for temp user creation"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
<INDEXES>
<INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
<INDEX NAME="studentid" UNIQUE="true" FIELDS="studentid"/>
</INDEXES>
</TABLE>
<TABLE NAME="attendance_warning" COMMENT="Warning configuration">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="idnumber" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="attendance id or other id relating to this warning."/>
<FIELD NAME="warningpercent" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Percentage that triggers this warning."/>
<FIELD NAME="warnafter" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Start warning after this number of taken sessions."/>
<FIELD NAME="maxwarn" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="Maximum number of warnings to send."/>
<FIELD NAME="emailuser" TYPE="int" LENGTH="4" NOTNULL="true" SEQUENCE="false" COMMENT="Should the user be notified at this level."/>
<FIELD NAME="emailsubject" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="Email subject line for emails going to user"/>
<FIELD NAME="emailcontent" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="The html-formatted text that should be sent to the user"/>
<FIELD NAME="emailcontentformat" TYPE="int" LENGTH="4" NOTNULL="true" SEQUENCE="false" COMMENT="Format of the emailcontent field"/>
<FIELD NAME="thirdpartyemails" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="list of extra users to receive warnings"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="level_id" TYPE="unique" FIELDS="idnumber, warningpercent, warnafter"/>
</KEYS>
</TABLE>
<TABLE NAME="attendance_warning_done" COMMENT="Warnings processed">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="notifyid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="id of warning"/>
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="user id of user"/>
<FIELD NAME="timesent" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Time warning sent to user."/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
<INDEXES>
<INDEX NAME="notifyid_userid" UNIQUE="false" FIELDS="notifyid, userid"/>
</INDEXES>
</TABLE>
Qr rotation dev (#400) * Fix #378 - Removing sesskey requirement for viewing attendance.php * Fix #378 - Show password icon when only QR code is selected. * Fix #378 - Refactor/Add functionality for QR Code &amp; No Password * Changes to DB structure for rotateqrcode feature * Added Rotate QR code function * Adding new field to settings and DB create/update functions * Added function to check QR code pass and cookies, error messages. * Added function to return QR passwords as JSON * Moved unix timestamp generation to PHP * Added function that outputs JS to render the rotation code * Add QR code library qrcode.js * Added code to display and rotate the QR code. * Ammended password.php to not show text password when rotating. * Load information from database earlier, fixed check for password * Set expiry time for cookie * Autofill password for authenticated rotateqrcode users * Disable conflicting settings if rotateqr is enabled * Updating version number * Added maximum length to password field and amended key, name for table * Ammend upgrade.php to update db structure for qrcode rotation * Add id column to attendance_rotate_passwords * Removed interval setting from session. Using plugin setting instead. * Amend return passwords function * Update version numbers for DB/version.php * Hide rotate option when students cannot mark on update page. * Show QR icon when rotateqrcode is enabled. * Rename qrcoderotate JS file, frakenstyle * Add qrcode.js to thirdpartylibs.xml * Generate random password when rotateqrcode session is updated. * Add qrcodesecret column to database * Use separate password for rotateqrcode cookie * Remove unnecessary qrcodeinterval database field * Replacing $_GET with optional_param * Clarified time unit (seconds) for Rotate QR Code strings. * Moved rotateqrcodeinterval under studentscanmark setting * Fix code formatting in attendance.php and locallib.php * Add rotateqrcodesecret to structure * Add task to clear temporary qrrotation passwords * Functionality to allow password to be accepted if expired within 2sec * Documenting class clear_temporary_passwords * Updating delete temporary passwords task
6 years ago
<TABLE NAME="attendance_rotate_passwords" COMMENT="Table to hold temporary passwords for rotate QR code feature.">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="attendanceid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="password" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="expirytime" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="id" TYPE="primary" FIELDS="id"/>
</KEYS>
</TABLE>
</TABLES>
Qr rotation dev (#400) * Fix #378 - Removing sesskey requirement for viewing attendance.php * Fix #378 - Show password icon when only QR code is selected. * Fix #378 - Refactor/Add functionality for QR Code &amp; No Password * Changes to DB structure for rotateqrcode feature * Added Rotate QR code function * Adding new field to settings and DB create/update functions * Added function to check QR code pass and cookies, error messages. * Added function to return QR passwords as JSON * Moved unix timestamp generation to PHP * Added function that outputs JS to render the rotation code * Add QR code library qrcode.js * Added code to display and rotate the QR code. * Ammended password.php to not show text password when rotating. * Load information from database earlier, fixed check for password * Set expiry time for cookie * Autofill password for authenticated rotateqrcode users * Disable conflicting settings if rotateqr is enabled * Updating version number * Added maximum length to password field and amended key, name for table * Ammend upgrade.php to update db structure for qrcode rotation * Add id column to attendance_rotate_passwords * Removed interval setting from session. Using plugin setting instead. * Amend return passwords function * Update version numbers for DB/version.php * Hide rotate option when students cannot mark on update page. * Show QR icon when rotateqrcode is enabled. * Rename qrcoderotate JS file, frakenstyle * Add qrcode.js to thirdpartylibs.xml * Generate random password when rotateqrcode session is updated. * Add qrcodesecret column to database * Use separate password for rotateqrcode cookie * Remove unnecessary qrcodeinterval database field * Replacing $_GET with optional_param * Clarified time unit (seconds) for Rotate QR Code strings. * Moved rotateqrcodeinterval under studentscanmark setting * Fix code formatting in attendance.php and locallib.php * Add rotateqrcodesecret to structure * Add task to clear temporary qrrotation passwords * Functionality to allow password to be accepted if expired within 2sec * Documenting class clear_temporary_passwords * Updating delete temporary passwords task
6 years ago
</XMLDB>