Skip to content
Snippets Groups Projects
Commit 811b130f authored by wiepke's avatar wiepke
Browse files

Logout works now, fixed minor TODOs

parent 23602231
No related branches found
No related tags found
No related merge requests found
Showing
with 51 additions and 54 deletions
package unipotsdam.gf.config;
import org.glassfish.hk2.api.ServiceLocator;
import org.glassfish.hk2.utilities.ServiceLocatorUtilities;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
......@@ -15,20 +15,20 @@ public interface Feedback {
/**
* TODO implement a routine that assigns missing feedback tasks if someone drops out of a course
* @param project
* @param project which project needs feedbacks to be assigned
*/
void assigningMissingFeedbackTasks(Project project);
/**
* TODO implement: Assigns each student in a project a feedback target
* @param tasks
* assigns a user to feedback every other user
* @param tasks all feedbackTasks in a project
*/
void specifyFeedbackTasks(List<Task> tasks);
/**
* TODO implement: Get the research report you have to give feedback to
* @param student
* @return
* @param student which student to give feedback to
* @return The research Report that was written by the student
*/
ResearchReport getFeedbackTask(User student);
}
......@@ -132,7 +132,7 @@ public interface ICommunication {
boolean sendMessageToUsers(Project project, EMailMessage eMailMessage);
public void delete(User user) throws RocketChatDownException, UserDoesNotExistInRocketChatException;
void delete(User user) throws RocketChatDownException, UserDoesNotExistInRocketChatException;
}
......@@ -30,7 +30,6 @@ public interface IPeerAssessment {
Double getAssessmentForStudent(StudentIdentifier student);
//todo: obsolete, get rid of the following function
Map<StudentIdentifier, Double> calculateAssessment(ArrayList<Performance> totalPerformance);
/**
......
......@@ -4,7 +4,6 @@ import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
@XmlRootElement
public class Quiz {
private String type;
private String question;
......
......@@ -135,7 +135,6 @@ public class PeerAssessment implements IPeerAssessment {
Performance performance = new Performance();
StudentIdentifier userNameentifier = new StudentIdentifier(projectName, student);
groupId = groupDAO.getGroupByStudent(userNameentifier);
//todo: answered quizzes vervöllstandigen
Integer numberOfQuizzes = assessmentDBCommunication.getQuizCount(projectName);
List<Integer> answeredQuizzes = assessmentDBCommunication.getAnsweredQuizzes(userNameentifier);
for (Integer i=answeredQuizzes.size(); i<numberOfQuizzes;i++){
......
......@@ -10,7 +10,6 @@ import java.util.List;
/**
* Created by dehne on 31.05.2018.
* TODO in DAOs refaktorisieren, sobald es mehr wird
*/
public interface Management {
/**
......
......@@ -84,8 +84,6 @@ public class ProjectDAO {
String mysqlRequest = "DELETE FROM projects where name = (?)";
connect.issueInsertOrDeleteStatement(mysqlRequest, project.getName());
connect.close();
// TODO: delete all groups of project?
}
public Boolean exists(Project project) {
......
......@@ -556,7 +556,7 @@ public class SubmissionController implements ISubmission, HasProgress {
String id = rs.getString("id");
data.setFullSubmissionId(id);
} else {
// TODO handle "error"
log.debug("fullSubmissionID not found");
}
connection.close();
......@@ -618,7 +618,7 @@ public class SubmissionController implements ISubmission, HasProgress {
if (vereinfachtesResultSet.next()) {
String submissionId = vereinfachtesResultSet.getString("id");
String projectName = vereinfachtesResultSet.getString("projectName");
Category category = Category.TITEL; //todo: instead hard coding, look up which category is next to annotate
Category category = Category.TITEL;
FullSubmission fullSubmission = new FullSubmission(submissionId);
fullSubmission.setProjectName(projectName);
connection.close();
......
......@@ -135,8 +135,6 @@ public class SubmissionService {
@Path("/id/{submissionId}/projects/{projectId}/finalize")
public void finalize (@PathParam("submissionId") String submissionId, @PathParam("projectId") String projectId,
@Context HttpServletRequest req) {
// TODO implement
String userEmail = (String) req.getSession().getAttribute(GFContexts.USEREMAIL);
dossierCreationProcess.finalizeDossier(new FullSubmission(submissionId), new User(userEmail),
new Project(projectId));
......
......@@ -102,11 +102,10 @@ public class UserView {
/**
* checks if a user exists in order to log him in
*
* @param name
* @param password
* @param email
* @return
* @throws URISyntaxException
* @param name of the user
* @param password of the user
* @param email of the user
* @throws URISyntaxException when user doesn't exist
*/
// This method is called if HTML is request
@POST
......@@ -183,9 +182,9 @@ public class UserView {
/**
* * helper function for redirecting to a new page
*
* @param existsUrl
* @return
* @throws URISyntaxException
* @param existsUrl where to locate to
* @return to page "existsUrl"
* @throws URISyntaxException in case page doesn't exist
*/
private Response forwardToLocation(String existsUrl) throws URISyntaxException {
return Response.seeOther(new URI(existsUrl)).build();
......
......@@ -48,9 +48,6 @@ public class DossierCreationProcess {
// create a task, telling the docent to wait for students upload of dossiers
taskDAO.persist(project, new User(project.getAuthorEmail()), TaskName.WAITING_FOR_STUDENT_DOSSIERS, Phase
.DossierFeedback, TaskType.INFO);
// TODO create waiting for feedback to complete task
taskDAO.persistMemberTask(project, TaskName.UPLOAD_DOSSIER, Phase.DossierFeedback);
}
......@@ -126,8 +123,8 @@ public class DossierCreationProcess {
}*/
}
public void createSeeFeedBackTask(Project project, User distributer){
User user = submissionController.getFeedbackedUser(project, distributer);
public void createSeeFeedBackTask(Project project, User distributeur){
User user = submissionController.getFeedbackedUser(project, distributeur);
taskDAO.persist(project, user, TaskName.SEE_FEEDBACK, Phase.DossierFeedback);
}
}
......@@ -5,19 +5,13 @@ import unipotsdam.gf.exceptions.UserDoesNotExistInRocketChatException;
import unipotsdam.gf.modules.project.Project;
import unipotsdam.gf.modules.project.ProjectDAO;
import unipotsdam.gf.interfaces.IPhases;
import unipotsdam.gf.process.GroupFormationProcess;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.net.URI;
import java.net.URISyntaxException;
/**
* REST API for switching phases
......@@ -37,8 +31,8 @@ public class PhaseView {
/**
* end phase
*
* @param projectPhase
* @param projectName
* @param projectPhase which phase are you in
* @param projectName which project is about to leave a phase
*/
@Path("/{projectPhase}/projects/{projectName}/end")
@GET
......@@ -55,8 +49,8 @@ public class PhaseView {
/**
* get current phase
*
* @param projectName
* @return
* @param projectName which project is selected
* @return get the name of the current phase of the project
*/
@Path("/projects/{projectName}")
@GET
......
......@@ -7,12 +7,12 @@ import unipotsdam.gf.modules.assessment.controller.model.Quiz;
import unipotsdam.gf.modules.communication.model.chat.ChatRoom;
public class GFContext {
Project project;
User user;
Phase phase;
ChatRoom chatRoom;
private Project project;
private User user;
private Phase phase;
private ChatRoom chatRoom;
// could be quizState ....
Quiz quiz;
private Quiz quiz;
public GFContext(
Project project, User user, Phase phase, ChatRoom chatRoom, Quiz quiz) {
......
......@@ -7,6 +7,7 @@ import unipotsdam.gf.modules.user.UserDAO;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Path;
import java.io.IOException;
public class GFContexts {
......
package unipotsdam.gf.session;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
@Path("/logout")
public class GFLogout {
@POST
@Produces(MediaType.APPLICATION_JSON)
@Path("/user")
public void logoutUser(@Context HttpServletRequest req) {
req.getSession().setAttribute(GFContexts.USEREMAIL, null);
req.getSession().setAttribute(GFContexts.PROJECTNAME, null);
req.getSession().setAttribute(GFContexts.ISSTUDENT, null);
req.getSession().setAttribute(GFContexts.ROCKETCHATAUTHTOKEN, null);
req.getSession().setAttribute(GFContexts.ROCKETCHATID, null);
}
}
......@@ -4,13 +4,12 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import javax.xml.ws.WebServiceException;
import java.io.IOException;
public class RoleValidator extends SimpleTagSupport {
private String role = "public";
public void doTag() throws IOException {
public void doTag(){
PageContext pageContext = (PageContext) getJspContext();
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
......
......@@ -3,9 +3,6 @@
<%@ taglib uri="../taglibs/gemeinsamForschen.tld" prefix="headLine" %>
<%@ taglib uri="../taglibs/gemeinsamForschen.tld" prefix="omniDependencies" %>
<!-- TODO refactor @Sven: bitte nutze einen Unterordner für dein Modul z.B. webapp/annotation/ -->
<!DOCTYPE html>
<html lang="en">
<head>
......
$(document).ready(function () { //todo: paths should be relative
$(document).ready(function () {
$("#giveItBack").on("click", function () {
$.ajax({
url: "../rest/assessments/total/project/" + "gemeinsamForschen" + "/student/" + "Bela",
......@@ -14,7 +14,7 @@ $(document).ready(function () { //todo: paths should be relative
})
});
$("#calculateNow").on("click", function () {
var dataP = [
let dataP = [
{
"userNameentifier": {
"projectName": "projekt",
......
......@@ -58,7 +58,7 @@
<h2>Gruppeneinteilung</h2>
<div class="info-message">
<p>Tun sie dieses und jendes</p>
<p>Tun sie dieses und jenes</p>
</div>
<button id="btnRelocate" class="spacer-horizontal primary">Personen verschieben</button>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment