summaryrefslogtreecommitdiff
path: root/tbc_external_review.module
diff options
context:
space:
mode:
authorJayaram Pai2014-03-03 14:56:27 +0530
committerJayaram Pai2014-03-03 14:56:27 +0530
commitb311f3e3d083ffeeb8ece1ab7601133201af416e (patch)
tree04ceaccd9612e996c280600f6e7e0a2a52b6dfea /tbc_external_review.module
parent706e7e3822ea75029a02542f28219a4cc27549b4 (diff)
downloadtbc-external-review-b311f3e3d083ffeeb8ece1ab7601133201af416e.tar.gz
tbc-external-review-b311f3e3d083ffeeb8ece1ab7601133201af416e.tar.bz2
tbc-external-review-b311f3e3d083ffeeb8ece1ab7601133201af416e.zip
added example view on comment lightbox
ref: /ajax -> function
Diffstat (limited to 'tbc_external_review.module')
-rw-r--r--tbc_external_review.module12
1 files changed, 11 insertions, 1 deletions
diff --git a/tbc_external_review.module b/tbc_external_review.module
index b1b1468..2998e7a 100644
--- a/tbc_external_review.module
+++ b/tbc_external_review.module
@@ -685,11 +685,19 @@
}
} else if($item = "comment" && $key) {
$query = "
- SELECT * FROM {external_review_comments} WHERE id = %d
+ SELECT * FROM external_review_comments erc
+ LEFT JOIN textbook_companion_example_files tcef
+ ON (erc.example_id = tcef.example_id AND tcef.filetype = 'S')
+ WHERE erc.id = %d
";
$result = db_query($query, $key);
$row = db_fetch_object($result);
+ /* fetching example file data */
+ $uploads_dir = $_SERVER['DOCUMENT_ROOT'] . base_path() . 'uploads/';
+ $example_path = $uploads_dir . $row->filepath;
+ $example = file_get_contents($example_path);
+
$data .= "<table><th>Type of Error</th><th>Status</th>";
$data .= "<tr><td>Naming convention followed?</td><td>" . _bool($row->ncf) . "</td></tr>";
$data .= "<tr><td>Problem statement included in code?</td><td>" . _bool($row->eit) . "</td></tr>";
@@ -703,6 +711,8 @@
$data .= "<tr><td>Answers matching with the textbook?</td><td>" . _bool($row->amt) . "</td></tr>";
$data .= "<tr><td>Any Other Comment ?</td><td>" . $row->comment . "</td></tr>";
$data .= "</table>";
+ $data .= "<textarea style='width:100%; height:200px; background:#fafafa' readonly>";
+ $data .= "{$example}</textarea>";
}
echo $data;
exit();