Back
Format for
Format for
Format for
Format for
Format for
Format for
Format for
Console Moodle
A recreation of the Moodle web app on a text-based console in C++, with ncurses. A project for the Programming Techniques course.
Media
The video below shows the console app in action.
If you can not see, watch on YouTube.
Data Format
<year>will be replaced with one number of the school year (e.g. 2019 represents the school year 2019-2020)<semester>will be just numbers (1, 2 or 3)<class>will be replaced with the class name/ID (e.g.22clc01,22clc02, etc.)<course>will be replaced with the course ID (e.g.CS162,MTH00007, etc.)
General structure
./data/input/..will be the slots for users to import data../data/output..will be slots for exporting functions.
data/
|-- input/
|-- ..
|-- output/
|-- ..
|-- accounts.csv
|-- years.txt
|-- <year>/
|-- semesters.txt
|-- classes/
|-- classes.txt
|-- <class>.txt
|-- <semester>/
|-- courses.csv
|-- <course>.csv
Format for accounts.csv file
Account type:
0: Student1: Staff
id,firstname,lastname,accounttype,day,month,year,socialid,username,password
22127064,Dat,Pham Thanh,0,9,3,2001,01234567890,22127064,password
Format for years.txt file
2019
2020
2021
Format for semesters.txt file
index,start_date,end_date
0,25/12/2003,3/4/2004
1,4/4/2004,10/7/2004
2,11/7/2004,20/11/2004
If the semester wasn’t created, semesters[i] = nullptr, start_date and end_date will be null (once a semester is created, start_date
and end_date will never be null):
index,start_date,end_date
0,null,null
1,4/4/2004,10/7/2004
2,11/7/2004,20/11/2004
Format for <year>/classes/classes.txt file
22clc01
22clc02
22clc03
Format for <year>/classes/<class>.txt file
22127064
22127065
22127066
Format for <year>/<semester>/courses.csv file
id,name,teachername,classname,maxstudents,credits,dayofweek,shiftstart,shiftend
csc10002,Ky thuat lap trinh,Dinh Ba Tien,22CLC01,50,4,3,9:30,11:10
Format for <year>/<semester>/<course>.csv file
(Unknown if others can be implemented as variadic.)
studentid,midterms,finals,total,other
22127163,5,3,4,1
22127046,10,10,10,10
Installation
Requires some sort of C++ compiler (obviously) (e.g. g++ or clang++, etc.). Below were instructions for my groupmates and professor to compile the project. But since the source code is not publicly available, this section is of no use to you.
Windows (GNU/MinGW G++ or MSVC)
- Make sure
g++orclang++is installed. - Install
pdcursesfrom the application MinGW Installation Manager. (all packages that have the namemingw32-libpdcurses) - If you want to use
g++to compile, you’re already done! - Install
mingw32-makepackage from MinGW Installation Manager also. - Download CMake from here using Windows XXX Installer, idk.
- If when you run
cmakeandmingw32-makeit works, you’re done :)
Windows (Visual Studio ++)
- I don’t know I don’t use VS
Unix-based (MacOS, Linux, etc.)
- Make sure
g++orclang++is installed. - Install
ncursesvia a package manager. (MacOS can install XCode Command Line Tools to getncurses.) - (Optional) Install
cmakeandmake, via package managers also. (MacOS hascmakeandmakepre-installed with XCode Command Line Tools too i believe.) - Done! Good job?
Compilation
Using direct compiler (clang, g++)
cdinto this directory.g++ <list_files.cpp> -lncurses(Unix) org++ <list_files.cpp> -lpdcurses(Windows), same thing withclang++a.outora.exeshould now be generated if done correctly.
Using direct compiler (VS++)
- No clue
Using CMake
cdinto this directory.cmake -G "Unix Makefiles" .(Unix) orcmake -G "MinGW Makefiles" .(Windows).- If correctly done, no errors would be shown.
make(Unix) ormingw32-make(Windows). You should see files being created with green text thingy.bin/Moodleorbin/Moodle.exehas now been created. Run it :D