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

bugfixing: fixed feedbackassignment

parents 4f77df33 d709f1d3
No related branches found
No related tags found
No related merge requests found
Showing
with 615 additions and 218 deletions
...@@ -6,9 +6,10 @@ import unipotsdam.gf.modules.annotation.controller.AnnotationController; ...@@ -6,9 +6,10 @@ import unipotsdam.gf.modules.annotation.controller.AnnotationController;
import unipotsdam.gf.modules.assessment.controller.service.AssessmentDBCommunication; import unipotsdam.gf.modules.assessment.controller.service.AssessmentDBCommunication;
import unipotsdam.gf.modules.assessment.controller.service.PeerAssessment; import unipotsdam.gf.modules.assessment.controller.service.PeerAssessment;
import unipotsdam.gf.modules.communication.service.CommunicationDummyService; import unipotsdam.gf.modules.communication.service.CommunicationDummyService;
import unipotsdam.gf.modules.group.DummyGroupfinding;
import unipotsdam.gf.modules.group.DummyProjectCreationService; import unipotsdam.gf.modules.group.DummyProjectCreationService;
import unipotsdam.gf.modules.group.GroupDAO; import unipotsdam.gf.modules.group.GroupDAO;
import unipotsdam.gf.modules.group.GroupfindingImpl;
import unipotsdam.gf.modules.journal.service.IJournalImpl;
import unipotsdam.gf.modules.project.Management; import unipotsdam.gf.modules.project.Management;
import unipotsdam.gf.modules.project.ManagementImpl; import unipotsdam.gf.modules.project.ManagementImpl;
import unipotsdam.gf.modules.project.ProjectConfigurationDAO; import unipotsdam.gf.modules.project.ProjectConfigurationDAO;
...@@ -34,12 +35,12 @@ public class GFApplicationBinder extends AbstractBinder { ...@@ -34,12 +35,12 @@ public class GFApplicationBinder extends AbstractBinder {
protected void configure() { protected void configure() {
bind(CommunicationDummyService.class).to(ICommunication.class); bind(CommunicationDummyService.class).to(ICommunication.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(PhasesImpl.class).to(IPhases.class); bind(PhasesImpl.class).to(IPhases.class);
bind(ManagementImpl.class).to(Management.class); bind(ManagementImpl.class).to(Management.class);
bind(DummyResearchReportManagement.class).to(ResearchReportManagement.class); bind(DummyResearchReportManagement.class).to(ResearchReportManagement.class);
bind(DummyGroupfinding.class).to(IGroupFinding.class); bind(IJournalImpl.class).to(IJournal.class);
bind(GroupfindingImpl.class).to(IGroupFinding.class);
bind(AssessmentDBCommunication.class).to(AssessmentDBCommunication.class); bind(AssessmentDBCommunication.class).to(AssessmentDBCommunication.class);
bind(GFContexts.class).to(GFContexts.class); bind(GFContexts.class).to(GFContexts.class);
bind(ProjectCreationProcess.class).to(ProjectCreationProcess.class); bind(ProjectCreationProcess.class).to(ProjectCreationProcess.class);
......
...@@ -11,9 +11,5 @@ public interface IPhases { ...@@ -11,9 +11,5 @@ public interface IPhases {
*/ */
void endPhase(Phase phase, Project project); void endPhase(Phase phase, Project project);
/**
* the dependency to feedback should be settable externally for test reasons
* @param feedback the feedback that is send
*/
void setFeedback(Feedback feedback);
} }
package unipotsdam.gf.modules.group;
import unipotsdam.gf.modules.project.Project;
import unipotsdam.gf.assignments.Assignee;
import unipotsdam.gf.assignments.NotImplementedLogger;
import unipotsdam.gf.interfaces.IGroupFinding;
import unipotsdam.gf.modules.assessment.controller.model.StudentIdentifier;
import java.util.ArrayList;
import java.util.List;
public class DummyGroupfinding implements IGroupFinding {
@Override
public void selectGroupfindingCriteria(
GroupfindingCriteria groupfindingCriteria, Project project) {
NotImplementedLogger.logAssignment(Assignee.MIRJAM, IGroupFinding.class);
}
@Override
public void persistGroups(
List<Group> groupComposition, Project project){
NotImplementedLogger.logAssignment(Assignee.MIRJAM, IGroupFinding.class);
}
@Override
public List<Group> getGroups(Project project) {
NotImplementedLogger.logAssignment(Assignee.MIRJAM, IGroupFinding.class);
return new ArrayList<>();
}
@Override
public void formGroups(GroupFormationMechanism groupFindingMechanism) {
NotImplementedLogger.logAssignment(Assignee.MIRJAM, IGroupFinding.class);
}
@Override
public ArrayList<String> getStudentsInSameGroup(
StudentIdentifier student) {
return null;
}
@Override
public int getMinNumberOfStudentsNeeded(Project project) {
return 2;
}
}
...@@ -29,9 +29,6 @@ public class ProjectView { ...@@ -29,9 +29,6 @@ public class ProjectView {
@Inject @Inject
private Management iManagement; private Management iManagement;
@Inject
private TaskDAO taskDao;
@Inject @Inject
private ProjectCreationProcess projectCreationProcess; private ProjectCreationProcess projectCreationProcess;
......
...@@ -2,6 +2,8 @@ package unipotsdam.gf.modules.submission.controller; ...@@ -2,6 +2,8 @@ package unipotsdam.gf.modules.submission.controller;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import unipotsdam.gf.modules.group.GroupDAO;
import unipotsdam.gf.modules.group.GroupFormationMechanism;
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.submission.view.SubmissionRenderData; import unipotsdam.gf.modules.submission.view.SubmissionRenderData;
...@@ -22,6 +24,7 @@ import unipotsdam.gf.process.phases.Phase; ...@@ -22,6 +24,7 @@ import unipotsdam.gf.process.phases.Phase;
import unipotsdam.gf.process.progress.HasProgress; import unipotsdam.gf.process.progress.HasProgress;
import unipotsdam.gf.process.progress.ProgressData; import unipotsdam.gf.process.progress.ProgressData;
import unipotsdam.gf.process.tasks.FeedbackTaskData; import unipotsdam.gf.process.tasks.FeedbackTaskData;
import unipotsdam.gf.process.tasks.ParticipantsCount;
import javax.inject.Inject; import javax.inject.Inject;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -41,7 +44,10 @@ public class SubmissionController implements ISubmission, HasProgress { ...@@ -41,7 +44,10 @@ public class SubmissionController implements ISubmission, HasProgress {
private UserDAO userDAO; private UserDAO userDAO;
@Inject @Inject
private ConstraintsImpl constraints; private GroupDAO groupDAO;
@Inject
private ProjectDAO projectDAO;
private static final org.slf4j.Logger log = LoggerFactory.getLogger(SubmissionController.class); private static final org.slf4j.Logger log = LoggerFactory.getLogger(SubmissionController.class);
...@@ -570,8 +576,8 @@ public class SubmissionController implements ISubmission, HasProgress { ...@@ -570,8 +576,8 @@ public class SubmissionController implements ISubmission, HasProgress {
*/ */
public void markAsFinal(FullSubmission fullSubmission) { public void markAsFinal(FullSubmission fullSubmission) {
connection.connect(); connection.connect();
String query = "update fullsubmission set finalized = ? where id = ?"; String query = "update fullsubmissions set finalized = ? where id = ?";
connection.issueUpdateStatement(query, true, fullSubmission.getId()); connection.issueUpdateStatement(query, 1, fullSubmission.getId());
connection.close(); connection.close();
} }
...@@ -616,7 +622,7 @@ public class SubmissionController implements ISubmission, HasProgress { ...@@ -616,7 +622,7 @@ public class SubmissionController implements ISubmission, HasProgress {
Integer count = null; Integer count = null;
String query = "SELECT COUNT(*) from fullsubmissions where projectName = ? and finalized = ?"; String query = "SELECT COUNT(*) from fullsubmissions where projectName = ? and finalized = ?";
VereinfachtesResultSet vereinfachtesResultSet = connection.issueSelectStatement(query); VereinfachtesResultSet vereinfachtesResultSet = connection.issueSelectStatement(query, project.getName(), true);
vereinfachtesResultSet.next(); vereinfachtesResultSet.next();
count = vereinfachtesResultSet.getInt(1); count = vereinfachtesResultSet.getInt(1);
connection.close(); connection.close();
...@@ -633,13 +639,58 @@ public class SubmissionController implements ISubmission, HasProgress { ...@@ -633,13 +639,58 @@ public class SubmissionController implements ISubmission, HasProgress {
progressData.setNumberOfCompletion(getFinalizedDossiersCount(project)); progressData.setNumberOfCompletion(getFinalizedDossiersCount(project));
// the number of dossiers needed relativ to the group or user count // the number of dossiers needed relativ to the group or user count
progressData.setNumberNeeded(constraints.dossiersNeeded(project)); progressData.setNumberNeeded(dossiersNeeded(project));
List<User> strugglersWithSubmission = constraints.getStrugglersWithSubmission(project); List<User> strugglersWithSubmission = getStrugglersWithSubmission(project);
progressData.setUsersMissing(strugglersWithSubmission); progressData.setUsersMissing(strugglersWithSubmission);
progressData.setAlmostComplete((progressData.getNumberNeeded()/progressData.getNumberOfCompletion()) <= (1/10)); progressData.setAlmostComplete((progressData.getNumberNeeded()/progressData.getNumberOfCompletion()) <= (1/10));
return progressData; return progressData;
} }
/**
* get how many dossiers are needed
*
* @param project
* @return
*/
public int dossiersNeeded(Project project) {
GroupFormationMechanism groupFormationMechanism = groupDAO.getGroupFormationMechanism(project);
Integer result = 0;
switch (groupFormationMechanism) {
case SingleUser:
ParticipantsCount participantCount = projectDAO.getParticipantCount(project);
result = participantCount.getParticipants();
break;
case LearningGoalStrategy:
case UserProfilStrategy:
case Manual:
int groupCount = groupDAO.getGroupsByProjectName(project.getName()).size();
result = groupCount;
break;
}
return result;
}
public List<User> getStrugglersWithSubmission(Project project) {
ArrayList<User> struggles = new ArrayList<>();
GroupFormationMechanism groupFormationMechanism = groupDAO.getGroupFormationMechanism(project);
switch (groupFormationMechanism) {
case SingleUser:
List<User> usersInProject = userDAO.getUsersByProjectName(project.getName());
List<User> usersHavingGivenFeedback = getAllUsersWithFeedbackGiven(project);
for (User user : usersInProject) {
if (!usersHavingGivenFeedback.contains(user)) {
struggles.add(user);
}
}
break;
case LearningGoalStrategy:
case Manual:
case UserProfilStrategy:
}
return struggles;
}
public List<User> getAllUsersWithFeedbackGiven(Project project) { public List<User> getAllUsersWithFeedbackGiven(Project project) {
List<User> result = new ArrayList<>(); List<User> result = new ArrayList<>();
connection.connect(); connection.connect();
......
...@@ -35,8 +35,6 @@ public class ProjectCreationProcess { ...@@ -35,8 +35,6 @@ public class ProjectCreationProcess {
@Inject @Inject
private GroupDAO groupDAO; private GroupDAO groupDAO;
@Inject
private IPhases phases;
/** /**
* STEP 1 * STEP 1
......
...@@ -73,50 +73,7 @@ public class ConstraintsImpl { ...@@ -73,50 +73,7 @@ public class ConstraintsImpl {
return result; return result;
} }
/**
* get how many dossiers are needed
*
* @param project
* @return
*/
public int dossiersNeeded(Project project) {
GroupFormationMechanism groupFormationMechanism = groupDAO.getGroupFormationMechanism(project);
Integer result = 0;
switch (groupFormationMechanism) {
case SingleUser:
ParticipantsCount participantCount = projectDAO.getParticipantCount(project);
result = participantCount.getParticipants();
break;
case LearningGoalStrategy:
case UserProfilStrategy:
case Manual:
int groupCount = groupDAO.getGroupsByProjectName(project.getName()).size();
result = groupCount;
break;
}
return result;
}
public List<User> getStrugglersWithSubmission(Project project) {
ArrayList<User> struggles = new ArrayList<>();
GroupFormationMechanism groupFormationMechanism = groupDAO.getGroupFormationMechanism(project);
switch (groupFormationMechanism) {
case SingleUser:
List<User> usersInProject = userDAO.getUsersByProjectName(project.getName());
List<User> usersHavingGivenFeedback = submissionController.getAllUsersWithFeedbackGiven(project);
for (User user : usersInProject) {
if (!usersHavingGivenFeedback.contains(user)) {
struggles.add(user);
}
}
break;
case LearningGoalStrategy:
case Manual:
case UserProfilStrategy:
}
return struggles;
}
} }
...@@ -35,9 +35,6 @@ public class PhasesImpl implements IPhases { ...@@ -35,9 +35,6 @@ public class PhasesImpl implements IPhases {
@Inject @Inject
private IPeerAssessment iPeerAssessment; private IPeerAssessment iPeerAssessment;
@Inject
private Feedback feedback;
@Inject @Inject
private ICommunication iCommunication; private ICommunication iCommunication;
...@@ -47,8 +44,7 @@ public class PhasesImpl implements IPhases { ...@@ -47,8 +44,7 @@ public class PhasesImpl implements IPhases {
@Inject @Inject
private DossierCreationProcess dossierCreationProcess; private DossierCreationProcess dossierCreationProcess;
@Inject
private ConstraintsImpl constraints;
public PhasesImpl() { public PhasesImpl() {
...@@ -152,7 +148,5 @@ public class PhasesImpl implements IPhases { ...@@ -152,7 +148,5 @@ public class PhasesImpl implements IPhases {
} }
public void setFeedback(Feedback feedback) {
this.feedback = feedback;
}
} }
...@@ -29,7 +29,7 @@ public class OmniDependencies extends SimpleTagSupport { ...@@ -29,7 +29,7 @@ public class OmniDependencies extends SimpleTagSupport {
" <link rel=\"stylesheet\" href=\"" + hierarchyToString(hierarchyLevel) + "project/css/style.css\" type=\"text/css\">" + " <link rel=\"stylesheet\" href=\"" + hierarchyToString(hierarchyLevel) + "project/css/style.css\" type=\"text/css\">" +
" <link rel=\"stylesheet\" href=\"" + hierarchyToString(hierarchyLevel) + "libs/tagsinput/jquery.tagsinput.min.css\">\n" + " <link rel=\"stylesheet\" href=\"" + hierarchyToString(hierarchyLevel) + "libs/tagsinput/jquery.tagsinput.min.css\">\n" +
" <script src=\"" + hierarchyToString(hierarchyLevel) + "libs/tagsinput/jquery.tagsinput.min.js\"></script>\n" + " <script src=\"" + hierarchyToString(hierarchyLevel) + "libs/tagsinput/jquery.tagsinput.min.js\"></script>\n" +
" <script type=\"text/javascript\" src=\"http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.js\"></script>"+ " <script type=\"text/javascript\" src=\"" + hierarchyToString(hierarchyLevel) + "libs/jquery/jqueryTemplate.js\"></script>"+
" <link rel=\"stylesheet\" href=\"https://use.fontawesome.com/releases/v5.1.0/css/all.css\"\n" + " <link rel=\"stylesheet\" href=\"https://use.fontawesome.com/releases/v5.1.0/css/all.css\"\n" +
" integrity=\"sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt\" crossorigin=\"anonymous\">"); " integrity=\"sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt\" crossorigin=\"anonymous\">");
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<%@ taglib uri="../taglibs/gemeinsamForschen.tld" prefix="menu" %> <%@ taglib uri="../taglibs/gemeinsamForschen.tld" prefix="menu" %>
<%@ taglib uri="../taglibs/gemeinsamForschen.tld" prefix="headLine" %> <%@ taglib uri="../taglibs/gemeinsamForschen.tld" prefix="headLine" %>
<%@ taglib uri="../taglibs/gemeinsamForschen.tld" prefix="omniDependencies" %> <%@ taglib uri="../taglibs/gemeinsamForschen.tld" prefix="omniDependencies" %>
<%@ taglib uri="../taglibs/gemeinsamForschen.tld" prefix="footer" %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
...@@ -37,75 +38,37 @@ ...@@ -37,75 +38,37 @@
<body> <body>
<menu:menu hierarchy="1"/> <menu:menu hierarchy="1"/>
<div id="wrapper"> <div class="col span_l_of_2"> <!-- col right-->
<div class="page-content-wrapper full-height"> <headLine:headLine/>
<div class="container-fluid full-height"> <div class="content-mainpage">
<div class="container-fluid-content"> <div class="leftcolumn">
<div class="flex"> <div class="leftcontent">
<headLine:headLine/> <div class="leftcontent-text context-menu-one" id="documentText"></div>
</div> <div class="leftcontent-buttons">
<div class="content-mainpage"> <div class="leftcontent-buttons-save">
<div class="leftcolumn"> <button id="btnSave" type="button" class="btn btn-secondary">Speichern</button>
<div class="leftcontent">
<div class="leftcontent-text context-menu-one" id="documentText"></div>
<div class="leftcontent-buttons">
<div class="leftcontent-buttons-save">
<button id="btnSave" type="button" class="btn btn-secondary">Speichern</button>
</div>
</div>
</div>
</div>
<div class="rightcolumn">
<div class="rightcontent">
<ol id="annotations">
<li class="spacing">
<div id="titel" class="category-card not-added">
<p>Titel</p>
</div>
</li>
<li class="spacing">
<div id="recherche" class="category-card not-added">
<p>Recherche</p>
</div>
</li>
<li class="spacing">
<div id="literaturverzeichnis" class="category-card not-added">
<p>Literaturverzeichnis</p>
</div>
</li>
<li class="spacing">
<div id="forschungsfrage" class="category-card not-added">
<p>Forschungsfrage</p>
</div>
</li>
<li class="spacing">
<div id="untersuchungskonzept" class="category-card not-added">
<p>Untersuchungskonzept</p>
</div>
</li>
<li class="spacing">
<div id="methodik" class="category-card not-added">
<p>Methodik</p>
</div>
</li>
<li class="spacing">
<div id="durchfuehrung" class="category-card not-added">
<p>Durchführung</p>
</div>
</li>
<li>
<div id="auswertung" class="category-card not-added">
<p>Auswertung</p>
</div>
</li>
</ol>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="rightcolumn">
<div id="missingAnnotation" class="alert alert-warning"></div>
<div class="rightcontent">
<ol id="annotations">
</ol>
<script id="annotationTemplate" type="text/x-jQuery-tmpl">
<li class="spacing">
<div id="${annotationType}" class="category-card not-added">
<p>${annotationType}</p>
</div>
</li>
</script>
</div>
</div>
</div> </div>
</div> </div>
<footer:footer/>
</body> </body>
</html> </html>
...@@ -2,14 +2,15 @@ ...@@ -2,14 +2,15 @@
* This function will fire when the DOM is ready * This function will fire when the DOM is ready
*/ */
$(document).ready(function () { $(document).ready(function () {
$('#missingAnnotation').hide();
buildAnnotationList();
// fetch the document text of the given id // fetch the document text of the given id
getFullSubmission(getSubmissionIdFromUrl(), function (response) { getFullSubmission(getQueryVariable("submissionId"), function (response) {
// set text in div // set text in div
$('#documentText').text(response.text); $('#documentText').text(response.text);
// get submissions parts from database // get submissions parts from database
getAllSubmissionParts(getSubmissionIdFromUrl(), function (response) { getAllSubmissionParts(getQueryVariable("submissionId"), function (response) {
// iterate over response // iterate over response
for (let i = 0; i < response.length; i++) { for (let i = 0; i < response.length; i++) {
...@@ -67,22 +68,6 @@ $(document).ready(function () { ...@@ -67,22 +68,6 @@ $(document).ready(function () {
}); });
/**
* Get the id of a full submission from url
*
* @returns The id of the full submission
*/
function getSubmissionIdFromUrl() {
var parts = window.location.search.substr(1).split("&");
var $_GET = {};
for (var i = 0; i < parts.length; i++) {
var temp = parts[i].split("=");
$_GET[decodeURIComponent(temp[0])] = decodeURIComponent(temp[1]);
}
return $_GET['submissionId'];
}
/** /**
* Handel the category selection * Handel the category selection
* *
...@@ -141,17 +126,17 @@ function getSelectedText() { ...@@ -141,17 +126,17 @@ function getSelectedText() {
*/ */
function addHighlightedText(startCharacter, endCharacter, category, offset) { function addHighlightedText(startCharacter, endCharacter, category, offset) {
var documentText = $('#documentText').text(); let documentText = $('#documentText').text();
var documentHtml = $('#documentText').html(); let documentHtml = $('#documentText').html();
// create <span> tag with the annotated text // create <span> tag with the annotated text
var replacement = $('<span></span>').attr('class', category).html(documentText.slice(startCharacter, endCharacter)); let replacement = $('<span></span>').attr('class', category).html(documentText.slice(startCharacter, endCharacter));
// wrap an <p> tag around the replacement, get its parent (the <p>) and ask for the html // wrap an <p> tag around the replacement, get its parent (the <p>) and ask for the html
var replacementHtml = replacement.wrap('<p/>').parent().html(); let replacementHtml = replacement.wrap('<p/>').parent().html();
// insert the replacementHtml // insert the replacementHtml
var newDocument = documentHtml.slice(0, startCharacter + offset) + replacementHtml + documentHtml.slice(endCharacter + offset); let newDocument = documentHtml.slice(0, startCharacter + offset) + replacementHtml + documentHtml.slice(endCharacter + offset);
// set new document text // set new document text
$('#documentText').html(newDocument); $('#documentText').html(newDocument);
...@@ -249,6 +234,7 @@ function saveButtonHandler() { ...@@ -249,6 +234,7 @@ function saveButtonHandler() {
if (window.confirm("Möchten Sie wirklich ihre Annotationen speichern?")) { if (window.confirm("Möchten Sie wirklich ihre Annotationen speichern?")) {
// declare array of promises // declare array of promises
let promises = []; let promises = [];
let categoriesSent = [];
$('#annotations').find('.category-card').each(function () { $('#annotations').find('.category-card').each(function () {
let array = $(this).data('array'); let array = $(this).data('array');
if (array != null) { if (array != null) {
...@@ -257,7 +243,7 @@ function saveButtonHandler() { ...@@ -257,7 +243,7 @@ function saveButtonHandler() {
let category = $(this).attr('id').toUpperCase(); let category = $(this).attr('id').toUpperCase();
let submissionPartPostRequest = { let submissionPartPostRequest = {
userEmail: getUserEmail(), userEmail: getUserEmail(),
fullSubmissionId: getSubmissionIdFromUrl(), fullSubmissionId: getQueryVariable("submissionId"),
category: category, category: category,
body: [] body: []
}; };
...@@ -280,13 +266,20 @@ function saveButtonHandler() { ...@@ -280,13 +266,20 @@ function saveButtonHandler() {
promises.push(createSubmissionPart(submissionPartPostRequest, function (response) { promises.push(createSubmissionPart(submissionPartPostRequest, function (response) {
console.log("send " + response.category + "'s post request to back-end") console.log("send " + response.category + "'s post request to back-end")
})); }));
categoriesSent.push(category);
} }
}); });
$.when.apply($, promises).then(function () { $.when.apply($, promises).then(function () {
// redirect user to project page after saving let categories = ["TITEL", "RECHERCHE", "LITERATURVERZEICHNIS", "FORSCHUNGSFRAGE", "UNTERSUCHUNGSKONZEPT",
finalizeDossier(getSubmissionIdFromUrl()); "METHODIK", "DURCHFUEHRUNG", "AUSWERTUNG"];
if (categoriesSent.length === categories.length){
finalizeDossier(getQueryVariable("submissionId"));
}else{
let missingAnnotation = $('#missingAnnotation');
missingAnnotation.show();
missingAnnotation.text("Sie haben noch nicht alle Kategorien markiert");
}
}); });
// redirect user to project page after saving // redirect user to project page after saving
...@@ -299,7 +292,7 @@ function saveButtonHandler() { ...@@ -299,7 +292,7 @@ function saveButtonHandler() {
* *
*/ */
function finalizeDossier(submissionId) { function finalizeDossier(submissionId) {
let requestObj = new RequestObj(1,"/submissions","/id/?/finalize", [submissionId]) let requestObj = new RequestObj(1,"/submissions","/id/?/projects/?/finalize", [submissionId, $('#projectName').text().trim()]);
serverSide(requestObj, "POST", function (response) { serverSide(requestObj, "POST", function (response) {
location.href = "../project/tasks-student.jsp?projectName=" + getQueryVariable('projectName'); location.href = "../project/tasks-student.jsp?projectName=" + getQueryVariable('projectName');
}) })
...@@ -328,5 +321,13 @@ function handleCategoryClick(key) { ...@@ -328,5 +321,13 @@ function handleCategoryClick(key) {
handleCategorySelection(key, startCharacter, endCharacter); handleCategorySelection(key, startCharacter, endCharacter);
} }
} }
}
function buildAnnotationList(){
let categories = ["TITEL", "RECHERCHE", "LITERATURVERZEICHNIS", "FORSCHUNGSFRAGE", "UNTERSUCHUNGSKONZEPT",
"METHODIK", "DURCHFUEHRUNG", "AUSWERTUNG"];
for (let i in categories){
let tmplObject = {annotationType: categories[i].toLowerCase()};
$('#annotationTemplate').tmpl(tmplObject).appendTo('#annotations');
}
} }
...@@ -27,7 +27,7 @@ function createFullSubmission(fullSubmissionPostRequest, responseHandler) { ...@@ -27,7 +27,7 @@ function createFullSubmission(fullSubmissionPostRequest, responseHandler) {
* @param errorHandler The error handler * @param errorHandler The error handler
*/ */
function getFullSubmission(id, responseHandler, errorHandler) { function getFullSubmission(id, responseHandler, errorHandler) {
var url = "../rest/submissions/full/" + id; let url = "../rest/submissions/full/" + id;
$.ajax({ $.ajax({
url: url, url: url,
type: "GET", type: "GET",
...@@ -51,8 +51,8 @@ function getFullSubmission(id, responseHandler, errorHandler) { ...@@ -51,8 +51,8 @@ function getFullSubmission(id, responseHandler, errorHandler) {
* @returns A promise object * @returns A promise object
*/ */
function createSubmissionPart(submissionPartPostRequest, responseHandler) { function createSubmissionPart(submissionPartPostRequest, responseHandler) {
var url = "../rest/submissions/part/"; let url = "../rest/submissions/part/";
var json = JSON.stringify(submissionPartPostRequest); let json = JSON.stringify(submissionPartPostRequest);
return $.ajax({ return $.ajax({
url: url, url: url,
type: "POST", type: "POST",
...@@ -77,7 +77,7 @@ function createSubmissionPart(submissionPartPostRequest, responseHandler) { ...@@ -77,7 +77,7 @@ function createSubmissionPart(submissionPartPostRequest, responseHandler) {
* @param errorHandler The error handler * @param errorHandler The error handler
*/ */
function getSubmissionPart(id, category, responseHandler, errorHandler) { function getSubmissionPart(id, category, responseHandler, errorHandler) {
var url = "../rest/submissions/full/" + id + "/category/" + category; let url = "../rest/submissions/full/" + id + "/category/" + category;
$.ajax({ $.ajax({
url: url, url: url,
type: "GET", type: "GET",
...@@ -100,7 +100,7 @@ function getSubmissionPart(id, category, responseHandler, errorHandler) { ...@@ -100,7 +100,7 @@ function getSubmissionPart(id, category, responseHandler, errorHandler) {
* @param responseHandler The response handler * @param responseHandler The response handler
*/ */
function getAllSubmissionParts(id, responseHandler) { function getAllSubmissionParts(id, responseHandler) {
var url = "../rest/submissions/full/" + id + "/parts"; let url = "../rest/submissions/full/" + id + "/parts";
$.ajax({ $.ajax({
url: url, url: url,
type: "GET", type: "GET",
......
This diff is collapsed.
...@@ -88,8 +88,7 @@ function getQueryVariable(variable) { ...@@ -88,8 +88,7 @@ function getQueryVariable(variable) {
* @param methodPath i.e. /create/{id} in this case /create/?/another/? * @param methodPath i.e. /create/{id} in this case /create/?/another/?
* @param pathParams what is filling in for the ? * @param pathParams what is filling in for the ?
* @param queryParams i.e. &projectName=something&submissionId=anotherthing * @param queryParams i.e. &projectName=something&submissionId=anotherthing
* @param requestEntity the json obj to send in put * @param entity the json obj to send in put
* @param callback the callback to call after success
* @constructor * @constructor
*/ */
function RequestObj(hierachyLevel, modulePath, methodPath, pathParams, queryParams, entity) { function RequestObj(hierachyLevel, modulePath, methodPath, pathParams, queryParams, entity) {
...@@ -115,7 +114,7 @@ function serverSide(requestObj, method, callback) { ...@@ -115,7 +114,7 @@ function serverSide(requestObj, method, callback) {
methodPath = methodPath.replace("?", e); methodPath = methodPath.replace("?", e);
}); });
let localurl = relativPath + "gemeinsamforschen/rest" + requestObj.modulePath + methodPath ; let localurl = relativPath + "rest" + requestObj.modulePath + methodPath ;
if (requestObj.queryParams) { if (requestObj.queryParams) {
localurl = localurl + requestObj.queryParams; localurl = localurl + requestObj.queryParams;
......
...@@ -100,7 +100,7 @@ public class ActivityFlowTest { ...@@ -100,7 +100,7 @@ public class ActivityFlowTest {
// TODO @Julian: Find out more elegant way of doing this // TODO @Julian: Find out more elegant way of doing this
researchReportManagement.setFeedback(feedback); researchReportManagement.setFeedback(feedback);
phases.setFeedback(feedback); // phases.setFeedback(feedback);
} }
......
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