Commit 918df412 authored by Adarsh's avatar Adarsh

comments

parent 19d6efad
...@@ -21,7 +21,7 @@ export class ApiService { ...@@ -21,7 +21,7 @@ export class ApiService {
constructor(private httpClient: HttpClient) { constructor(private httpClient: HttpClient) {
} }
/* /*! \brief
This function is used to log in the user by posting username and password as it's parameters to the backend php scripts. This function is used to log in the user by posting username and password as it's parameters to the backend php scripts.
*/ */
...@@ -37,7 +37,7 @@ export class ApiService { ...@@ -37,7 +37,7 @@ export class ApiService {
})); }));
} }
/* /*! \brief
This function is used to register the user by posting name, email, username and password as it's parameters to the backend php scripts. This function is used to register the user by posting name, email, username and password as it's parameters to the backend php scripts.
*/ */
...@@ -48,7 +48,7 @@ export class ApiService { ...@@ -48,7 +48,7 @@ export class ApiService {
})); }));
} }
/* /*! \brief
This function is used to set token for the user to the local storage. This function is used to set token for the user to the local storage.
*/ */
...@@ -56,7 +56,7 @@ export class ApiService { ...@@ -56,7 +56,7 @@ export class ApiService {
localStorage.setItem('sfcode_user_token_2n1289bpxd', token); localStorage.setItem('sfcode_user_token_2n1289bpxd', token);
} }
/* /*! \brief
This function is used to get token for the user from the local storage. This function is used to get token for the user from the local storage.
*/ */
...@@ -64,7 +64,7 @@ export class ApiService { ...@@ -64,7 +64,7 @@ export class ApiService {
return localStorage.getItem('sfcode_user_token_2n1289bpxd'); return localStorage.getItem('sfcode_user_token_2n1289bpxd');
} }
/* /*! \brief
This function is used to delete token from the local storage. This function is used to delete token from the local storage.
*/ */
...@@ -72,7 +72,7 @@ export class ApiService { ...@@ -72,7 +72,7 @@ export class ApiService {
localStorage.removeItem('sfcode_user_token_2n1289bpxd'); localStorage.removeItem('sfcode_user_token_2n1289bpxd');
} }
/* /*! \brief
This function is used to check the login state of the user by the availability of token in local storage. This function is used to check the login state of the user by the availability of token in local storage.
*/ */
......
...@@ -15,7 +15,7 @@ export class AuthGuard implements CanActivate { ...@@ -15,7 +15,7 @@ export class AuthGuard implements CanActivate {
constructor(private dataService: ApiService, private router: Router) { constructor(private dataService: ApiService, private router: Router) {
} }
/* /*! \brief
This function checks the state of router and calls the boolean function isLogin() to check whether a user is logged in or not. This function checks the state of router and calls the boolean function isLogin() to check whether a user is logged in or not.
*/ */
canActivate( canActivate(
...@@ -26,7 +26,7 @@ export class AuthGuard implements CanActivate { ...@@ -26,7 +26,7 @@ export class AuthGuard implements CanActivate {
return this.isLogin(routeUrl); return this.isLogin(routeUrl);
} }
/* /*! \brief
This function calls Api Service to check the login status of the user and redirects the user to appropriate routes according to status. This function calls Api Service to check the login status of the user and redirects the user to appropriate routes according to status.
*/ */
......
...@@ -15,7 +15,7 @@ import { User } from './user'; ...@@ -15,7 +15,7 @@ import { User } from './user';
}) })
export class FileService { export class FileService {
/* /*! \brief
Url variables to store the backend urls for post and get requests. Url variables to store the backend urls for post and get requests.
*/ */
...@@ -29,7 +29,7 @@ export class FileService { ...@@ -29,7 +29,7 @@ export class FileService {
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
} }
/* /*! \brief
Temporary function to get files used for debugging. Temporary function to get files used for debugging.
*/ */
...@@ -51,7 +51,7 @@ export class FileService { ...@@ -51,7 +51,7 @@ export class FileService {
return of(ret); return of(ret);
} }
/* /*! \brief
Function to upload a file to the database using file interface and a boolean whether it is an attempt to a question Function to upload a file to the database using file interface and a boolean whether it is an attempt to a question
or created in ide. or created in ide.
*/ */
...@@ -60,7 +60,7 @@ export class FileService { ...@@ -60,7 +60,7 @@ export class FileService {
return this.http.post(this.saveUrl, {file, isAttempt}); return this.http.post(this.saveUrl, {file, isAttempt});
} }
/* /*! \brief
Function to upload a file to the database using upload option, was used for debugging. Function to upload a file to the database using upload option, was used for debugging.
*/ */
...@@ -70,7 +70,7 @@ export class FileService { ...@@ -70,7 +70,7 @@ export class FileService {
return this.http.post(this.uploadUrl, formData); return this.http.post(this.uploadUrl, formData);
} }
/* /*! \brief
Function to delete a file from the database and server, by a post request, posting file, username and number of files . Function to delete a file from the database and server, by a post request, posting file, username and number of files .
*/ */
...@@ -78,21 +78,21 @@ export class FileService { ...@@ -78,21 +78,21 @@ export class FileService {
return this.http.post(this.deleteUrl, {file, isFile, username, nFiles}); return this.http.post(this.deleteUrl, {file, isFile, username, nFiles});
} }
/* /*! \brief
Function to get files from the database and server, by a post request, posting username. Function to get files from the database and server, by a post request, posting username.
*/ */
getFileList(username: string): Observable<any> { getFileList(username: string): Observable<any> {
return this.http.post(this.fileListUrl, {username}); return this.http.post(this.fileListUrl, {username});
} }
/* /*! \brief
Function to get file's content from the database and server, by a post request, posting username and file's path. Function to get file's content from the database and server, by a post request, posting username and file's path.
*/ */
getFileContent(username: string, filepath: string): Observable<any> { getFileContent(username: string, filepath: string): Observable<any> {
return this.http.post(this.fileContentUrl, {username, file_path: filepath}); return this.http.post(this.fileContentUrl, {username, file_path: filepath});
} }
/* /*! \brief
Function to create a directory for a particular user on the server while posting username, directory name and it's path. Function to create a directory for a particular user on the server while posting username, directory name and it's path.
*/ */
createDirectory(username: string, dirname: string, path: string): Observable<any> { createDirectory(username: string, dirname: string, path: string): Observable<any> {
......
...@@ -15,6 +15,9 @@ export class ProblemService { ...@@ -15,6 +15,9 @@ export class ProblemService {
constructor() { constructor() {
} }
/*! \brief
Function to get temporary problems used for debugging.
*/
getProblems(): Observable<Problem[]> { getProblems(): Observable<Problem[]> {
const ret: Problem[] = []; const ret: Problem[] = [];
......
...@@ -19,14 +19,14 @@ export class QuestionService { ...@@ -19,14 +19,14 @@ export class QuestionService {
constructor(private http: HttpClient) { } constructor(private http: HttpClient) { }
/* /*! \brief
This function is used to upload question from each user to database. This function is used to upload question from each user to database.
*/ */
uploadQues(ques: Question): Observable<any> { uploadQues(ques: Question): Observable<any> {
return this.http.post(this.uploadUrl, ques); return this.http.post(this.uploadUrl, ques);
} }
/* /*! \brief
This function is used to get questions from all user from database. This function is used to get questions from all user from database.
*/ */
getQues(): Observable<Question[]> { getQues(): Observable<Question[]> {
......
...@@ -22,7 +22,7 @@ export class RunCodeService { ...@@ -22,7 +22,7 @@ export class RunCodeService {
constructor(private httpClient: HttpClient) { constructor(private httpClient: HttpClient) {
} }
/* /*! \brief
This function is used to post the file data for compilation. This function is used to post the file data for compilation.
*/ */
...@@ -30,7 +30,7 @@ export class RunCodeService { ...@@ -30,7 +30,7 @@ export class RunCodeService {
return this.httpClient.post(this.baseUrl + 'compile.php', file); return this.httpClient.post(this.baseUrl + 'compile.php', file);
} }
/* /*! \brief
This function is used to post the file data and custom input for execution. This function is used to post the file data and custom input for execution.
*/ */
...@@ -41,7 +41,7 @@ export class RunCodeService { ...@@ -41,7 +41,7 @@ export class RunCodeService {
}); });
} }
/* /*! \brief
This function is used to verify the testcases while posting the file data and other relaated parameters to the backend. This function is used to verify the testcases while posting the file data and other relaated parameters to the backend.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment