Skip to content
Snippets Groups Projects
Commit 8e2ff651 authored by Julian Dehne's avatar Julian Dehne
Browse files

added hook for peer assessment

parent 62ceed08
No related branches found
No related tags found
No related merge requests found
Showing
with 73 additions and 15 deletions
File deleted
...@@ -44,10 +44,7 @@ import unipotsdam.gf.modules.submission.controller.SubmissionController; ...@@ -44,10 +44,7 @@ import unipotsdam.gf.modules.submission.controller.SubmissionController;
import unipotsdam.gf.modules.user.UserDAO; import unipotsdam.gf.modules.user.UserDAO;
import unipotsdam.gf.mysql.MysqlConnect; import unipotsdam.gf.mysql.MysqlConnect;
import unipotsdam.gf.mysql.MysqlConnectImpl; import unipotsdam.gf.mysql.MysqlConnectImpl;
import unipotsdam.gf.process.DossierCreationProcess; import unipotsdam.gf.process.*;
import unipotsdam.gf.process.GroupFormationProcess;
import unipotsdam.gf.process.ProjectCreationProcess;
import unipotsdam.gf.process.SurveyProcess;
import unipotsdam.gf.process.constraints.ConstraintsImpl; import unipotsdam.gf.process.constraints.ConstraintsImpl;
import unipotsdam.gf.process.phases.PhasesImpl; import unipotsdam.gf.process.phases.PhasesImpl;
import unipotsdam.gf.process.tasks.TaskDAO; import unipotsdam.gf.process.tasks.TaskDAO;
...@@ -76,6 +73,7 @@ public class GFApplicationBinder extends AbstractBinder { ...@@ -76,6 +73,7 @@ public class GFApplicationBinder extends AbstractBinder {
bind(EmailService.class).to(EmailService.class); bind(EmailService.class).to(EmailService.class);
bind(ManagementImpl.class).to(Management.class); bind(ManagementImpl.class).to(Management.class);
bind(PeerAssessment.class).to(IPeerAssessment.class); bind(PeerAssessment.class).to(IPeerAssessment.class);
bind(PeerAssessmentProcess.class).to(PeerAssessmentProcess.class);
bind(PhasesImpl.class).to(IPhases.class); bind(PhasesImpl.class).to(IPhases.class);
bind(GFContext.class).to(GFContext.class); bind(GFContext.class).to(GFContext.class);
bind(ManagementImpl.class).to(Management.class); bind(ManagementImpl.class).to(Management.class);
......
...@@ -51,6 +51,7 @@ public class DossierCreationProcess { ...@@ -51,6 +51,7 @@ public class DossierCreationProcess {
@Inject @Inject
private GroupDAO groupDAO; private GroupDAO groupDAO;
/** /**
* start the Dossier Phase * start the Dossier Phase
* *
...@@ -148,6 +149,13 @@ public class DossierCreationProcess { ...@@ -148,6 +149,13 @@ public class DossierCreationProcess {
iCommunication.sendMessageToUsers(project, Messages.NewFeedbackTask(project)); iCommunication.sendMessageToUsers(project, Messages.NewFeedbackTask(project));
saveState(project, changeToPhase); saveState(project, changeToPhase);
}*/ }*/
// add peer assessment tasks
// note that this should be moved to another process later on
//peerAssessmentProcess.startPeerAssessmentPhaseForTest(project);
} }
public void createSeeFeedBackTask(Project project, Integer groupId) { public void createSeeFeedBackTask(Project project, Integer groupId) {
......
...@@ -13,8 +13,6 @@ import unipotsdam.gf.modules.group.GroupFormationMechanism; ...@@ -13,8 +13,6 @@ import unipotsdam.gf.modules.group.GroupFormationMechanism;
import unipotsdam.gf.modules.group.preferences.database.ProfileDAO; import unipotsdam.gf.modules.group.preferences.database.ProfileDAO;
import unipotsdam.gf.modules.project.Project; import unipotsdam.gf.modules.project.Project;
import unipotsdam.gf.modules.project.ProjectDAO; import unipotsdam.gf.modules.project.ProjectDAO;
import unipotsdam.gf.modules.user.User;
import unipotsdam.gf.modules.user.UserDAO;
import unipotsdam.gf.process.phases.Phase; import unipotsdam.gf.process.phases.Phase;
import unipotsdam.gf.process.tasks.Progress; import unipotsdam.gf.process.tasks.Progress;
import unipotsdam.gf.process.tasks.Task; import unipotsdam.gf.process.tasks.Task;
...@@ -47,6 +45,12 @@ public class GroupFormationProcess { ...@@ -47,6 +45,12 @@ public class GroupFormationProcess {
@Inject @Inject
private ICommunication iCommunication; private ICommunication iCommunication;
/**
* changes the group formation algorithm to the given.
* @param groupFormationMechanism
* @param project
*/
public void setGroupFormationMechanism(GroupFormationMechanism groupFormationMechanism, Project project) { public void setGroupFormationMechanism(GroupFormationMechanism groupFormationMechanism, Project project) {
projectDAO.setGroupFormationMechanism(groupFormationMechanism, project); projectDAO.setGroupFormationMechanism(groupFormationMechanism, project);
} }
......
...@@ -8,6 +8,8 @@ import unipotsdam.gf.process.tasks.*; ...@@ -8,6 +8,8 @@ import unipotsdam.gf.process.tasks.*;
import javax.inject.Inject; import javax.inject.Inject;
import static unipotsdam.gf.process.tasks.TaskName.UPLOAD_PRESENTATION;
public class PeerAssessmentProcess { public class PeerAssessmentProcess {
@Inject @Inject
...@@ -16,7 +18,20 @@ public class PeerAssessmentProcess { ...@@ -16,7 +18,20 @@ public class PeerAssessmentProcess {
@Inject @Inject
private UserDAO userDAO; private UserDAO userDAO;
public void start(Project project) { /**
* this function is only used to show the peer assessment phase before previous phases are ready
* @param project
*/
public void startPeerAssessmentPhaseForTest(Project project) {
//Task task = new Task(TaskName.UPLOAD_PRESENTATION, project, Progress.JUSTSTARTED);
taskDAO.persistTaskForAllGroups(project, UPLOAD_PRESENTATION, Phase.GroupFormation);
}
/**
* IF WE GET TO THE PEER ASSESSMENT PHASE NATURALLY (NOT VIA DIRECT LINK AFTER GROUP FORMATION)
* COMMENT THE FUNCTIONS IN THAT ARE NEEDED
*/
/* public void start(Project project) {
Task task = new Task(TaskName.CLOSE_EXECUTION_PHASE, project.getAuthorEmail(), project.getName(), Task task = new Task(TaskName.CLOSE_EXECUTION_PHASE, project.getAuthorEmail(), project.getName(),
Progress.FINISHED); Progress.FINISHED);
taskDAO.updateForUser(task); taskDAO.updateForUser(task);
...@@ -52,17 +67,17 @@ public class PeerAssessmentProcess { ...@@ -52,17 +67,17 @@ public class PeerAssessmentProcess {
taskDAO.updateForUser(task); taskDAO.updateForUser(task);
taskDAO.persist(taskDAO.createUserDefault(project, user, TaskName.END, Phase.Projectfinished)); taskDAO.persist(taskDAO.createUserDefault(project, user, TaskName.END, Phase.Projectfinished));
//todo: implement communication stuff //todo: implement communication stuff
/* if (tasks.size() > 0) { *//* if (tasks.size() > 0) {
iCommunication.informAboutMissingTasks(tasks, project); iCommunication.informAboutMissingTasks(tasks, project);
} else { } else {
// send a message to the users informing them about the start of the new phase // send a message to the users informing them about the start of the new phase
iCommunication.sendMessageToUsers(project, Messages.NewFeedbackTask(project)); iCommunication.sendMessageToUsers(project, Messages.NewFeedbackTask(project));
saveState(project, changeToPhase); saveState(project, changeToPhase);
}*/ }*//*
} }
public void createSeeAssessmentTask(Project project, User user) { public void createSeeAssessmentTask(Project project, User user) {
taskDAO.persist(project, user, TaskName.SEE_ASSESSMENT, Phase.Assessment); taskDAO.persist(project, user, TaskName.SEE_ASSESSMENT, Phase.Assessment);
} }*/
} }
package unipotsdam.gf.process.tasks; package unipotsdam.gf.process.tasks;
import unipotsdam.gf.modules.project.Project;
import unipotsdam.gf.process.phases.Phase; import unipotsdam.gf.process.phases.Phase;
public class Task { public class Task {
...@@ -25,6 +26,12 @@ public class Task { ...@@ -25,6 +26,12 @@ public class Task {
private String projectName; private String projectName;
private Progress progress; private Progress progress;
public Task(TaskName taskName, Project project, Progress progress) {
this.taskName = taskName;
this.projectName = project.getName();
this.progress = progress;
}
public String getUserEmail() { public String getUserEmail() {
return userEmail; return userEmail;
} }
......
...@@ -12,6 +12,9 @@ public enum TaskName { ...@@ -12,6 +12,9 @@ public enum TaskName {
FINALIZE_EJOURNAL, FINALIZE_EJOURNAL,
EDIT_FORMED_GROUPS, CONTACT_GROUP_MEMBERS, ASSESSMENT, WAITING_FOR_STUDENT_DOSSIERS, EDIT_FEEDBACK, EDIT_FORMED_GROUPS, CONTACT_GROUP_MEMBERS, ASSESSMENT, WAITING_FOR_STUDENT_DOSSIERS, EDIT_FEEDBACK,
// assessment tasks
UPLOAD_PRESENTATION, UPLOAD_FINAL_REPORT,
GIVE_ASSESSMENT, SEE_ASSESSMENT, GIVE_ASSESSMENT, SEE_ASSESSMENT,
END END,
} }
...@@ -332,7 +332,9 @@ function fillObjectWithTasks(response) { ...@@ -332,7 +332,9 @@ function fillObjectWithTasks(response) {
function redirect(url) { function redirect(url) {
location.href = url; location.href = url;
} }
/**
* TODO @Axel move this to better location
*/
function closePhase(phase, projectName) { function closePhase(phase, projectName) {
let innerurl = '../rest/phases/' + phase + '/projects/' + projectName + '/end'; let innerurl = '../rest/phases/' + phase + '/projects/' + projectName + '/end';
$.ajax({ $.ajax({
...@@ -352,6 +354,9 @@ function closePhase(phase, projectName) { ...@@ -352,6 +354,9 @@ function closePhase(phase, projectName) {
}) })
} }
/**
* TODO @Axel move this to better location
*/
function initializeGroups(projectName) { function initializeGroups(projectName) {
let projq = new RequestObj(1, "/group", "/all/projects/?", [projectName], []); let projq = new RequestObj(1, "/group", "/all/projects/?", [projectName], []);
serverSide(projq, "GET", function (response) { serverSide(projq, "GET", function (response) {
...@@ -379,6 +384,9 @@ function waitForParticipantsInfoText(object) { ...@@ -379,6 +384,9 @@ function waitForParticipantsInfoText(object) {
return result return result
} }
/**
* TODO @Axel move this to better location
*/
function resizeGroup(){ function resizeGroup(){
$.ajax({ $.ajax({
url: '../rest/project/update/project/' + $('#projectName').html().trim() + '/groupSize/' + $('#userCount').val().trim(), url: '../rest/project/update/project/' + $('#projectName').html().trim() + '/groupSize/' + $('#userCount').val().trim(),
...@@ -392,6 +400,9 @@ function resizeGroup(){ ...@@ -392,6 +400,9 @@ function resizeGroup(){
}); });
} }
/**
* TODO @Axel move this to better location or delete
*/
function updateGroupSizeView(){ function updateGroupSizeView(){
let userCount = parseInt($('#userCount').val().trim()); let userCount = parseInt($('#userCount').val().trim());
$('#groupSize').html(userCount*(userCount-1)); $('#groupSize').html(userCount*(userCount-1));
......
...@@ -6,9 +6,7 @@ public class SurveyPreparation { ...@@ -6,9 +6,7 @@ public class SurveyPreparation {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
UpdateDB.main(new String[0]); UpdateDB.main(new String[0]);
SurveyPreparationHelper surveyPreparationHelper = new SurveyPreparationHelper(); SurveyPreparationHelper surveyPreparationHelper = new SurveyPreparationHelper();
surveyPreparationHelper.prepareSurvey(); surveyPreparationHelper.prepareSurvey();
} }
......
package unipotsdam.gf.modules.peerassessment; package unipotsdam.gf.modules.assessment;
import org.junit.Test; import org.junit.Test;
import unipotsdam.gf.modules.assessment.controller.model.Performance; import unipotsdam.gf.modules.assessment.controller.model.Performance;
......
...@@ -5,6 +5,7 @@ import org.glassfish.hk2.utilities.ServiceLocatorUtilities; ...@@ -5,6 +5,7 @@ import org.glassfish.hk2.utilities.ServiceLocatorUtilities;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import unipotsdam.gf.core.database.TestGFApplicationBinder; import unipotsdam.gf.core.database.TestGFApplicationBinder;
import unipotsdam.gf.modules.project.Project;
import unipotsdam.gf.mysql.MysqlConnect; import unipotsdam.gf.mysql.MysqlConnect;
import unipotsdam.gf.mysql.VereinfachtesResultSet; import unipotsdam.gf.mysql.VereinfachtesResultSet;
import unipotsdam.gf.interfaces.IPeerAssessment; import unipotsdam.gf.interfaces.IPeerAssessment;
...@@ -14,6 +15,7 @@ import unipotsdam.gf.modules.assessment.controller.model.Quiz; ...@@ -14,6 +15,7 @@ import unipotsdam.gf.modules.assessment.controller.model.Quiz;
import unipotsdam.gf.modules.assessment.controller.model.StudentAndQuiz; import unipotsdam.gf.modules.assessment.controller.model.StudentAndQuiz;
import unipotsdam.gf.modules.assessment.controller.model.StudentIdentifier; import unipotsdam.gf.modules.assessment.controller.model.StudentIdentifier;
import unipotsdam.gf.modules.assessment.controller.service.PeerAssessment; import unipotsdam.gf.modules.assessment.controller.service.PeerAssessment;
import unipotsdam.gf.process.PeerAssessmentProcess;
import javax.inject.Inject; import javax.inject.Inject;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -21,8 +23,14 @@ import java.util.HashMap; ...@@ -21,8 +23,14 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public class TestAddAssessment { public class TestAddAssessment {
@Inject
private PeerAssessmentProcess peerAssessmentProcess;
@Inject @Inject
private IPeerAssessment peer; private IPeerAssessment peer;
private String userName = "Kevin"; private String userName = "Kevin";
...@@ -164,5 +172,11 @@ public class TestAddAssessment { ...@@ -164,5 +172,11 @@ public class TestAddAssessment {
connect.close(); connect.close();
} }
@Test
public void quickstartAssessmentPhase() {
Project project = new Project("Meine Güte");
peerAssessmentProcess.startPeerAssessmentPhaseForTest(project);
}
} }
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