Skip to content

Commit

Permalink
Feature/drag and drop question (ls1intum#55)
Browse files Browse the repository at this point in the history
* Set up the creation of drag and drop questions for instructors and teaching assistants
* Implemented file upload functionality
* Updated Datamodel: save correct mappings in DragAndDropQuestion, not as correctLocation in DragItem
* Changed all occurences of "arTeMiSApp" to "artemisApp" in front-end code (was inconsistent)
* Check questions for validity (title not empty, at least one correct answer option / mapping) and show reasons why a quiz is invalid in tooltip
* Refactored markdown parsing to markdown.service.js (accessed as ArtemisMarkdown)
  • Loading branch information
VSchlattinger authored and Stephan Krusche committed Jan 18, 2018
1 parent f0bc207 commit 8810787
Show file tree
Hide file tree
Showing 199 changed files with 3,758 additions and 1,307 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,4 @@ out
/.idea/artifacts
/.idea/libraries
/.idea/workspace.xml
uploads
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"relationships": [
{
"relationshipType": "many-to-one",
"relationshipName": "item",
"relationshipName": "dragItem",
"otherEntityName": "dragItem",
"otherEntityField": "id"
},
{
"relationshipType": "many-to-one",
"relationshipName": "location",
"relationshipName": "dropLocation",
"otherEntityName": "dropLocation",
"otherEntityField": "id"
},
Expand All @@ -18,12 +18,27 @@
"relationshipName": "submittedAnswer",
"otherEntityName": "dragAndDropSubmittedAnswer",
"otherEntityField": "id"
},
{
"relationshipType": "many-to-one",
"relationshipName": "question",
"otherEntityName": "dragAndDropQuestion",
"otherEntityField": "id"
}
],
"fields": [
{
"fieldName": "dragItemIndex",
"fieldType": "Integer"
},
{
"fieldName": "dropLocationIndex",
"fieldType": "Integer"
}
],
"fields": [],
"changelogDate": "20170831094203",
"entityTableName": "drag_and_drop_assignment",
"changelogDate": "20180116141221",
"entityTableName": "drag_and_drop_mapping",
"dto": "no",
"pagination": "no",
"service": "no"
}
}
8 changes: 7 additions & 1 deletion .jhipster/DragAndDropQuestion.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
"relationshipName": "dragItems",
"otherEntityName": "dragItem",
"otherEntityRelationshipName": "question"
},
{
"relationshipType": "one-to-many",
"relationshipName": "correctMappings",
"otherEntityName": "dragAndDropMapping",
"otherEntityRelationshipName": "question"
}
],
"fields": [
Expand All @@ -25,4 +31,4 @@
"dto": "no",
"pagination": "no",
"service": "no"
}
}
6 changes: 3 additions & 3 deletions .jhipster/DragAndDropSubmittedAnswer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"relationships": [
{
"relationshipType": "one-to-many",
"relationshipName": "assignments",
"otherEntityName": "dragAndDropAssignment",
"relationshipName": "mappings",
"otherEntityName": "dragAndDropMapping",
"otherEntityRelationshipName": "submittedAnswer"
}
],
Expand All @@ -14,4 +14,4 @@
"dto": "no",
"pagination": "no",
"service": "no"
}
}
16 changes: 0 additions & 16 deletions .jhipster/DragItem.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
{
"fluentMethods": true,
"relationships": [
{
"relationshipType": "one-to-one",
"relationshipName": "correctLocation",
"otherEntityName": "dropLocation",
"otherEntityField": "id",
"ownerSide": true,
"otherEntityRelationshipName": "dragItem"
},
{
"relationshipType": "many-to-one",
"relationshipName": "question",
Expand All @@ -24,14 +16,6 @@
{
"fieldName": "text",
"fieldType": "String"
},
{
"fieldName": "correctScore",
"fieldType": "Integer"
},
{
"fieldName": "incorrectScore",
"fieldType": "Integer"
}
],
"changelogDate": "20170831094155",
Expand Down
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"angular-resizable": "https://github.com/Reklino/angular-resizable.git#bd77750c910f0cc85a774fba4f6df433a97fc53d",
"showdown": "^1.7.6",
"chart.js": "^2.7.0",
"angular-chart.js": "^1.1.1"
"angular-chart.js": "^1.1.1",
"angular-native-dragdrop": "^1.2.2"
},
"devDependencies": {
"angular-mocks": "1.5.8"
Expand Down
15 changes: 7 additions & 8 deletions exerciseapp.jh
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ entity DropLocation {
entity DragItem {
pictureFilePath String
text String
correctScore Integer
incorrectScore Integer
}

entity Participation (participation) {
Expand Down Expand Up @@ -192,8 +190,9 @@ entity DragAndDropSubmittedAnswer { //extends SubmittedAnswer

}

entity DragAndDropAssignment {

entity DragAndDropMapping {
dragItemIndex Integer
dropLocationIndex Integer
}

relationship OneToMany {
Expand All @@ -209,7 +208,8 @@ relationship OneToMany {
DragAndDropQuestion{dropLocations} to DropLocation{question},
DragAndDropQuestion{dragItems} to DragItem{question},
QuizSubmission{submittedAnswers} to SubmittedAnswer{submission},
DragAndDropSubmittedAnswer{assignments} to DragAndDropAssignment{submittedAnswer}
DragAndDropSubmittedAnswer{mappings} to DragAndDropMapping{submittedAnswer},
DragAndDropQuestion{correctMappings} to DragAndDropMapping{question}
}

relationship OneToOne {
Expand All @@ -218,7 +218,6 @@ relationship OneToOne {
AnswerCounter{answer} to AnswerOption,
DropLocationCounter{dropLocation} to DropLocation,
Result{submission} to Submission,
DragItem{correctLocation} to DropLocation,
LtiUserId{user} to User
}

Expand All @@ -227,8 +226,8 @@ relationship ManyToOne {
LtiOutcomeUrl{user} to User,
LtiOutcomeUrl{exercise} to Exercise,
SubmittedAnswer{question} to Question
DragAndDropAssignment{item} to DragItem,
DragAndDropAssignment{location} to DropLocation
DragAndDropMapping{dragItem} to DragItem,
DragAndDropMapping{dropLocation} to DropLocation
}

relationship ManyToMany {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ public JCacheManagerCustomizer cacheManagerCustomizer() {
cm.createCache(de.tum.in.www1.exerciseapp.domain.QuizSubmission.class.getName(), jcacheConfiguration);
cm.createCache(de.tum.in.www1.exerciseapp.domain.QuizSubmission.class.getName() + ".submittedAnswers", jcacheConfiguration);
cm.createCache(de.tum.in.www1.exerciseapp.domain.DragAndDropSubmittedAnswer.class.getName(), jcacheConfiguration);
cm.createCache(de.tum.in.www1.exerciseapp.domain.DragAndDropSubmittedAnswer.class.getName() + ".assignments", jcacheConfiguration);
cm.createCache(de.tum.in.www1.exerciseapp.domain.DragAndDropAssignment.class.getName(), jcacheConfiguration);
cm.createCache(de.tum.in.www1.exerciseapp.domain.Question.class.getName() + ".quizExercises", jcacheConfiguration);
cm.createCache(de.tum.in.www1.exerciseapp.domain.Result.class.getName() + ".feedbacks", jcacheConfiguration);
cm.createCache(de.tum.in.www1.exerciseapp.domain.Feedback.class.getName(), jcacheConfiguration);
Expand All @@ -96,6 +94,11 @@ public JCacheManagerCustomizer cacheManagerCustomizer() {
cm.createCache(de.tum.in.www1.exerciseapp.domain.QuizPointStatistic.class.getName() + ".pointCounters", jcacheConfiguration);
cm.createCache(de.tum.in.www1.exerciseapp.domain.MultipleChoiceQuestionStatistic.class.getName() + ".answerCounters", jcacheConfiguration);
cm.createCache(de.tum.in.www1.exerciseapp.domain.DragAndDropQuestionStatistic.class.getName() + ".dropLocationCounters", jcacheConfiguration);
cm.createCache(de.tum.in.www1.exerciseapp.domain.DragItem.class.getName() + ".mappings", jcacheConfiguration);
cm.createCache(de.tum.in.www1.exerciseapp.domain.DropLocation.class.getName() + ".mappings", jcacheConfiguration);
cm.createCache(de.tum.in.www1.exerciseapp.domain.DragAndDropQuestion.class.getName() + ".correctMappings", jcacheConfiguration);
cm.createCache(de.tum.in.www1.exerciseapp.domain.DragAndDropSubmittedAnswer.class.getName() + ".mappings", jcacheConfiguration);
cm.createCache(de.tum.in.www1.exerciseapp.domain.DragAndDropMapping.class.getName(), jcacheConfiguration);
// jhipster-needle-ehcache-add-entry
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ public final class Constants {
public static final int QUIZ_AUTOMATIC_SUBMISSION_DELAY_IN_SECONDS = 3;
public static final int QUIZ_GRACE_PERIOD_IN_SECONDS = 2;

public static final String TEMP_FILEPATH = "uploads/images/temp/";
public static final String DRAG_AND_DROP_BACKGROUND_FILEPATH = "uploads/images/drag-and-drop/backgrounds/";
public static final String DRAG_ITEM_FILEPATH = "uploads/images/drag-and-drop/drag-items/";
public static final String FILEPATH_ID_PLACHEOLDER = "PLACEHOLDER_FOR_ID";

private Constants() {
}
}

This file was deleted.

Loading

0 comments on commit 8810787

Please sign in to comment.