Skip to content

Commit

Permalink
fixed get task for ta users
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunni committed Nov 30, 2013
1 parent 788fdc2 commit 2d43a5e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ServerSide/TAEvalServer/Storage/PersistImpSQL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ bool PersistImpSQL::getTasksForTA(QString info, QString TAKey, QList<Task> *&lis

/* for TA*/
if(role.compare("TA") == 0){
queryString = QString("SELECT * FROM TASKS WHERE TAName = '%1' AND CourseName in (select name from COURSES join TACOURSES on COURSES.name = TACOURSES.CourseName where TAName = '%1'' and term = '%2')").\
queryString = QString("SELECT * FROM TASKS WHERE TAName = '%1' AND CourseName in (select name from COURSES join TACOURSES on COURSES.name = TACOURSES.CourseName where TAName = '%1' and term = '%2')").\
arg(TAKey).arg(info);
}

Expand Down
Binary file modified ServerSide/TAEvalServer/Storage/taeval.db
Binary file not shown.
2 changes: 1 addition & 1 deletion ServerSide/TAEvalServer/TAEvalServer.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ QT += core sql network
TARGET = TAEvalServer
TEMPLATE = app


DEFINES += QT_NO_DEBUG_OUTPUT

SOURCES += main.cpp\
../../Common/task.cpp \
Expand Down
6 changes: 4 additions & 2 deletions ServerSide/TAEvalServer/taeval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ bool TAEval::getSemesters(QString userID, StringList *&list) // User MUST delete
if(accessControl.isLoggedIn(userID) && (accessControl.getUser(userID)->getUserType() == "Instructor" || accessControl.getUser(userID)->getUserType() == "TA"))
{
list = new StringList(dataStore.getSemesters(userID));
qDebug() << *list;
return true;
}
return false;
Expand Down Expand Up @@ -100,8 +99,11 @@ bool TAEval::getTasks(QString userID, QString course, QString ta, TaskList *&lis
{
if(accessControl.isLoggedIn(userID) && (accessControl.getUser(userID)->getUserType() == "Instructor" || accessControl.getUser(userID)->getUserType() == "TA"))
{
return dataStore.getTasksForTA(course,ta,list,accessControl.getUser(userID)->getUserType());
bool b = dataStore.getTasksForTA(course,ta,list,accessControl.getUser(userID)->getUserType());
//qDebug() << Task::listToString(*list);
return b;
}
qDebug() << "no access";
return false;
}

Expand Down

0 comments on commit 2d43a5e

Please sign in to comment.