Compare commits

...

No commits in common. "6e41cb48cd009191436a5d1b3a986987a63709ac" and "6c663a00a54db37d1944bf97af4e8fc30557a07c" have entirely different histories.

7 changed files with 9457 additions and 454 deletions

View File

@ -151,6 +151,10 @@ echo "<div><a href='Courses.php?course=$url'> $header </a></div>";
$submitted_by = "$student_name ($submitter_student_number) for group $groupname "; $submitted_by = "$student_name ($submitter_student_number) for group $groupname ";
} }
$base_att1 = basename(rawurldecode($att1));
$base_att2 = basename(rawurldecode($att2));
$base_att3 = basename(rawurldecode($att3));
$base_att4 = basename(rawurldecode($att4));
$base_att1 = basename($att1); $base_att1 = basename($att1);
$base_att2 = basename($att2); $base_att2 = basename($att2);
$base_att3 = basename($att3); $base_att3 = basename($att3);

8960
css/bootstrap.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
@font-face { @font-face {
font-family: "Linux Libertine"; font-family: 'Linux Libertine';
src: url("fonts/LinLibertine_RZ.woff") format('woff'); src: url('fonts/LinLibertine_RZ.woff') format('woff');
} }
html { html {
font-family: sans-serif; font-family: sans-serif;
@ -10,10 +10,25 @@ html {
body { body {
margin: 0; margin: 0;
} }
article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary { article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block; display: block;
} }
audio,canvas,progress,video { audio,
canvas,
progress,
video {
display: inline-block; display: inline-block;
vertical-align: baseline; vertical-align: baseline;
} }
@ -21,19 +36,22 @@ audio:not([controls]) {
display: none; display: none;
height: 0; height: 0;
} }
[hidden],template { [hidden],
template {
display: none; display: none;
} }
a { a {
background-color: transparent; background-color: transparent;
} }
a:active,a:hover { a:active,
a:hover {
outline: 0; outline: 0;
} }
abbr[title] { abbr[title] {
border-bottom: 1px dotted; border-bottom: 1px dotted;
} }
b,strong { b,
strong {
font-weight: bold; font-weight: bold;
} }
dfn { dfn {
@ -50,7 +68,8 @@ mark {
small { small {
font-size: 80%; font-size: 80%;
} }
sub,sup { sub,
sup {
font-size: 75%; font-size: 75%;
line-height: 0; line-height: 0;
position: relative; position: relative;
@ -79,11 +98,18 @@ hr {
pre { pre {
overflow: auto; overflow: auto;
} }
code,kbd,pre,samp { code,
kbd,
pre,
samp {
font-family: monospace, monospace; font-family: monospace, monospace;
font-size: 1em; font-size: 1em;
} }
button,input,optgroup,select,textarea { button,
input,
optgroup,
select,
textarea {
color: inherit; color: inherit;
font: inherit; font: inherit;
margin: 0; margin: 0;
@ -91,35 +117,44 @@ button,input,optgroup,select,textarea {
button { button {
overflow: visible; overflow: visible;
} }
button,select { button,
select {
text-transform: none; text-transform: none;
} }
button,html input[type="button"], input[type="reset"],input[type="submit"] { button,
html input[type='button'],
input[type='reset'],
input[type='submit'] {
-webkit-appearance: button; -webkit-appearance: button;
cursor: pointer; cursor: pointer;
} }
button[disabled],html input[disabled] { button[disabled],
html input[disabled] {
cursor: default; cursor: default;
} }
button::-moz-focus-inner,input::-moz-focus-inner { button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0; border: 0;
padding: 0; padding: 0;
} }
input { input {
line-height: normal; line-height: normal;
} }
input[type="checkbox"],input[type="radio"] { input[type='checkbox'],
input[type='radio'] {
box-sizing: border-box; box-sizing: border-box;
padding: 0; padding: 0;
} }
input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button { input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
height: auto; height: auto;
} }
input[type="search"] { input[type='search'] {
-webkit-appearance: textfield; -webkit-appearance: textfield;
box-sizing: content-box; box-sizing: content-box;
} }
input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration { input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-decoration {
-webkit-appearance: none; -webkit-appearance: none;
} }
fieldset { fieldset {
@ -141,7 +176,8 @@ table {
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
} }
td,th { td,
th {
padding: 0; padding: 0;
} }
html { html {
@ -165,7 +201,12 @@ hr {
margin: 1em 0; margin: 1em 0;
padding: 0; padding: 0;
} }
audio,canvas,iframe,img,svg,video { audio,
canvas,
iframe,
img,
svg,
video {
vertical-align: middle; vertical-align: middle;
} }
fieldset { fieldset {
@ -195,7 +236,8 @@ textarea {
position: absolute; position: absolute;
width: 1px; width: 1px;
} }
.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus { .visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
clip: auto; clip: auto;
height: auto; height: auto;
margin: 0; margin: 0;
@ -206,8 +248,9 @@ textarea {
.invisible { .invisible {
visibility: hidden; visibility: hidden;
} }
.clearfix:before,.clearfix:after { .clearfix:before,
content: " "; .clearfix:after {
content: ' ';
display: table; display: table;
} }
.clearfix:after { .clearfix:after {
@ -215,49 +258,68 @@ textarea {
} }
@media only screen and (min-width: 35em) { @media only screen and (min-width: 35em) {
} }
@media print,(-webkit-min-device-pixel-ratio: 1.25),(min-resolution: 1.25dppx),(min-resolution: 120dpi) { @media print,
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 1.25dppx),
(min-resolution: 120dpi) {
} }
@media print { @media print {
*,*:before,*:after,*:first-letter,*:first-line { *,
*:before,
*:after,
*:first-letter,
*:first-line {
background: transparent !important; background: transparent !important;
color: #000 !important; color: #000 !important;
box-shadow: none !important; box-shadow: none !important;
text-shadow: none !important; text-shadow: none !important;
} }
a,a:visited { a,
a:visited {
text-decoration: underline; text-decoration: underline;
} }
a[href]:after { a[href]:after {
content: " (" attr(href) ")"; content: ' (' attr(href) ')';
} }
abbr[title]:after { abbr[title]:after {
content: " (" attr(title) ")"; content: ' (' attr(title) ')';
} }
a[href^="#"]:after,a[href^="javascript:"]:after { a[href^='#']:after,
content: ""; a[href^='javascript:']:after {
content: '';
} }
pre,blockquote { pre,
blockquote {
border: 1px solid #999; border: 1px solid #999;
page-break-inside: avoid; page-break-inside: avoid;
} }
thead { thead {
display: table-header-group; display: table-header-group;
} }
tr,img { tr,
img {
page-break-inside: avoid; page-break-inside: avoid;
} }
img { img {
max-width: 100% !important; max-width: 100% !important;
} }
p,h2,h3 { p,
h2,
h3 {
orphans: 3; orphans: 3;
widows: 3; widows: 3;
} }
h2,h3 { h2,
h3 {
page-break-after: avoid; page-break-after: avoid;
} }
} }
h1, h2, h3, h4, h5, h6 { h1,
h2,
h3,
h4,
h5,
h6 {
color: #000; color: #000;
background: none; background: none;
font-weight: normal; font-weight: normal;
@ -267,13 +329,13 @@ h1, h2, h3, h4, h5, h6 {
padding-bottom: 0.17em; padding-bottom: 0.17em;
} }
.article h1 { .article h1 {
font-family: 'Linux Libertine','Georgia','Times',serif; font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
border-bottom: 1px solid #a2a9b1; border-bottom: 1px solid #a2a9b1;
} }
.article h2 { .article h2 {
font-size: 1.6em; font-size: 1.6em;
margin: 0.5em 0 0.5em 0; margin: 0.5em 0 0.5em 0;
font-family: 'Linux Libertine','Georgia','Times',serif; font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
border-bottom: 1px solid #a2a9b1; border-bottom: 1px solid #a2a9b1;
line-height: 1.4em; line-height: 1.4em;
padding-bottom: 0em; padding-bottom: 0em;
@ -305,18 +367,19 @@ h1 {
letter-spacing: 0; letter-spacing: 0;
font-size: 2.3em; font-size: 2.3em;
} }
a, a:visited { a,
a:visited {
color: #0645ad; color: #0645ad;
text-decoration: none; text-decoration: none;
} }
a{ a {
color: #0645ad; color: #0645ad;
} }
a:hover { a:hover {
text-decoration: underline; text-decoration: underline;
} }
.wrapAll { .wrapAll {
width: 100%. width: 100%.;
} }
.sidebar { .sidebar {
float: left; float: left;
@ -332,7 +395,7 @@ a:hover {
padding: 0.25em 0; padding: 0.25em 0;
cursor: default; cursor: default;
border: 0; border: 0;
border-bottom: 1px solid #D8D8D8; border-bottom: 1px solid #d8d8d8;
} }
.sidebar li { .sidebar li {
line-height: 1.125em; line-height: 1.125em;
@ -379,7 +442,7 @@ div.articleRightInner {
color: #777; color: #777;
letter-spacing: 0.017em; letter-spacing: 0.017em;
} }
.headerLinks a{ .headerLinks a {
display: inline-block; display: inline-block;
margin: 0 0 0 0.5em; margin: 0 0 0 0.5em;
} }
@ -394,10 +457,10 @@ div.articleRightInner {
position: relative; position: relative;
top: 1px; top: 1px;
left: 1px; left: 1px;
border-bottom: 1px solid #A7D7F9; border-bottom: 1px solid #a7d7f9;
} }
.tabs ul li a.active { .tabs ul li a.active {
background: #FFF; background: #fff;
border-bottom-color: transparent; border-bottom-color: transparent;
} }
.tabs ul { .tabs ul {
@ -430,10 +493,10 @@ div.articleRightInner {
float: right; float: right;
overflow: hidden; overflow: hidden;
border: solid 1px #aaa; border: solid 1px #aaa;
background: #F6F6F6; background: #f6f6f6;
background: -moz-linear-gradient(top, #F6F6F6 0%, #FFFFFF 100%); background: -moz-linear-gradient(top, #f6f6f6 0%, #ffffff 100%);
background: -webkit-linear-gradient(top, #F6F6F6 0%, #FFFFFF 100%); background: -webkit-linear-gradient(top, #f6f6f6 0%, #ffffff 100%);
background: linear-gradient(to bottom, #F6F6F6 0%, #FFFFFF 100%); background: linear-gradient(to bottom, #f6f6f6 0%, #ffffff 100%);
} }
#searchInput { #searchInput {
background: transparent; background: transparent;
@ -459,7 +522,7 @@ div.articleRightInner {
.article { .article {
padding: 1.25em 1.5em 1.5em 1.5em; padding: 1.25em 1.5em 1.5em 1.5em;
border-left: 1px solid #a7d7f9; border-left: 1px solid #a7d7f9;
background: #FFF; background: #fff;
line-height: 1.6; line-height: 1.6;
font-size: 0.875em; font-size: 0.875em;
border-top: 1px solid #a7d7f9; border-top: 1px solid #a7d7f9;
@ -489,7 +552,8 @@ span.user {
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
} }
.hidePanel, .showPanel { .hidePanel,
.showPanel {
float: right; float: right;
margin: 0 5px; margin: 0 5px;
position: absolute; position: absolute;
@ -507,7 +571,7 @@ span.user {
.contentsPanel ul { .contentsPanel ul {
padding: 0 0 5px 5px; padding: 0 0 5px 5px;
} }
.contentsPanel ul li ul{ .contentsPanel ul li ul {
} }
.contentsPanel ul li ul li { .contentsPanel ul li ul li {
padding: 0 0 0 25px; padding: 0 0 0 25px;
@ -519,7 +583,7 @@ span.user {
display: block; display: block;
} }
.minimizedPanel .hidePanel { .minimizedPanel .hidePanel {
display: none display: none;
} }
.contentsPanel.minimizedPanel { .contentsPanel.minimizedPanel {
width: 130px; width: 130px;
@ -551,11 +615,11 @@ span.user {
background: #ddddff; background: #ddddff;
} }
.linklist a:after { .linklist a:after {
content: " · "; content: ' · ';
font-weight: bold; font-weight: bold;
} }
.linklist a:last-child:after { .linklist a:last-child:after {
content: ""; content: '';
} }
.linklist a { .linklist a {
white-space: nowrap; white-space: nowrap;
@ -569,11 +633,11 @@ span.user {
clear: both; clear: both;
} }
.categories a:after { .categories a:after {
content: " | "; content: ' | ';
font-weight: bold; font-weight: bold;
} }
.categories a:last-child:after { .categories a:last-child:after {
content: ""; content: '';
} }
.pagefooter { .pagefooter {
padding: 1.5em 1.3em 2em; padding: 1.5em 1.3em 2em;
@ -615,39 +679,33 @@ span.user {
} }
} }
.tabsLeftx {
background-color: #3590d5;
width: 100%;
.tabsLeftx{
background-color:#3590D5;
width:100%;
} }
.menubox{ .menubox {
color:#fff; color: #fff;
padding-left:50px; padding-left: 50px;
padding-right:50px; padding-right: 50px;
font-weight:bold; font-weight: bold;
} }
.active{ .active {
border:1px solid #A7D7F9; border: 1px solid #a7d7f9;
} }
.bigLetter{ .bigLetter {
font-size:28pt; font-size: 28pt;
} }
*{ * {
font-size:13pt; font-size: 13pt;
} }
.article{ .article {
min-height:500px;line-height:30px;border-right:1px solid #A7D7F9;padding-top:0px; min-height: 500px;
line-height: 30px;
border-right: 1px solid #a7d7f9;
padding-top: 0px;
} }

View File

@ -6,7 +6,10 @@ include 'NoDirectPhpAcess.php';
include 'Header.php'; include 'Header.php';
?> ?>
<<<<<<< HEAD
=======
>>>>>>> Initial commit for Bug197-Zayid: Add project files
<br><br><br> <br><br><br>
<div class="container"> <div class="container">

View File

@ -4,7 +4,6 @@ include 'NoDirectPhpAcess.php';
<?php <?php
include 'Header.php'; include 'Header.php';
?> ?>
<br><br><br> <br><br><br>

View File

@ -165,7 +165,6 @@ def test_student_with_valid_student_number_can_sign_up(driver, url, restore_data
def test_student_with_invalid_student_number_cannot_sign_up(driver, url, restore_database): def test_student_with_invalid_student_number_cannot_sign_up(driver, url, restore_database):
# Student with unrecognizable student number cannot sign up an account # Student with unrecognizable student number cannot sign up an account
driver.get(url) driver.get(url)
@ -207,7 +206,6 @@ def test_student_with_weak_password_cannot_sign_up(driver, url, restore_database
def test_student_can_join_course(driver, url, restore_database): def test_student_can_join_course(driver, url, restore_database):
# Student can join (CSC1111) - Project Management # Student can join (CSC1111) - Project Management
login(driver, url, '201825800050', '123') login(driver, url, '201825800050', '123')

View File

@ -12,44 +12,29 @@ def restore_database():
Benefit: we can reproduce the same test result. Benefit: we can reproduce the same test result.
''' '''
PASSWORD = 'lrr@123' # root password PASSWORD = 'p-@va9' # root password
DB_NAME = 'lrr' # database name used for LRR DB_NAME = 'lrr' # database name used for LRR
HOST = 'localhost'
PORT = 3909 # XAMPP MySQL default port
SOCKET = '/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock' # XAMPP MySQL socket (optional)
# commands used to import data to DB_NAME # commands used to import data to DB_NAME
cmds = [ cmds = [
f'mysql -u root -p{PASSWORD} -h {HOST} -P {PORT} --socket={SOCKET} -e "DROP DATABASE IF EXISTS {DB_NAME};"', f'mysql -u root -p{PASSWORD} -e "DROP DATABASE IF EXISTS {DB_NAME};"',
f'mysql -u root -p{PASSWORD} -h {HOST} -P {PORT} --socket={SOCKET} -e "CREATE DATABASE {DB_NAME};"', f'mysql -u root -p{PASSWORD} -e "CREATE DATABASE {DB_NAME};"',
f'mysql -u root -p{PASSWORD} -h {HOST} -P {PORT} --socket={SOCKET} -e "CREATE USER IF NOT EXISTS \'lrr\'@\'localhost\' IDENTIFIED BY \'lrr@123\';"', f'mysql -u root -p{PASSWORD} -e "GRANT ALL PRIVILEGES ON {DB_NAME}.* TO lrr@localhost WITH GRANT OPTION;"',
f'mysql -u root -p{PASSWORD} -h {HOST} -P {PORT} --socket={SOCKET} -e "GRANT ALL PRIVILEGES ON {DB_NAME}.* TO lrr@localhost WITH GRANT OPTION;"', f'mysql -u root -p{PASSWORD} {DB_NAME} < ../lrr_database.sql']
f'mysql -u root -p{PASSWORD} -h {HOST} -P {PORT} --socket={SOCKET} {DB_NAME} < ../../lrr_database_hui.sql'
]
try:
for command in cmds: for command in cmds:
print(f"Executing command: {command}") os.system(command)
result = os.system(command)
if result != 0:
raise Exception(f"Command failed with exit code {result}: {command}")
print("Database restored successfully.")
except Exception as e:
print(f"An error occurred while restoring the database: {e}")
return None return None
@pytest.fixture @pytest.fixture
def url(): def url():
# return 'http://localhost/LRR/' # URL of LRR return 'http://localhost/LRR/' # URL of LRR
return 'http://localhost:8081/LRR-Hui-Organize/' # local URL of LRR-Hui-Organize
@pytest.fixture @pytest.fixture
def driver(): def driver():
# Use the locally downloaded ChromeDriver return webdriver.Chrome()
chrome_driver_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../chromedriver-mac-x64 2/chromedriver'))
print(f"Using ChromeDriver at: {chrome_driver_path}")
driver = webdriver.Chrome(executable_path=chrome_driver_path)
return driver
@pytest.fixture @pytest.fixture