Skip to content

Commit

Permalink
Coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpchi committed May 31, 2024
1 parent 462ed94 commit bb2b984
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 40 deletions.
78 changes: 39 additions & 39 deletions db/install.xml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="local/apprenticeoffjob/db" VERSION="20180326" COMMENT="XMLDB file for Moodle local/apprenticeoffjob"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="local_apprentice" COMMENT="Logs for apprentice off job activities">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="ID of the user."/>
<FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="ID of the activity."/>
<FIELD NAME="activitytype" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="ID of the activity."/>
<FIELD NAME="activitydate" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The date the activity was completed."/>
<FIELD NAME="activitydetails" TYPE="text" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Details of the activity."/>
<FIELD NAME="activityhours" TYPE="number" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" DECIMALS="2" COMMENT="Number of hours completed."/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="The time the record was created."/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The time the record was updated."/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="The unique id for this activity."/>
<KEY NAME="activitytype" TYPE="foreign" FIELDS="activitytype" REFTABLE="local_apprenticeactivities" REFFIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="local_apprenticeactivities" COMMENT="Activities for apprentice off job log">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
<FIELD NAME="activityname" TYPE="text" LENGTH="10" NOTNULL="true" SEQUENCE="false" />
<FIELD NAME="description" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="Activity description displayed to students" />
<FIELD NAME="status" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" />
<FIELD NAME="usermodified" LENGTH="10" SEQUENCE="false" TYPE="int" NOTNULL="true" UNSIGNED="true" />
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" />
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" />
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="The unique id for this activity."/>
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="local/apprenticeoffjob/db" VERSION="20180326" COMMENT="XMLDB file for Moodle local/apprenticeoffjob"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="local_apprentice" COMMENT="Logs for apprentice off job activities">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="ID of the user."/>
<FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="ID of the activity."/>
<FIELD NAME="activitytype" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="ID of the activity."/>
<FIELD NAME="activitydate" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The date the activity was completed."/>
<FIELD NAME="activitydetails" TYPE="text" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Details of the activity."/>
<FIELD NAME="activityhours" TYPE="number" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" DECIMALS="2" COMMENT="Number of hours completed."/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="The time the record was created."/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The time the record was updated."/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="The unique id for this activity."/>
<KEY NAME="activitytype" TYPE="foreign" FIELDS="activitytype" REFTABLE="local_apprenticeactivities" REFFIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="local_apprenticeactivities" COMMENT="Activities for apprentice off job log">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
<FIELD NAME="activityname" TYPE="text" LENGTH="10" NOTNULL="true" SEQUENCE="false" />
<FIELD NAME="description" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="Activity description displayed to students" />
<FIELD NAME="status" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" />
<FIELD NAME="usermodified" LENGTH="10" SEQUENCE="false" TYPE="int" NOTNULL="true" UNSIGNED="true" />
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" />
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" />
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="The unique id for this activity."/>
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
1 change: 0 additions & 1 deletion edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
$activityid = required_param('id', PARAM_INT);
$studentid = optional_param('studentid', 0, PARAM_INT);
if ($studentid > 0 && $studentid != $USER->id) {
// TODO: Allow admins to edit activities.
throw new moodle_exception('noeditpermissions', 'local_apprenticeoffjob');
} else {
$studentid = $USER->id;
Expand Down

0 comments on commit bb2b984

Please sign in to comment.