Compare commits

...

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

7 changed files with 454 additions and 9457 deletions

View File

@ -151,10 +151,6 @@ 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);

8958
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,25 +10,10 @@ html {
body { body {
margin: 0; margin: 0;
} }
article, article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary {
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block; display: block;
} }
audio, audio,canvas,progress,video {
canvas,
progress,
video {
display: inline-block; display: inline-block;
vertical-align: baseline; vertical-align: baseline;
} }
@ -36,22 +21,19 @@ audio:not([controls]) {
display: none; display: none;
height: 0; height: 0;
} }
[hidden], [hidden],template {
template {
display: none; display: none;
} }
a { a {
background-color: transparent; background-color: transparent;
} }
a:active, a:active,a:hover {
a:hover {
outline: 0; outline: 0;
} }
abbr[title] { abbr[title] {
border-bottom: 1px dotted; border-bottom: 1px dotted;
} }
b, b,strong {
strong {
font-weight: bold; font-weight: bold;
} }
dfn { dfn {
@ -68,8 +50,7 @@ mark {
small { small {
font-size: 80%; font-size: 80%;
} }
sub, sub,sup {
sup {
font-size: 75%; font-size: 75%;
line-height: 0; line-height: 0;
position: relative; position: relative;
@ -98,18 +79,11 @@ hr {
pre { pre {
overflow: auto; overflow: auto;
} }
code, code,kbd,pre,samp {
kbd,
pre,
samp {
font-family: monospace, monospace; font-family: monospace, monospace;
font-size: 1em; font-size: 1em;
} }
button, button,input,optgroup,select,textarea {
input,
optgroup,
select,
textarea {
color: inherit; color: inherit;
font: inherit; font: inherit;
margin: 0; margin: 0;
@ -117,44 +91,35 @@ textarea {
button { button {
overflow: visible; overflow: visible;
} }
button, button,select {
select {
text-transform: none; text-transform: none;
} }
button, button,html input[type="button"], input[type="reset"],input[type="submit"] {
html input[type='button'],
input[type='reset'],
input[type='submit'] {
-webkit-appearance: button; -webkit-appearance: button;
cursor: pointer; cursor: pointer;
} }
button[disabled], button[disabled],html input[disabled] {
html input[disabled] {
cursor: default; cursor: default;
} }
button::-moz-focus-inner, button::-moz-focus-inner,input::-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="checkbox"],input[type="radio"] {
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-inner-spin-button,input[type="number"]::-webkit-outer-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-cancel-button,input[type="search"]::-webkit-search-decoration {
input[type='search']::-webkit-search-decoration {
-webkit-appearance: none; -webkit-appearance: none;
} }
fieldset { fieldset {
@ -176,8 +141,7 @@ table {
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
} }
td, td,th {
th {
padding: 0; padding: 0;
} }
html { html {
@ -201,12 +165,7 @@ hr {
margin: 1em 0; margin: 1em 0;
padding: 0; padding: 0;
} }
audio, audio,canvas,iframe,img,svg,video {
canvas,
iframe,
img,
svg,
video {
vertical-align: middle; vertical-align: middle;
} }
fieldset { fieldset {
@ -236,8 +195,7 @@ textarea {
position: absolute; position: absolute;
width: 1px; width: 1px;
} }
.visuallyhidden.focusable:active, .visuallyhidden.focusable:active,.visuallyhidden.focusable:focus {
.visuallyhidden.focusable:focus {
clip: auto; clip: auto;
height: auto; height: auto;
margin: 0; margin: 0;
@ -248,9 +206,8 @@ textarea {
.invisible { .invisible {
visibility: hidden; visibility: hidden;
} }
.clearfix:before, .clearfix:before,.clearfix:after {
.clearfix:after { content: " ";
content: ' ';
display: table; display: table;
} }
.clearfix:after { .clearfix:after {
@ -258,68 +215,49 @@ textarea {
} }
@media only screen and (min-width: 35em) { @media only screen and (min-width: 35em) {
} }
@media print, @media print,(-webkit-min-device-pixel-ratio: 1.25),(min-resolution: 1.25dppx),(min-resolution: 120dpi) {
(-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,a:visited {
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^="#"]:after,a[href^="javascript:"]:after {
a[href^='javascript:']:after { content: "";
content: '';
} }
pre, pre,blockquote {
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, tr,img {
img {
page-break-inside: avoid; page-break-inside: avoid;
} }
img { img {
max-width: 100% !important; max-width: 100% !important;
} }
p, p,h2,h3 {
h2,
h3 {
orphans: 3; orphans: 3;
widows: 3; widows: 3;
} }
h2, h2,h3 {
h3 {
page-break-after: avoid; page-break-after: avoid;
} }
} }
h1, h1, h2, h3, h4, h5, h6 {
h2,
h3,
h4,
h5,
h6 {
color: #000; color: #000;
background: none; background: none;
font-weight: normal; font-weight: normal;
@ -367,8 +305,7 @@ h1 {
letter-spacing: 0; letter-spacing: 0;
font-size: 2.3em; font-size: 2.3em;
} }
a, a, a:visited {
a:visited {
color: #0645ad; color: #0645ad;
text-decoration: none; text-decoration: none;
} }
@ -379,7 +316,7 @@ a:hover {
text-decoration: underline; text-decoration: underline;
} }
.wrapAll { .wrapAll {
width: 100%.; width: 100%.
} }
.sidebar { .sidebar {
float: left; float: left;
@ -395,7 +332,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;
@ -457,10 +394,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 {
@ -493,10 +430,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;
@ -522,7 +459,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;
@ -552,8 +489,7 @@ span.user {
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
} }
.hidePanel, .hidePanel, .showPanel {
.showPanel {
float: right; float: right;
margin: 0 5px; margin: 0 5px;
position: absolute; position: absolute;
@ -583,7 +519,7 @@ span.user {
display: block; display: block;
} }
.minimizedPanel .hidePanel { .minimizedPanel .hidePanel {
display: none; display: none
} }
.contentsPanel.minimizedPanel { .contentsPanel.minimizedPanel {
width: 130px; width: 130px;
@ -615,11 +551,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;
@ -633,11 +569,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;
@ -679,8 +615,15 @@ span.user {
} }
} }
.tabsLeftx{ .tabsLeftx{
background-color: #3590d5; background-color:#3590D5;
width:100%; width:100%;
} }
@ -692,7 +635,9 @@ span.user {
} }
.active{ .active{
border: 1px solid #a7d7f9; border:1px solid #A7D7F9;
} }
.bigLetter{ .bigLetter{
@ -704,8 +649,5 @@ span.user {
} }
.article{ .article{
min-height: 500px; min-height:500px;line-height:30px;border-right:1px solid #A7D7F9;padding-top:0px;
line-height: 30px;
border-right: 1px solid #a7d7f9;
padding-top: 0px;
} }

View File

@ -6,10 +6,7 @@ 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,6 +4,7 @@ include 'NoDirectPhpAcess.php';
<?php <?php
include 'Header.php'; include 'Header.php';
?> ?>
<br><br><br> <br><br><br>

View File

@ -165,6 +165,7 @@ 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)
@ -206,6 +207,7 @@ 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,29 +12,44 @@ def restore_database():
Benefit: we can reproduce the same test result. Benefit: we can reproduce the same test result.
''' '''
PASSWORD = 'p-@va9' # root password PASSWORD = 'lrr@123' # 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} -e "DROP DATABASE IF EXISTS {DB_NAME};"', 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 "CREATE DATABASE {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 "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 "CREATE USER IF NOT EXISTS \'lrr\'@\'localhost\' IDENTIFIED BY \'lrr@123\';"',
f'mysql -u root -p{PASSWORD} {DB_NAME} < ../lrr_database.sql'] 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} -h {HOST} -P {PORT} --socket={SOCKET} {DB_NAME} < ../../lrr_database_hui.sql'
]
try:
for command in cmds: for command in cmds:
os.system(command) print(f"Executing command: {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():
return webdriver.Chrome() # Use the locally downloaded ChromeDriver
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