forked from drlippman/IMathAS
-
Notifications
You must be signed in to change notification settings - Fork 1
ohm-525 Teacher Audit Log #21
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
Open
sketchings
wants to merge
20
commits into
master
Choose a base branch
from
ohm-525-teacher-audit-log
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
fc0177d
ohm-525 Teacher Audit Log
974e989
ohm-525 remove FROM_UNIXTIME to speed up query
33857ab
ohm-525 update PDO queries
28557aa
ohm-525 update PDO queries
7f6d8fd
ohm-607 logging assessment setting changes
0f0a0bc
ohm-607 logging question settings
de5ea26
Cleanup audit log on hard course delete
drlippman 015592c
ohm-607 fix mistype groupid
0222246
ohm-607 compare and record specific changes from mass date changes
f32156a
ohm-525 update typing and documentation for class
f748518
ohm-607 update deleting course items to all use course/delitembyid.php
9fae6c8
ohm-607 update mass exception 'Clear Attempts'
cf0c8c6
ohm-607 'Clear Attempts'
f97028b
ohm-607 update to remove errors when no students are enrolled
9b74a43
ohm-607 fix code and what is recorded
0b8e23f
ohm-607 grade override
e6c94bb
ohm-607 update deletes and grade execute
0ddbb74
ohm-607 update deletes
777b045
ohm-525 update type requirements for findCourseItemAction
60efdb7
ohm-525 remove required file
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| <?php | ||
| //IMathAS: Add/modify blocks of items on course page | ||
| //(c) 2019 David Lippman | ||
|
|
||
| /*** master php includes *******/ | ||
| require("../init.php"); | ||
| require("../includes/htmlutil.php"); | ||
| require_once("../includes/TeacherAuditLog.php"); | ||
|
|
||
| /*** pre-html data manipulation, including function code *******/ | ||
|
|
||
| //set some page specific variables and counters | ||
| $overwriteBody = 0; | ||
| $body = ""; | ||
| $pagetitle = "Teacher Audit Log"; | ||
| $userid = Sanitize::onlyInt($_GET['userid']); | ||
| $cid = Sanitize::courseId($_GET['cid']); | ||
|
|
||
| $curBreadcrumb = "$breadcrumbbase <a href=\"admin2.php\">Admin</a> > <a href=\"userdetails.php?id=$userid\">User Details</a> "; | ||
| $curBreadcrumb .= "> Teacher Audit Log\n"; | ||
|
|
||
| if (isset($_GET['id'])) { | ||
| $stm = $DBH->prepare("SELECT courseid FROM imas_assessments WHERE id=?"); | ||
| $stm->execute(array(intval($_GET['id']))); | ||
| if ($stm->rowCount()==0 || $stm->fetchColumn(0) != $_GET['cid']) { | ||
| echo "Invalid ID"; | ||
| exit; | ||
| } | ||
| } | ||
|
|
||
| if ($myrights <75) { | ||
| $overwriteBody=1; | ||
| $body = "You need to log in as an admin to access this page"; | ||
| } elseif (!(isset($_GET['cid']))) { | ||
| $overwriteBody=1; | ||
| $body = "You need to select the course"; | ||
| } | ||
| function formatdate($date) { | ||
| return tzdate("M j, Y, g:i a",strtotime($date)); | ||
| } | ||
|
|
||
|
|
||
| //BEGIN DISPLAY BLOCK | ||
|
|
||
| /******* begin html output ********/ | ||
| //$placeinhead = "<script type=\"text/javascript\" src=\"$imasroot/javascript/DatePicker.js?v=080818\"></script>"; | ||
|
|
||
| require("../header.php"); | ||
|
|
||
| if ($overwriteBody==1) { | ||
| echo $body; | ||
| } else { | ||
| $stm = $DBH->prepare("SELECT ic.name,ic.ownerid,iu.groupid FROM imas_courses AS ic JOIN imas_users AS iu ON ic.ownerid=iu.id WHERE ic.id=?"); | ||
| $stm->execute(array($cid)); | ||
| list($coursename, $courseownerid, $coursegroupid) = $stm->fetch(PDO::FETCH_NUM); | ||
|
|
||
| echo '<div class=breadcrumb>', $curBreadcrumb, '</div>'; | ||
| echo '<div id="headeruserdetail" class="pagetitle"><h1>' . _('Teacher Audit Log') . ': '; | ||
| echo Sanitize::encodeStringForDisplay($coursename); | ||
| echo '</h1></div>'; | ||
|
|
||
| $teacher_actions = TeacherAuditLog::findActionsByCourse($cid); | ||
| if (empty($teacher_actions)) { | ||
| echo "<p>Nothing to report</p>"; | ||
| } else { | ||
| $stm = $DBH->query("SELECT FirstName, LastName FROM imas_users WHERE id=" . $teacher_actions[0]['userid']); | ||
| list($first, $last) = $stm->fetch(); | ||
| echo '<table><tr>'; | ||
| echo '<th>Date/Time</th>'; | ||
| echo '<th>Teacher</th>'; | ||
| echo '<th>Action</th>'; | ||
| echo '<th>ItemID</th>'; | ||
| echo '<th>Details</th>'; | ||
| echo '</tr>'; | ||
|
|
||
| foreach ($teacher_actions as $action) { | ||
| echo '<tr>'; | ||
| echo '<td>' . formatdate($action['created_at']) . '</td>'; | ||
| echo "<td>$first $last (" . Sanitize::onlyInt($action['userid']) . ')</td>'; | ||
| echo '<td>' . Sanitize::encodeStringForDisplay($action['action']) . '</td>'; | ||
| echo '<td>' . Sanitize::onlyInt($action['itemid']) . '</td>'; | ||
| echo '<td><a href="javascript:alert(\'' . Sanitize::encodeStringForDisplay($action['metadata']) . '\')">Details</a></td>'; | ||
| echo '</tr>'; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| require("../footer.php"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there's only logging for the "delete all attempts" clearing, but not for any of the individual attempt or question version clearing later in the file.