Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sfcode
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush
sfcode
Commits
90b4f1ad
Commit
90b4f1ad
authored
Dec 10, 2020
by
Adarsh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commnets
parent
aaef1238
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
15 deletions
+34
-15
backend/list_files.php
backend/list_files.php
+1
-1
backend/register.php
backend/register.php
+9
-9
src/app/directory.ts
src/app/directory.ts
+5
-0
src/app/file.ts
src/app/file.ts
+6
-0
src/app/problem.ts
src/app/problem.ts
+4
-0
src/app/question.ts
src/app/question.ts
+4
-0
src/app/run-code.service.ts
src/app/run-code.service.ts
+0
-5
src/app/user.ts
src/app/user.ts
+5
-0
No files found.
backend/list_files.php
View file @
90b4f1ad
<?php
/*!
/*!
\file
This script returns the code files present in a user's workspace, but doesn't account for directories and sub-directories.
This script is obselete because of the script dir_tree.php, which returns the directory tree of the user's workspace.
*/
...
...
backend/register.php
View file @
90b4f1ad
<?php
/** \file
This script registers a user using a username, password, name, and email.
This script communicates with the MySQL server to save user data.
Passowrd is hashed, and SQL injection is taken care of.
The process of registering involves -
1. An insert operation into the users table, in the database.
2. Creation of directories, required to store files, executables and question attempts made by the user.
Returns a 404 error if username already exists.
*
This script registers a user using a username, password, name, and email.
*
This script communicates with the MySQL server to save user data.
*
Passowrd is hashed, and SQL injection is taken care of.
*
The process of registering involves -
*
1. An insert operation into the users table, in the database.
*
2. Creation of directories, required to store files, executables and question attempts made by the user.
*
Returns a 404 error if username already exists.
*/
header
(
"Access-Control-Allow-Origin: *"
);
...
...
src/app/directory.ts
View file @
90b4f1ad
/** \file
* Interface for Directory having attributes for storing it's child directories, files and the path where it is tored in the server.
* Used in File management for providing User a workspace.
*/
import
{
File
}
from
'
./file
'
;
export
interface
Directory
{
...
...
src/app/file.ts
View file @
90b4f1ad
/** \file
* Interface for File having attributes for storing the extensions and contents of the file.
* Used in services and components for storing the ide text and uploading the server, as well as
* compiling and executing programs.
*/
export
interface
File
{
username
:
string
;
filename
:
string
;
...
...
src/app/problem.ts
View file @
90b4f1ad
/** \file
* A temporary Interface for Problem
*/
export
interface
Problem
{
id
:
number
;
title
:
string
;
...
...
src/app/question.ts
View file @
90b4f1ad
/** \file
* Interface for Question which are to be uploaded by different users.
*/
export
interface
Question
{
title
:
string
;
username
:
string
;
...
...
src/app/run-code.service.ts
View file @
90b4f1ad
...
...
@@ -28,11 +28,6 @@ export class RunCodeService {
});
}
// compileProblemFile(prob: Problem): Observable<any> {
// if (Math.floor(Math.random() * 2) === 1) {return of('done'); }
// else {return throwError('error'); }
// }
verifyTestcase
(
file
:
File
,
out
:
string
,
ind
:
number
,
isSubmit
:
number
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
(
this
.
baseUrl
+
'
questions/check_output.php
'
,
{
title
:
file
.
filename
,
...
...
src/app/user.ts
View file @
90b4f1ad
/** \file
* Interface for User containing his/her details and login credentials.
* Used in services and components as a data structure for each user.
*/
export
interface
User
{
id
:
number
;
username
:
string
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment