forked from drlippman/IMathAS
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ohm-527 change creation timestamp to created_at field ohm-527 match ENUM plural form ohm-527 update table name output ohm-528 initial logging class and testing pattern ohm-528 add findCourseAction and update/cleanup tests ohm-525 fix in memory sqlite db for tests ohm-525 use global userid ohm-525 add source file to all metadata ohm-525 Assessment setting changes logged ohm-525 update for mass updates not reqiring itemid ohm-525 Mass change assessment ohm-525 Unenroll with grade save ohm-525 Mass Assessment Date Change ohm-525 Clear Attempts, Question Settings Change, Assessment Settings Change ohm-525 Clear Attempts ohm-525 Clear Scores and Attempts ohm-525 update Clear Scores ohm-524 delete items ohm-525 initial Teacher Audit Log Report ohm-525 use blob for metadata ohm-525 update for code bugs ohm-525 record updated scores ohm-525 update Clear Scores, Clear Attempts. Change 'Grade Override' to 'Grade Change' ohm-525 mass change dates ohm-525 Change Grades Old Assessment ohm-525 record new assessment updates ohm-525 update include to TeacherAuditLog ohm-525 build assess2 for production ohm-525 loadRecord to get score data. Only record if this is a scoreoverride ohm-525 do not need to log teacher clearing their own scores ohm-525 clear attempts ohm-525 do not need to record for adding a new assessment ohm-525 clean up logged data ohm-525 record offline, forum and external grades from imas_grades ohm-525 must be admin to access Teacher Audit Log Report ohm-525 update breadcrumbs ohm-525 only pull imas_grades where appropriate ohm-525 count forums
- Loading branch information
Alena Holligan
committed
May 1, 2020
1 parent
e6fb80e
commit f1dab79
Showing
37 changed files
with
1,091 additions
and
101 deletions.
There are no files selected for viewing
This file contains 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,84 @@ | ||
<?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); | ||
$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 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 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 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.