diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 94a25f7..f2248a5 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,5 +2,6 @@ + \ No newline at end of file diff --git a/src/main/java/edu/ithaca/dragon/tecmap/conceptgraph/CohortConceptGraphs.java b/src/main/java/edu/ithaca/dragon/tecmap/conceptgraph/CohortConceptGraphs.java index 32c485c..0d223e4 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/conceptgraph/CohortConceptGraphs.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/conceptgraph/CohortConceptGraphs.java @@ -48,8 +48,8 @@ public CohortConceptGraphs(ConceptGraph structureGraph, List summaries){ - this(structureGraph,summaries); + public CohortConceptGraphs(String filename, ConceptGraph structureGraph, List responses){ + this(structureGraph,responses); //TODO: call CohortConceptGraphsRecord } diff --git a/src/main/java/edu/ithaca/dragon/tecmap/conceptgraph/ConceptGraph.java b/src/main/java/edu/ithaca/dragon/tecmap/conceptgraph/ConceptGraph.java index e5067ce..ac71546 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/conceptgraph/ConceptGraph.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/conceptgraph/ConceptGraph.java @@ -6,7 +6,7 @@ import edu.ithaca.dragon.tecmap.io.record.LinkRecord; import edu.ithaca.dragon.tecmap.learningresource.AssessmentItem; import edu.ithaca.dragon.tecmap.learningresource.AssessmentItemResponse; -import edu.ithaca.dragon.tecmap.learningresource.LearningResource; +import edu.ithaca.dragon.tecmap.learningresource.LearningMaterial; import edu.ithaca.dragon.tecmap.learningresource.LearningResourceType; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -24,7 +24,7 @@ public class ConceptGraph { // but also can be quickly looked up here (also allows checks for duplicates). private Map nodeMap; private Map assessmentItemMap; - private Map learningMaterialMap; + private Map learningMaterialMap; public ConceptGraph(ConceptGraphRecord structureDef){ @@ -34,14 +34,14 @@ public ConceptGraph(ConceptGraphRecord structureDef){ this.learningMaterialMap = new HashMap<>(); } - public ConceptGraph(ConceptGraphRecord structureDef, List lolRecords){ + public ConceptGraph(ConceptGraphRecord structureDef, List learningResourceRecords){ this(structureDef); - addLearningResourcesFromRecords(lolRecords); + addLearningResourcesFromRecords(learningResourceRecords); } - public ConceptGraph(ConceptGraphRecord structureDef, List lolRecords, List AssessmentItemResponses){ - this(structureDef, lolRecords); - addAssessmentItemResponses(AssessmentItemResponses); + public ConceptGraph(ConceptGraphRecord structureDef, List learningResourceRecords, List assessmentItemResponses){ + this(structureDef, learningResourceRecords); + addAssessmentItemResponses(assessmentItemResponses); } /** @@ -62,14 +62,14 @@ public ConceptGraph(ConceptGraph other, String newName){ * e.g., when you are making a tree copy * @param other a graph to copy * @param newName the new name of the graph - * @param loMap a map of learning objects, which can be in any state of populated/not populated. This function will + * @param aiMap a map of learning objects, which can be in any state of populated/not populated. This function will * connect the existing learning obejcts, or add any new ones necessary */ - public ConceptGraph(ConceptGraph other, String newName, HashMap loMap, HashMap lmMap){ + public ConceptGraph(ConceptGraph other, String newName, HashMap aiMap, HashMap lmMap){ this.name = newName; this.roots = new ArrayList<>(); nodeMap = new HashMap<>(); - assessmentItemMap = loMap; + assessmentItemMap = aiMap; learningMaterialMap = lmMap; //recursively copy entire graph @@ -85,7 +85,7 @@ public ConceptGraph(ConceptGraph other, String newName, HashMap rootsIn, String name, Map AssessmentItemMap, Map learningMaterialMap, Map nodeMap){ + public ConceptGraph(List rootsIn, String name, Map AssessmentItemMap, Map learningMaterialMap, Map nodeMap){ this.name = name; this.assessmentItemMap = AssessmentItemMap; this.learningMaterialMap = learningMaterialMap; @@ -159,7 +159,7 @@ public void addLearningResourcesFromRecords(List learnin if (record.isType(LearningResourceType.INFORMATION) || record.isType(LearningResourceType.PRACTICE)){ //since we've already added possibly an assessment for this record, remove it (if it were there) so the list can be used to create the material directly from the list record.getResourceTypes().remove(LearningResourceType.ASSESSMENT); - linkLearningMaterials(new LearningResource(record), record.getConceptIds()); + linkLearningMaterials(new LearningMaterial(record), record.getConceptIds()); } } } @@ -174,11 +174,11 @@ public void addLearningResourcesFromRecords(List learnin */ public int linkAssessmentItem (AssessmentItem toLink, Collection conceptIds){ int numAdded = 0; - if (assessmentItemMap.get(toLink.getId()) != null){ - logger.warn(toLink.getId()+" already exists in this graph. Nothing was added."); + if (assessmentItemMap.get(toLink.getText()) != null){ + logger.warn(toLink.getText()+" already exists in this graph. Nothing was added."); return -1; } - assessmentItemMap.put(toLink.getId(), toLink); + assessmentItemMap.put(toLink.getText(), toLink); for (String id: conceptIds){ if(nodeMap.get(id) != null){ numAdded++; @@ -199,13 +199,13 @@ public int linkAssessmentItem (AssessmentItem toLink, Collection concept * @post the LearningMaterial is added to the graph's map, and to all associated Concept's AssessmentItem maps * @return the number of concepts the LearningMaterial was added to, or -1 if the LearningMaterial already exists */ - public int linkLearningMaterials(LearningResource toLink, Collection conceptIds){ + public int linkLearningMaterials(LearningMaterial toLink, Collection conceptIds){ int numAdded = 0; - if (learningMaterialMap.get(toLink.getId()) != null){ - logger.warn(toLink.getId()+" already exists in this graph. Nothing was added."); + if (learningMaterialMap.get(toLink.getText()) != null){ + logger.warn(toLink.getText()+" already exists in this graph. Nothing was added."); return -1; } - learningMaterialMap.put(toLink.getId(), toLink); + learningMaterialMap.put(toLink.getText(), toLink); for (String id: conceptIds){ if(nodeMap.get(id) != null){ numAdded++; @@ -226,13 +226,14 @@ public int linkLearningMaterials(LearningResource toLink, Collection con */ public void addAssessmentItemResponses(List assessmentItemResponses) { for (AssessmentItemResponse response : assessmentItemResponses){ - AssessmentItem assessmentItem = assessmentItemMap.get(response.getLearningObjectId()); + AssessmentItem assessmentItem = assessmentItemMap.get(response.getAssessmentItemText()); if (assessmentItem != null){ assessmentItem.addResponse(response); } else { - logger.warn("No AssessmentItem:" + response.getLearningObjectId() + " for response: " + response.toString()); + logger.warn("No AssessmentItem: " + response.getAssessmentItemText() + " for response: " + response.toString()); //TODO: maybe make a new list of unconnected learning objects??? + Thread.dumpStack(); } } } @@ -244,11 +245,11 @@ public void addAssessmentItemResponses(List assessmentIt public Map buildDirectConceptLinkCount(){ Map directConceptLinkCountMap = new HashMap<>(); for (ConceptNode node: nodeMap.values()){ - for (LearningResource learningMaterial : node.getLearningMaterialMap().values()){ - if(directConceptLinkCountMap.containsKey(learningMaterial.getId())){ - directConceptLinkCountMap.put(learningMaterial.getId(),directConceptLinkCountMap.get(learningMaterial.getId())+1); + for (LearningMaterial learningMaterial : node.getLearningMaterialMap().values()){ + if(directConceptLinkCountMap.containsKey(learningMaterial.getText())){ + directConceptLinkCountMap.put(learningMaterial.getText(),directConceptLinkCountMap.get(learningMaterial.getText())+1); }else{ - directConceptLinkCountMap.put(learningMaterial.getId(), 1); + directConceptLinkCountMap.put(learningMaterial.getText(), 1); } } } @@ -260,12 +261,11 @@ public Map buildDirectConceptLinkCount(){ * @return a map from id -> pathCount to the given conceptNode */ public Map buildLearningResourcePathCount(String node) { - ConceptNode findNode = findNodeById(node); if (findNode != null) { - Map idToPathCount = new HashMap<>(); - findNode.buildLearningMaterialPathCount(idToPathCount); - return idToPathCount; + Map textToPathCount = new HashMap<>(); + findNode.buildLearningMaterialPathCount(textToPathCount); + return textToPathCount; }else{ logger.warn("buildLearningMaterialPathCount:" + node + " is not found in the graph"); return null; @@ -316,8 +316,8 @@ public double calcTotalKnowledgeEstimate(String startingNodeId){ public int responsesCount(){ int total = 0; - for (AssessmentItem lo : assessmentItemMap.values()){ - total += lo.getResponses().size(); + for (AssessmentItem assessmentItem : assessmentItemMap.values()){ + total += assessmentItem.getResponses().size(); } return total; } @@ -358,7 +358,7 @@ public void calcDataImportance(){ * @return */ public List getAssessmentsBelowAssessmentID(String assessmentId) { - List nodesWithAssessmentId = getNodesWithAssessmentId(assessmentId); + List nodesWithAssessmentId = getNodesWithAssessmentText(assessmentId); List assessmentNodesPathLengths = new ArrayList<>(); for (ConceptNode node : nodesWithAssessmentId) { @@ -373,24 +373,24 @@ public List getAssessmentsBelowAssessmentID(String assessmentId) { } /** - * Gets list of assessmentItems that are x steps below the highest occurrence of the given assessmentId for each root - * @param assessmentId + * Gets list of assessmentItems that are x steps below the highest occurrence of the given assessmentText for each root + * @param assessmentText * @param stepsDown number of steps to take * @return List of assessments x steps down, null if there are negative stepsDown */ - public List getAssessmentsBelowAssessmentID(String assessmentId, int stepsDown) { + public List getAssessmentsBelowAssessmentID(String assessmentText, int stepsDown) { if (stepsDown < 0) { return null; } - List nodesWithAssessmentId = getNodesWithAssessmentId(assessmentId); + List nodesWithAssessmentText = getNodesWithAssessmentText(assessmentText); - //Dictates that an assessmentId will only be included once + //Dictates that an assessmentText will only be included once Set assessmentsBelow = new HashSet<>(); - for (ConceptNode node : nodesWithAssessmentId) { + for (ConceptNode node : nodesWithAssessmentText) { getAssessmentsBelowNode(assessmentsBelow, node, stepsDown); for (AssessmentItem item : node.getAssessmentItemMap().values()) { - if (!assessmentsBelow.contains(item.getId()) && !item.getId().equals(assessmentId)) { - assessmentsBelow.add(item.getId()); + if (!assessmentsBelow.contains(item.getText()) && !item.getText().equals(assessmentText)) { + assessmentsBelow.add(item.getText()); } } } @@ -399,21 +399,21 @@ public List getAssessmentsBelowAssessmentID(String assessmentId, int ste } /** - * Finds the nodes from the graph with the given assessmentId in its list of assessments - * @param assessmentId + * Finds the nodes from the graph with the given assessmentText in its list of assessments + * @param assessmentText * @return */ - public List getNodesWithAssessmentId(String assessmentId) { - List nodesWithAssessmentId = new ArrayList<>(); - //Find the nodes with the given AssessmentId + public List getNodesWithAssessmentText(String assessmentText) { + List nodesWithAssessmentText = new ArrayList<>(); + //Find the nodes with the given AssessmentText for (ConceptNode node : nodeMap.values()) { for (AssessmentItem item : node.getAssessmentItemMap().values()) { - if (item.getId().equals(assessmentId)) { - nodesWithAssessmentId.add(node); + if (item.getText().equals(assessmentText)) { + nodesWithAssessmentText.add(node); } } } - return nodesWithAssessmentId; + return nodesWithAssessmentText; } /** @@ -430,7 +430,7 @@ public Set getAssessmentsBelowNode(Set assessmentList, ConceptNo } else { for (ConceptNode child : startNode.getChildren()) { for (AssessmentItem item : child.getAssessmentItemMap().values()) { - assessmentList.add(item.getId()); + assessmentList.add(item.getText()); } assessmentList = getAssessmentsBelowNode(assessmentList, child, stepsToTake-1); } @@ -452,7 +452,7 @@ public Map getAssessmentItemMap() { return assessmentItemMap; } - public Map getLearningMaterialMap() { + public Map getLearningMaterialMap() { return learningMaterialMap; } diff --git a/src/main/java/edu/ithaca/dragon/tecmap/conceptgraph/ConceptNode.java b/src/main/java/edu/ithaca/dragon/tecmap/conceptgraph/ConceptNode.java index 12f7784..680c897 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/conceptgraph/ConceptNode.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/conceptgraph/ConceptNode.java @@ -4,7 +4,7 @@ import edu.ithaca.dragon.tecmap.io.record.ConceptRecord; import edu.ithaca.dragon.tecmap.io.record.LinkRecord; import edu.ithaca.dragon.tecmap.learningresource.AssessmentItem; -import edu.ithaca.dragon.tecmap.learningresource.LearningResource; +import edu.ithaca.dragon.tecmap.learningresource.LearningMaterial; import java.util.*; @@ -17,8 +17,8 @@ public class ConceptNode { private double knowledgeDistanceFromAvg; private double dataImportance; - private Map learningObjectMap; //These same LearningObjects might also be held by other nodes - private Map learningMaterialMap; //These same LearningObjects might also be held by other nodes + private Map assessmentItemMap; //These same LearningObjects might also be held by other nodes + private Map learningMaterialMap; //These same LearningObjects might also be held by other nodes List children; @@ -39,7 +39,7 @@ public ConceptNode(ConceptRecord conceptRecord) { this.dataImportance = conceptRecord.getDataImportance(); this.children = new ArrayList<>(); - this.learningObjectMap = new HashMap<>(); + this.assessmentItemMap = new HashMap<>(); this.learningMaterialMap = new HashMap<>(); } @@ -53,7 +53,7 @@ public ConceptNode(ConceptRecord conceptRecord) { * @param graphLearningMaterialMap the current learningMaterialMap for the graph that this node will be a part of * @post all contents of this new node are set to new copies of the data from , and all children are also copied */ - public ConceptNode(ConceptNode nodeToCopy, Map graphNodeMap, Map graphLearningObjectMap, Map graphLearningMaterialMap){ + public ConceptNode(ConceptNode nodeToCopy, Map graphNodeMap, Map graphLearningObjectMap, Map graphLearningMaterialMap){ copyContents(nodeToCopy, graphLearningObjectMap, graphLearningMaterialMap); //recursively copy children @@ -81,7 +81,7 @@ public ConceptNode(ConceptNode nodeToCopy, Map graphNodeMap * @param graphLearningMaterialMap the current learningMaterialMap for the graph that this node will be a part of * @post all contents of this new node are set to new copies of the data from nodeToCopy */ - public ConceptNode(String newId, ConceptNode nodeToCopy, Map graphLearningObjectMap, Map graphLearningMaterialMap){ + public ConceptNode(String newId, ConceptNode nodeToCopy, Map graphLearningObjectMap, Map graphLearningMaterialMap){ copyContents(nodeToCopy, graphLearningObjectMap, graphLearningMaterialMap); this.id = newId; } @@ -89,13 +89,13 @@ public ConceptNode(String newId, ConceptNode nodeToCopy, Map graphLearningObjectMap, Map graphLearningMaterialMap){ + private void copyContents(ConceptNode nodeToCopy, Map assessmentItemMap, Map learningMaterialMap){ this.id = nodeToCopy.id; this.label = nodeToCopy.label; this.knowledgeEstimate = nodeToCopy.knowledgeEstimate; @@ -103,27 +103,27 @@ private void copyContents(ConceptNode nodeToCopy, Map gr this.dataImportance = nodeToCopy.dataImportance; //Complicated because it is a graph, so it should only copy LearningObjects if they haven't already been created - this.learningObjectMap = new HashMap<>(); - for (Map.Entry entry: nodeToCopy.learningObjectMap.entrySet()){ + this.assessmentItemMap = new HashMap<>(); + for (Map.Entry entry: nodeToCopy.assessmentItemMap.entrySet()){ //check the map first to see if that learningObject has already been created - AssessmentItem newColumnItem = graphLearningObjectMap.get(entry.getKey()); + AssessmentItem newColumnItem = assessmentItemMap.get(entry.getKey()); if (newColumnItem == null) { newColumnItem = new AssessmentItem(entry.getValue()); - graphLearningObjectMap.put(entry.getKey(), newColumnItem); + assessmentItemMap.put(entry.getKey(), newColumnItem); } - this.learningObjectMap.put(entry.getKey(), newColumnItem); + this.assessmentItemMap.put(entry.getKey(), newColumnItem); } this.learningMaterialMap = new HashMap<>(); - for (Map.Entry entry: nodeToCopy.learningMaterialMap.entrySet()){ + for (Map.Entry entry: nodeToCopy.learningMaterialMap.entrySet()){ //check the map first to see if that learningMaterial has already been created - LearningResource newLearningObject = graphLearningMaterialMap.get(entry.getKey()); - if (newLearningObject == null) { - newLearningObject = new LearningResource(entry.getValue()); - graphLearningMaterialMap.put(entry.getKey(), newLearningObject); + LearningMaterial newLearningMaterial = learningMaterialMap.get(entry.getKey()); + if (newLearningMaterial == null) { + newLearningMaterial = new LearningMaterial(entry.getValue()); + learningMaterialMap.put(entry.getKey(), newLearningMaterial); } - this.learningMaterialMap.put(entry.getKey(), newLearningObject); + this.learningMaterialMap.put(entry.getKey(), newLearningMaterial); } this.children = new ArrayList<>(); } @@ -155,20 +155,20 @@ public double totalKnowledgeEstimateForThisAndAllDescendants(List nodesA /** * for each LearningMaterial, calculates the number of paths to that learning material from the given node - * @param idToPathCount a map of id -> countOfPaths to be added to recursively (empty when recursion starts) + * @param textToPathCount a map of text -> countOfPaths to be added to recursively (empty when recursion starts) * @post the map with this node and all children with updated counts */ - public void buildLearningMaterialPathCount(Map idToPathCount){ - for (LearningResource material : this.learningMaterialMap.values()) { - if (idToPathCount.containsKey(material.getId())){ - idToPathCount.put(material.getId() ,idToPathCount.get(material.getId())+1); + public void buildLearningMaterialPathCount(Map textToPathCount){ + for (LearningMaterial material : this.learningMaterialMap.values()) { + if (textToPathCount.containsKey(material.getText())){ + textToPathCount.put(material.getText(), textToPathCount.get(material.getText()) + 1); }else{ - idToPathCount.put(material.getId(), 1); + textToPathCount.put(material.getText(), 1); } } //go to each of the children and call on child so that the child node's learning objects will be added. for(ConceptNode child: children){ - child.buildLearningMaterialPathCount(idToPathCount); + child.buildLearningMaterialPathCount(textToPathCount); } } @@ -196,7 +196,7 @@ public boolean isAncestorOf(ConceptNode possibleDescendant){ */ public void calcDataImportance(){ double tempDI=0; - for(AssessmentItem columnItem : learningObjectMap.values()){ + for(AssessmentItem columnItem : assessmentItemMap.values()){ tempDI+= columnItem.getDataImportance(); } @@ -214,7 +214,7 @@ public void calcDataImportance(){ public void calcKnowledgeEstimate() { //calculate estimate from learning objects directly connected to this node double currentConceptEstimate = 0; - for (AssessmentItem columnItem : learningObjectMap.values()){ + for (AssessmentItem columnItem : assessmentItemMap.values()){ currentConceptEstimate += columnItem.calcKnowledgeEstimate()* columnItem.getDataImportance(); } @@ -271,11 +271,11 @@ public int getLongestPathToLeaf() { ////////////////// Simple Methods ////////////////////// public void addAssessmentItem(AssessmentItem columnItem) { - learningObjectMap.put(columnItem.getId(), columnItem); + assessmentItemMap.put(columnItem.getText(), columnItem); } - public void addLearningMaterial(LearningResource learningObject) { - learningMaterialMap.put(learningObject.getId(), learningObject); + public void addLearningMaterial(LearningMaterial learningMaterial) { + learningMaterialMap.put(learningMaterial.getText(), learningMaterial); } public void addChild(ConceptNode child){ @@ -313,10 +313,10 @@ public double getKnowledgeDistanceFromAvg(){ public double getDataImportance() { return dataImportance; } public Map getAssessmentItemMap() { - return learningObjectMap; + return assessmentItemMap; } - public Map getLearningMaterialMap() { + public Map getLearningMaterialMap() { return learningMaterialMap; } diff --git a/src/main/java/edu/ithaca/dragon/tecmap/conceptgraph/TreeConverter.java b/src/main/java/edu/ithaca/dragon/tecmap/conceptgraph/TreeConverter.java index 5d32a97..766fe81 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/conceptgraph/TreeConverter.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/conceptgraph/TreeConverter.java @@ -1,7 +1,7 @@ package edu.ithaca.dragon.tecmap.conceptgraph; import edu.ithaca.dragon.tecmap.learningresource.AssessmentItem; -import edu.ithaca.dragon.tecmap.learningresource.LearningResource; +import edu.ithaca.dragon.tecmap.learningresource.LearningMaterial; import java.util.ArrayList; import java.util.HashMap; @@ -17,7 +17,7 @@ public class TreeConverter { public static ConceptGraph makeTreeCopy(ConceptGraph graphToCopy){ Map resourceMap = AssessmentItem.deepCopyLearningObjectMap(graphToCopy.getAssessmentItemMap()); - Map materialMap = LearningResource.deepCopyLearningResourceMap(graphToCopy.getLearningMaterialMap()); + Map materialMap = LearningMaterial.deepCopyLearningMaterialMap(graphToCopy.getLearningMaterialMap()); Map nodeMap = new HashMap<>(); @@ -30,7 +30,7 @@ public static ConceptGraph makeTreeCopy(ConceptGraph graphToCopy){ } - public static ConceptNode makeTreeNodeCopy(ConceptNode nodeToMakeTreeCopyOf, HashMap> labelToListOfIds, MapnodeMap, Map resourceMap, Map materialMap){ + public static ConceptNode makeTreeNodeCopy(ConceptNode nodeToMakeTreeCopyOf, HashMap> labelToListOfIds, MapnodeMap, Map resourceMap, Map materialMap){ ConceptNode nodeCopy; List idsList = labelToListOfIds.get(nodeToMakeTreeCopyOf.getLabel()); //if there are no copies, make a new list to store all the copies and add it to the map diff --git a/src/main/java/edu/ithaca/dragon/tecmap/data/TecmapFileDatastore.java b/src/main/java/edu/ithaca/dragon/tecmap/data/TecmapFileDatastore.java index c86bc5e..360508e 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/data/TecmapFileDatastore.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/data/TecmapFileDatastore.java @@ -1,5 +1,6 @@ package edu.ithaca.dragon.tecmap.data; +import com.opencsv.exceptions.CsvException; import edu.ithaca.dragon.tecmap.Settings; import edu.ithaca.dragon.tecmap.Tecmap; import edu.ithaca.dragon.tecmap.TecmapAPI; @@ -86,8 +87,8 @@ public TecmapAPI retrieveTecmapForId(String idToRetrieve, TecmapState desiredSta if (desiredState == TecmapState.AssessmentLinked) { return new Tecmap(new ConceptGraph(ConceptGraphRecord.buildFromJson(files.getGraphFile())), LearningResourceRecord.createLearningResourceRecordsFromJsonFiles(files.getResourceFiles()), - //TODO: hardcoded to sakai csv, need to hold a list of CSVReaders, or the information about which kind of reader it is... - ReaderTools.assessmentItemsFromCSVList(2, files.getAssessmentFiles()), + //TODO: hardcoded to canvas csv, need to hold a list of CSVReaders, or the information about which kind of reader it is... + ReaderTools.assessmentItemsFromCSVList(files.getAssessmentFiles()), AssessmentItemResponse.createAssessmentItemResponses(files.getAssessmentFiles()) ); } @@ -95,8 +96,8 @@ else if (desiredState == TecmapState.AssessmentNoLinks) { return new Tecmap(new ConceptGraph(ConceptGraphRecord.buildFromJson(files.getGraphFile())), null, - //TODO: hardcoded to sakai csv, need to hold a list of CSVReaders, or the information about which kind of reader it is... - ReaderTools.assessmentItemsFromCSVList(2, files.getAssessmentFiles()), + //TODO: hardcoded to canvas csv, need to hold a list of CSVReaders, or the information about which kind of reader it is... + ReaderTools.assessmentItemsFromCSVList(files.getAssessmentFiles()), AssessmentItemResponse.createAssessmentItemResponses(files.getAssessmentFiles()) ); } @@ -114,7 +115,7 @@ else if (desiredState == TecmapState.OnlyGraphStructureState) { throw new RuntimeException("Unrecognized state desired, can't retrieve tecmap"); } } - catch (IOException e){ + catch (IOException | CsvException e){ logger.warn("IOException when trying to create map for id: "+ idToRetrieve +"\tError:", e); return null; } diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/Json.java b/src/main/java/edu/ithaca/dragon/tecmap/io/Json.java index 6a4ee63..f9c81e1 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/io/Json.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/Json.java @@ -13,7 +13,7 @@ public class Json { public static String toJsonString(Object objectToSerialize) throws JsonProcessingException { ObjectMapper mapper = new ObjectMapper(); mapper.enable(SerializationFeature.INDENT_OUTPUT); - return mapper.writeValueAsString( objectToSerialize); + return mapper.writeValueAsString(objectToSerialize); } public static void toJsonFile(String filename, Object objectToSerialize) throws IOException { diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/Anonymizer.java b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/Anonymizer.java index 6deb3ff..f5af19b 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/Anonymizer.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/Anonymizer.java @@ -10,13 +10,33 @@ public class Anonymizer implements CsvProcessor{ private int numToUseNext; private Map realId2anonId; private Map realname2anonName; - private int gradeStartColumnIndex; // canvas 3, sakai 2 + private final int nameStartRowIndex; + private final int nameColumnIndex; + private final int idColumnIndex; - public Anonymizer(int gradeStartColumnIndex){ - numToUseNext =1; + // Default values + private static final int DEFAULT_NAME_COLUMN_INDEX = 0; // canvas format + private static final int DEFAULT_ID_COLUMN_INDEX = 1; // canvas format + + public Anonymizer(int nameStartRowIndex, int nameColumnIndex, int idColumnIndex){ + numToUseNext = 1; realId2anonId = new HashMap<>(); realname2anonName = new HashMap<>(); - this.gradeStartColumnIndex = gradeStartColumnIndex; + this.nameStartRowIndex = nameStartRowIndex; + this.nameColumnIndex = nameColumnIndex; + this.idColumnIndex = idColumnIndex; + } + + public Anonymizer(int nameStartRowIndex) { + this(nameStartRowIndex, DEFAULT_NAME_COLUMN_INDEX, DEFAULT_ID_COLUMN_INDEX); + } + + public static Anonymizer AnonymizerCreator(String filepathAndName, int nameStartRowIndex, int nameColumnIndex, int idColumnIndex) { + try { + return Json.fromJsonFile(filepathAndName, Anonymizer.class); + } catch (IOException e) { + return new Anonymizer(nameStartRowIndex, nameColumnIndex, idColumnIndex); + } } public static Anonymizer AnonymizerCreator(String filepathAndName, int gradeStartIndex) { @@ -28,11 +48,11 @@ public static Anonymizer AnonymizerCreator(String filepathAndName, int gradeStar } public void anonymize(List rows) { - Collections.shuffle(rows.subList(gradeStartColumnIndex, rows.size())); - for(String[] row : rows.subList(gradeStartColumnIndex, rows.size())){ - if (row.length >1) { // canvas id column is 1 - row[0] = getAnonStr(row[0], realname2anonName, "student", numToUseNext); - row[1] = getAnonStr(row[1], realId2anonId, "s", numToUseNext); + Collections.shuffle(rows.subList(nameStartRowIndex, rows.size())); + for(String[] row : rows.subList(nameStartRowIndex, rows.size())){ + if (row.length > 1) { + row[nameColumnIndex] = getAnonStr(row[0], realname2anonName, "student", numToUseNext); + row[idColumnIndex] = getAnonStr(row[1], realId2anonId, "s", numToUseNext); numToUseNext++; } } @@ -68,7 +88,7 @@ public void writeToFile(String filepath) throws IOException { Json.toJsonFile(filepath+this.getClass().getSimpleName()+".json", this); } - public int getGradeStartColumnIndex() { return gradeStartColumnIndex; } + public int getNameStartRowIndex() { return nameStartRowIndex; } public int getNumToUseNext() { return numToUseNext; diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CanvasConverter.java b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CanvasConverter.java new file mode 100644 index 0000000..f6d9bbc --- /dev/null +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CanvasConverter.java @@ -0,0 +1,32 @@ +package edu.ithaca.dragon.tecmap.io.reader; + +import java.io.IOException; +import java.util.List; + +public class CanvasConverter implements CsvProcessor { + + public static void canvasConverter(List rows) { + CreateMaxScoreRow.createMaxScoreRow(rows); + SwapNameAndIDColumn.swapNameAndIDColumn(rows); + MoveGradeStartColumnIndex.moveGradeStartColumnIndex(rows); + } + @Override + public boolean shouldProcessFile(String filename) { + return true; + } + + @Override + public void processRows(List rows) { + canvasConverter(rows); + } + + @Override + public String createProcessedFilename(String origFilename) { + return ""; + } + + @Override + public void writeToFile(String filepath) throws IOException { + + } +} diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CanvasReader.java b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CanvasReader.java index c7167d1..1375227 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CanvasReader.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CanvasReader.java @@ -3,9 +3,11 @@ import java.io.IOException; import java.util.List; + public class CanvasReader extends TecmapCSVReader { - public CanvasReader(String filename)throws IOException { - super(filename, 4, 3); + + public CanvasReader(List rows, List processors) throws IOException { + super(rows, processors); } /** @@ -14,8 +16,8 @@ public CanvasReader(String filename)throws IOException { * @return the ID of the student */ @Override - public String getIDForAStudent(List dataLine) { - return dataLine.get(1); + public String getIDForAStudent(String[] dataLine) { + return dataLine[1]; } /** @@ -24,7 +26,7 @@ public String getIDForAStudent(List dataLine) { * @return the name of the student */ @Override - public String getNameForAStudent(List dataLine) { - return dataLine.get(0); + public String getNameForAStudent(String[] dataLine) { + return dataLine[0]; } } diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/ConvertToSakaiLabel.java b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/ConvertToSakaiLabel.java deleted file mode 100644 index e773419..0000000 --- a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/ConvertToSakaiLabel.java +++ /dev/null @@ -1,34 +0,0 @@ -package edu.ithaca.dragon.tecmap.io.reader; - -import java.io.IOException; -import java.util.List; - -public class ConvertToSakaiLabel implements CsvProcessor { - - public static void addPointTotalsToQuestionLabels(String[] questionLabelsRow, String[] pointTotalsRow, int gradeStartColumnIndex){ - for(int colIdx=gradeStartColumnIndex; colIdx rows) { - } - - @Override - public String createProcessedFilename(String origFilename) { - return ""; - } - - @Override - public void writeToFile(String filepath) throws IOException { - - } -} diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CreateMaxScoreRow.java b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CreateMaxScoreRow.java new file mode 100644 index 0000000..2f38dd1 --- /dev/null +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CreateMaxScoreRow.java @@ -0,0 +1,55 @@ +package edu.ithaca.dragon.tecmap.io.reader; + +import java.io.IOException; +import java.util.List; + +public class CreateMaxScoreRow implements CsvProcessor { + // build a new row of point possible (canvas format) + public static void createMaxScoreRow(List rows) { + String[] newRow = new String[rows.get(0).length]; + newRow[0] = "Points Possible"; + for (int i = 0; i < rows.get(0).length; i++) { + String question = rows.get(0)[i]; + int begin = question.lastIndexOf('['); + int end = question.lastIndexOf(']'); + // Check if square brackets are not found, then look for parentheses + if (begin < 0 || end < 0) { + begin = question.lastIndexOf('('); + end = question.lastIndexOf(')'); + } + // If either pair is found, extract the max score and update the question + if (begin >= 0 && end >= 0) { + String maxScoreStr = question.substring(begin + 1, end); + rows.get(0)[i] = question.substring(0, begin - 1).trim(); // begin - 1 to make sure no space followed + newRow[i] = maxScoreStr; + } + } + // Fill the empty spots "" + for (int i = 1; i < newRow.length; i++) { + if (newRow[i] == null || newRow[i].isEmpty()) { + newRow[i] = ""; + } + } + rows.add(2, newRow); + } + + @Override + public boolean shouldProcessFile(String filename) { + return true; + } + + @Override + public void processRows(List rows) { + createMaxScoreRow(rows); + } + + @Override + public String createProcessedFilename(String origFilename) { + return ""; + } + + @Override + public void writeToFile(String filepath) throws IOException { + + } +} diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CsvRepresentation.java b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CsvFileLibrary.java similarity index 97% rename from src/main/java/edu/ithaca/dragon/tecmap/io/reader/CsvRepresentation.java rename to src/main/java/edu/ithaca/dragon/tecmap/io/reader/CsvFileLibrary.java index 0c84bfa..d6a8d0a 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CsvRepresentation.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CsvFileLibrary.java @@ -8,7 +8,7 @@ import java.util.ArrayList; import java.util.List; -public class CsvRepresentation { +public class CsvFileLibrary { public static List parseRowsFromFile(String filename) throws IOException, CsvException { List list = new ArrayList<>(); diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CsvProcessingMain.java b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CsvProcessingMain.java index dac1019..9da2337 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CsvProcessingMain.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CsvProcessingMain.java @@ -8,7 +8,7 @@ public class CsvProcessingMain { public static void main(String[] args){ List processors = new ArrayList<>(); //processors.add(new PointsOffConverter()); - processors.add(Anonymizer.AnonymizerCreator("src/main/resources/anonHere/anonymizer.json", 2)); + processors.add(Anonymizer.AnonymizerCreator("src/main/resources/anonHere/anonymizer.json", 2, 1, 0)); for (CsvProcessor processor : processors){ try { diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CsvProcessor.java b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CsvProcessor.java index cd51c45..e776cc4 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CsvProcessor.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/CsvProcessor.java @@ -18,9 +18,9 @@ public interface CsvProcessor { static void processFilesInDirectory(CsvProcessor processor, String directoryToProcess) throws IOException, CsvException { for (String filename : allCsvFilesInDirectory(directoryToProcess)) { if (processor.shouldProcessFile(filename)) { - List rows = CsvRepresentation.parseRowsFromFile(directoryToProcess+filename); + List rows = CsvFileLibrary.parseRowsFromFile(directoryToProcess+filename); processor.processRows(rows); - CsvRepresentation.writeRowsToFile(rows, directoryToProcess+processor.createProcessedFilename(filename)); + CsvFileLibrary.writeRowsToFile(rows, directoryToProcess+processor.createProcessedFilename(filename)); } } } diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/MoveGradeStartColumnIndex.java b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/MoveGradeStartColumnIndex.java new file mode 100644 index 0000000..95f89f0 --- /dev/null +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/MoveGradeStartColumnIndex.java @@ -0,0 +1,46 @@ +package edu.ithaca.dragon.tecmap.io.reader; + +import java.io.IOException; +import java.util.List; + +public class MoveGradeStartColumnIndex implements CsvProcessor { + + public static void moveGradeStartColumnIndex(List rows) { + for (int i = 0; i < rows.size(); i++) { + String[] row = rows.get(i); + String[] newRow = new String[row.length + 2]; + if (row.length > 1) { + // copy elements before index 2 + System.arraycopy(row, 0, newRow, 0, 2); + // insert empty string at position of 2 and 3 + for (int j = 2; j < 4; j++) { + newRow[j] = ""; + } + // copy elements after GradeStartColumnIndex 2 + System.arraycopy(row, 2, newRow, 4, row.length - 2); + // Replace old row with the new row + rows.set(i, newRow); + } + } + } + + @Override + public boolean shouldProcessFile(String filename) { + return true; + } + + @Override + public void processRows(List rows) { + moveGradeStartColumnIndex(rows); + } + + @Override + public String createProcessedFilename(String origFilename) { + return ""; + } + + @Override + public void writeToFile(String filepath) throws IOException { + + } +} diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/PointsOffConverter.java b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/PointsOffConverter.java index fc8a56f..7d455cc 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/PointsOffConverter.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/PointsOffConverter.java @@ -6,7 +6,6 @@ public class PointsOffConverter implements CsvProcessor { /** - * * @throws NumberFormatException if cells can't be converted to ints or doubles */ public static void convertFromPointsOffToTotalPoints(List rows){ @@ -24,7 +23,7 @@ public static void convertFromPointsOffToTotalPoints(List rows){ } String[] newBlankRow = new String[1]; newBlankRow[0]=""; - rows.set(1, newBlankRow ); + rows.set(1, newBlankRow); } @Override diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/ReaderTools.java b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/ReaderTools.java index b5bb5b1..fdd13dc 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/ReaderTools.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/ReaderTools.java @@ -1,5 +1,8 @@ package edu.ithaca.dragon.tecmap.io.reader; +import com.opencsv.exceptions.CsvException; +import edu.ithaca.dragon.tecmap.Settings; +import edu.ithaca.dragon.tecmap.io.record.LearningResourceRecord; import edu.ithaca.dragon.tecmap.learningresource.AssessmentItem; import java.io.BufferedReader; @@ -7,81 +10,37 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.Random; /** * This class is a tool box class for CSV reader, these static functions are called by TecmapCSVReader - * to to data specific and line reading tasks. + * to data specific and line reading tasks. * Created by Ryan on 10/25/2017. */ public class ReaderTools { - - /** - * staticLineToList takes a given CSV file and reads each line in the file and adds it to a list - * to be returned. - * - * @param filename the name of the file being read - * @return lineList, contains a list of each line in the file - */ - public static ArrayList> staticLineToList(String filename){ - ArrayList> lineList = new ArrayList>(); - try { - String line; - BufferedReader csvBuffer = new BufferedReader(new FileReader(filename)); - //Takes the file being read in and calls a function to convert each line into a list split at - //every comma, then push all the lists returned into a list of lists lineList[line][item in line] - while ((line = csvBuffer.readLine()) != null) { - lineList.add(lineToList(line)); - } - } catch (IOException e) { - e.printStackTrace(); - } - return lineList; - } - /** * This function take the list of assessments in a given file with their max grades in the title, This program takes * the name of the assessment separate from the max grade and returns a list of the assessmentItems - * - * @param indexMark the column index point where the recording of assessments and grades start for the rest of the file - * @param singleList the line of the file that contains the list of assessments with the maximum grade + * @param rows all rows of the file * @return aiList -> a list of each assessment and its maximum grade */ - public static List assessmentItemsFromList(int indexMark, List singleList) { - int i = indexMark; + public static List assessmentItemsFromList(List rows) { List aiList = new ArrayList<>(); - while(i= 0 && end >= 0) { - String maxScoreStr = question.substring(begin + 1, end); + for (int i = 4; i < rows.get(0).length; i++) { + String text = rows.get(0)[i]; + String maxScoreStr = rows.get(2)[i]; + String id = LearningResourceRecord.generateUniqueID(null); + if (!maxScoreStr.isEmpty()) { double maxScore = Double.parseDouble(maxScoreStr); - question = question.substring(0, begin - 1); - AssessmentItem columnItem = new AssessmentItem(question); - columnItem.setMaxPossibleKnowledgeEstimate(maxScore); + AssessmentItem columnItem = new AssessmentItem(id, text, maxScore); aiList.add(columnItem); } else { - //logger.error("No max score found for string:"+question+"\t defaulting to 1, which is probably wrong"); - AssessmentItem columnItem = new AssessmentItem(question); - columnItem.setMaxPossibleKnowledgeEstimate(1); + AssessmentItem columnItem = new AssessmentItem(id, text); aiList.add(columnItem); } - i++; } return aiList; } @@ -92,13 +51,14 @@ else if (indexMark == 4){ // canvas format * @param csvfiles * @return a list of all AssessmentItem across all files */ - public static List assessmentItemsFromCSVList(int indexMark, List csvfiles){ + public static List assessmentItemsFromCSVList(List csvfiles) throws IOException, CsvException { List fullAIList = new ArrayList<>(); - //Each csvfile has their AIs searched + // Each csvfile has their AIs searched for(String file: csvfiles){ - ArrayList> lineList = ReaderTools.staticLineToList(file); - List aiList = ReaderTools.assessmentItemsFromList(indexMark,lineList.get(0)); + List rows = CsvFileLibrary.parseRowsFromFile(file); + CanvasConverter.canvasConverter(rows); + List aiList = ReaderTools.assessmentItemsFromList(rows); //adding current csvfile's LOs to the full list of AIs for(AssessmentItem columnItem : aiList) { diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/SakaiReader.java b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/SakaiReader.java index 1f65d44..6f1d589 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/SakaiReader.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/SakaiReader.java @@ -1,6 +1,9 @@ package edu.ithaca.dragon.tecmap.io.reader; +import com.opencsv.exceptions.CsvException; + import java.io.IOException; +import java.util.ArrayList; import java.util.List; /** @@ -9,8 +12,8 @@ * Created by Ryan on 11/9/2017. */ public class SakaiReader extends TecmapCSVReader { - public SakaiReader(String filename)throws IOException{ - super(filename, 2, 1); + public SakaiReader(List rows, List processors) throws IOException, CsvException { + super(rows, processors); } /** @@ -19,8 +22,8 @@ public SakaiReader(String filename)throws IOException{ * @return the ID of the student */ @Override - public String getIDForAStudent(List dataLine) { - return dataLine.get(0); + public String getIDForAStudent(String[] dataLine) { + return dataLine[0]; } /** @@ -29,7 +32,7 @@ public String getIDForAStudent(List dataLine) { * @return the name of the student */ @Override - public String getNameForAStudent(List dataLine) { - return dataLine.get(1); + public String getNameForAStudent(String[] dataLine) { + return dataLine[1]; // 1 } } diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/SwapNameAndIDColumn.java b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/SwapNameAndIDColumn.java new file mode 100644 index 0000000..3a46a3d --- /dev/null +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/SwapNameAndIDColumn.java @@ -0,0 +1,38 @@ +package edu.ithaca.dragon.tecmap.io.reader; + + +import java.io.IOException; +import java.util.List; + +public class SwapNameAndIDColumn implements CsvProcessor { + + public static void swapNameAndIDColumn(List rows) { + for (String[] row : rows) { + if ((row[0] != null && !row[0].isEmpty()) && (row[1] != null && !row[1].isEmpty())) { + String temp = row[0]; + row[0] = row[1]; + row[1] = temp; + } + } + } + + @Override + public boolean shouldProcessFile(String filename) { + return true; + } + + @Override + public void processRows(List rows) { + swapNameAndIDColumn(rows); + } + + @Override + public String createProcessedFilename(String origFilename) { + return ""; + } + + @Override + public void writeToFile(String filepath) throws IOException { + + } +} diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/TecmapCSVReader.java b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/TecmapCSVReader.java index a6a1531..4c5cb3d 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/TecmapCSVReader.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/TecmapCSVReader.java @@ -6,6 +6,7 @@ * Created by willsuchanek on 3/6/17. */ +import edu.ithaca.dragon.tecmap.io.record.LearningResourceRecord; import edu.ithaca.dragon.tecmap.learningresource.AssessmentItem; import edu.ithaca.dragon.tecmap.learningresource.AssessmentItemResponse; import edu.ithaca.dragon.tecmap.learningresource.ManualGradedResponse; @@ -19,108 +20,90 @@ import java.util.List; -public abstract class TecmapCSVReader { // differences between reader and processor - // maybe take a list of csv processors, and list of string[] then delete the file - // change convert to sakai label to processor +public abstract class TecmapCSVReader { static Logger logger = LogManager.getLogger(TecmapCSVReader.class); - String filename; - BufferedReader csvBuffer = null; List columnItemList; List manualGradedResponseList; - ReaderTools toolBox = new ReaderTools(); - int gradeStartColumnIndex; - int nameStartRowIndex; - List studentNames = new ArrayList<>(); + List studentNames; /** - * This function is passed a filename of a gradebook directly exported from Sakai's built in gradebook. + * This function is passed a filename of a gradebook directly exported from Canvas's built in gradebook. * (See DataCSVExample.csv in test/testresources/io for proper file format example) - * this function also takes an index mark that will determine where grades are first recorded in the - * CSV file. - * @param filename - * @param gradeStartColumnIndex + * @param rows a list of rows from the file + * @param processors a list of csv processors */ - public TecmapCSVReader(String filename, int gradeStartColumnIndex, int nameStartRowIndex)throws IOException{ - this.filename = filename; + public TecmapCSVReader(List rows, List processors) throws IOException{ manualGradedResponseList = new ArrayList<>(); columnItemList = new ArrayList<>(); - this.gradeStartColumnIndex = gradeStartColumnIndex; - this.nameStartRowIndex = nameStartRowIndex; - try { - String line; - this.csvBuffer = new BufferedReader(new FileReader(filename)); - ArrayList> lineList = new ArrayList<>(); - //Takes the file being read in and calls a function to convert each line into a list split at - //every comma, then pust all the lists returned into a list of lists lineList[line][item in line] - while((line = this.csvBuffer.readLine())!= null){ - ArrayList potentialLineList = toolBox.lineToList(line); - if (potentialLineList.size() > 1){ - lineList.add(potentialLineList); - } - } - -// The first list in the list of lists is the assessments (questions) so we go through the first line and -// pull out all the learning objects and put them into the columnItemList - this.columnItemList = toolBox.assessmentItemsFromList(gradeStartColumnIndex, lineList.get(0)); - for (int i = nameStartRowIndex; i < lineList.size(); i++) { - studentNames.add(getNameForAStudent(lineList.get(i))); - try { - //goes through and adds all the questions to their proper learning object, as well as adds them to - //the general list of manual graded responses - createManualGradedResponseList(lineList.get(i)); - } catch (NullPointerException e) { - System.out.println("No Responses added to one or more LearningObjects"); - } - } - } catch (IOException e) { -// e.printStackTrace(); - } + studentNames = new ArrayList<>(); + readFiles(rows, processors); } public List getManualGradedResponses(){return this.manualGradedResponseList;} public List getManualGradedLearningObjects(){return this.columnItemList;} - public abstract String getIDForAStudent(List dataLine); + public abstract String getIDForAStudent(String[] dataLine); - public abstract String getNameForAStudent(List dataLine); + public abstract String getNameForAStudent(String[] dataLine); /** * This function takes a list of student data and creates a manual graded response for that user - * @param singleList - a list with each line in the csv file holding LORs - * @throws NullPointerException if the ManualGradedResponse is null + * @param row - a row in the file */ - public void createManualGradedResponseList(ArrayList singleList)throws NullPointerException{ - int i = gradeStartColumnIndex; - String stdID = getIDForAStudent(singleList); - if (columnItemList.size() + gradeStartColumnIndex < singleList.size()) { - logger.error("More data than learning objects on line for id:" + stdID); - } else if (columnItemList.size() + gradeStartColumnIndex > singleList.size()) { - logger.warn("More learning objects than data on line for id:" + stdID); + public void createManualGradedResponseList(String[] row) throws Exception { + int i = 4; + String stdID = getIDForAStudent(row); + if (columnItemList.size() + 4 < row.length) { + logger.error("More data than learning objects on line for id: {}", stdID); + } else if (columnItemList.size() + 4 > row.length) { + logger.warn("More learning objects than data on line for id: {}", stdID); } //need to make sure we don't go out of bounds on either list - while (i < singleList.size() && i < columnItemList.size() + gradeStartColumnIndex) { - AssessmentItem currentColumnItem = this.columnItemList.get(i - gradeStartColumnIndex); - String qid = currentColumnItem.getId(); - if (!("".equals(singleList.get(i)))) { + while (i < row.length && i < columnItemList.size() + 4) { + AssessmentItem currentColumnItem = this.columnItemList.get(i - 4); + String assessmentItemId = currentColumnItem.getId(); + String assessmentItemText = currentColumnItem.getText(); + if (!("".equals(row[i]))) { double studentGrade; - String number = toolBox.pullNumber(singleList.get(i)); - if (number.equals("")){ - studentGrade = 0.0; - } - else{ + String number = ReaderTools.pullNumber(row[i]); + if (!number.isEmpty()){ studentGrade = Double.parseDouble(number); } - ManualGradedResponse response = new ManualGradedResponse(qid, currentColumnItem.getMaxPossibleKnowledgeEstimate(), studentGrade, stdID); - if(response != null) { - currentColumnItem.addResponse(response); - this.manualGradedResponseList.add(response); - }else{ - throw new NullPointerException(); + // raise exception if there is anything other than numbers + else { + throw new Exception("Typos where grades are expected."); } + ManualGradedResponse response = new ManualGradedResponse(assessmentItemId, assessmentItemText, currentColumnItem.getMaxPossibleKnowledgeEstimate(), studentGrade, stdID); + currentColumnItem.addResponse(response); + this.manualGradedResponseList.add(response); } i++; } } + + public void readFiles(List rows, List processors) { +// The first list in the list of lists is the assessments (questions) so we go through the first line and +// pull out all the learning objects and put them into the columnItemList + if (!processors.isEmpty()) { + for (CsvProcessor processor : processors) { + processor.processRows(rows); + } + } + columnItemList = ReaderTools.assessmentItemsFromList(rows); + for (int i = 3; i < rows.size(); i++) { + String[] row = rows.get(i); + if (row.length > 1) { + studentNames.add(getNameForAStudent(row)); + try { + //goes through and adds all the questions to their proper learning object, as well as adds them to + //the general list of manual graded responses + createManualGradedResponseList(rows.get(i)); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } } \ No newline at end of file diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/ZybooksReader.java b/src/main/java/edu/ithaca/dragon/tecmap/io/reader/ZybooksReader.java deleted file mode 100644 index 29cc5a8..0000000 --- a/src/main/java/edu/ithaca/dragon/tecmap/io/reader/ZybooksReader.java +++ /dev/null @@ -1,39 +0,0 @@ -package edu.ithaca.dragon.tecmap.io.reader; - -import java.io.IOException; -import java.util.List; - -/** - *This is tha child class for zybooks files, with its specific function for reading in the student names - * it will call super to the parent class, TecmapCSVReader, and pass the filename and the specific gradeColumnIndexMark. - * - * Created by Ryan on 10/4/2017. - */ - -public class ZybooksReader extends TecmapCSVReader { - public ZybooksReader(String filename)throws IOException{ - super(filename, 5, 1); - } - - /** - * This function takes in a line that holds all the info for a specific student and returns the full student name. - * @param dataLine - the line of the students info and grades - * @return the full name of the student - */ - @Override - public String getIDForAStudent(List dataLine){ - String stdID = dataLine.get(0) + " " + dataLine.get(1); - return stdID; - } - - /** - * This function takes in a line that holds all the info for a specific student and returns the - * student name. - * @param dataLine - the line of the students info and grades - * @return the name of the student - */ - @Override - public String getNameForAStudent(List dataLine){ - return dataLine.get(1); - } -} diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/record/ConceptGraphRecord.java b/src/main/java/edu/ithaca/dragon/tecmap/io/record/ConceptGraphRecord.java index a91f632..5c8e015 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/io/record/ConceptGraphRecord.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/record/ConceptGraphRecord.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; +import edu.ithaca.dragon.tecmap.io.reader.CreateMaxScoreRow; import java.io.File; import java.io.IOException; diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/record/LearningResourceRecord.java b/src/main/java/edu/ithaca/dragon/tecmap/io/record/LearningResourceRecord.java index 65810d6..9423f15 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/io/record/LearningResourceRecord.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/record/LearningResourceRecord.java @@ -1,5 +1,8 @@ package edu.ithaca.dragon.tecmap.io.record; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; @@ -12,33 +15,44 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.Random; /** * Created by willsuchanek on 4/10/17. */ public class LearningResourceRecord { - - private String learningResourceId; + @JsonIgnore + private String id; private Collection resourceTypes; private Collection conceptIds; private double dataImportance; private double maxPossibleKnowledgeEstimate; - - public LearningResourceRecord(String learningResourceId, Collection resourceTypes, Collection conceptIds, double maxPossibleKnowledgeEstimate, double dataImportance){ - this.learningResourceId = learningResourceId; - this.resourceTypes = new ArrayList<>(resourceTypes); - this.conceptIds = new ArrayList<>(conceptIds); + private String text; + +// public LearningResourceRecord(Collection resourceTypes, Collection conceptIds, +// double maxPossibleKnowledgeEstimate, double dataImportance, String text){ + @JsonCreator + public LearningResourceRecord( + @JsonProperty("resourceTypes") Collection resourceTypes, + @JsonProperty("conceptIds") Collection conceptIds, + @JsonProperty("maxPossibleKnowledgeEstimate") double maxPossibleKnowledgeEstimate, + @JsonProperty("dataImportance") double dataImportance, + @JsonProperty("text") String text){ + this.resourceTypes = (resourceTypes != null) ? new ArrayList<>(resourceTypes) : new ArrayList<>(); + this.conceptIds = (conceptIds != null) ? new ArrayList<>(conceptIds) : new ArrayList<>(); this.dataImportance = dataImportance; this.maxPossibleKnowledgeEstimate = maxPossibleKnowledgeEstimate; + this.text = text; + this.id = generateUniqueID(this.conceptIds); } public LearningResourceRecord(AssessmentItem assessment){ - this( assessment.getId(), LearningResourceType.getDefaultResourceTypes() , new ArrayList<>(), assessment.getMaxPossibleKnowledgeEstimate(), assessment.getDataImportance()); + this(LearningResourceType.getDefaultResourceTypes() , new ArrayList<>(), assessment.getMaxPossibleKnowledgeEstimate(), assessment.getDataImportance(), assessment.getText()); } // default constructor for JSON - public LearningResourceRecord(){ - this("", new ArrayList<>(), new ArrayList<>(), 1, 0); + public LearningResourceRecord(String text){ + this(new ArrayList<>(), new ArrayList<>(), 1, 0, text); } public static List createLearningResourceRecordsFromJsonFiles(List filenames) throws IOException { @@ -57,11 +71,11 @@ public static List createLearningResourceRecordsFromJson } public static List createLearningResourceRecordsFromAssessmentItems(Collection columnItems){ - List lolrList = new ArrayList(); + List lrrList = new ArrayList(); for(AssessmentItem columnItem : columnItems){ - lolrList.add( new LearningResourceRecord(columnItem)); + lrrList.add( new LearningResourceRecord(columnItem)); } - return lolrList; + return lrrList; } public static void resourceRecordsToJSON(Collection lolrList, String filename)throws IOException{ @@ -74,17 +88,19 @@ public boolean isType(LearningResourceType typeToCheck){ return resourceTypes.contains(typeToCheck); } - public String getLearningResourceId(){ return this.learningResourceId; } - public Collection getConceptIds(){ return this.conceptIds; } + public String getId(){ return this.id; } + public Collection getConceptIds(){ return conceptIds; } public double getDataImportance(){ return this.dataImportance; } public double getMaxPossibleKnowledgeEstimate(){ return this.maxPossibleKnowledgeEstimate;} - public void setLearningResourceId(String lo){this.learningResourceId = lo;} + public void setId(String lo){this.id = lo;} public void setConceptIds(List conceptIds){this.conceptIds=conceptIds;} public void setDataImportance(double dataImportance){this.dataImportance=dataImportance;} public void setMaxPossibleKnowledgeEstimate(double maxPossibleKnowledgeEstimate) {this.maxPossibleKnowledgeEstimate = maxPossibleKnowledgeEstimate;} + public void setText(String text){this.text = text;} + public String getText(){return this.text;} public void addConceptId(String conceptId){ - this.conceptIds.add(conceptId); + conceptIds.add(conceptId); } public Collection getResourceTypes() { @@ -95,14 +111,28 @@ public void setResourceTypes(Collection resourceTypes) { this.resourceTypes = new ArrayList<>(resourceTypes); } + public static String generateUniqueID(Collection conceptIds) { + Random random = new Random(); + int num = 1 + random.nextInt(10000); + StringBuilder concepts = new StringBuilder(); + if (conceptIds != null) { + for (String conceptId : conceptIds) { + concepts.append(conceptId.trim()); + } + return concepts + "_PracticeProblem" + num; + } + return "_PracticeProblem" + num; + } + public String toString(){ - String out = "(Learning Resource ID: " + this.learningResourceId + " Concept IDs: "; + String out = "(Learning Resource Text: " + this.text + " Concept IDs: "; for (String id : conceptIds){ out+=id + ", "; } //remove last comma and space out = out.substring(0, out.length()-2); out+=")"; - return out; + return out; } + } diff --git a/src/main/java/edu/ithaca/dragon/tecmap/io/writer/CSVOutputter.java b/src/main/java/edu/ithaca/dragon/tecmap/io/writer/CSVOutputter.java index f757da7..2d49d41 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/io/writer/CSVOutputter.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/io/writer/CSVOutputter.java @@ -30,7 +30,7 @@ public CSVOutputter(String filename, List summaries) thr toCSV(filename); } /** - * Takes the list of LOR and converts them all into a CSV file based on whether or not they were answered + * Takes the list of AIR and converts them all into a CSV file based on whether or not they were answered * correctly. Read functions to find out more about the formatting (makeCSV()) * @param summaries takes a list of Per User Per Problem Summaries */ @@ -55,7 +55,7 @@ public CSVOutputter(List summaries){ //sets "correct" variable to 0 if incorrect and 1 if correct double correct = summary.calcKnowledgeEstimate(); //gets the right map for the current user of this summary and adds to it - questionsToAnswer.put(summary.getLearningObjectId(), correct); + questionsToAnswer.put(summary.getAssessmentItemText(), correct); } } diff --git a/src/main/java/edu/ithaca/dragon/tecmap/learningresource/AssessmentItem.java b/src/main/java/edu/ithaca/dragon/tecmap/learningresource/AssessmentItem.java index 9f2c692..3b6b32e 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/learningresource/AssessmentItem.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/learningresource/AssessmentItem.java @@ -3,31 +3,34 @@ import edu.ithaca.dragon.tecmap.io.record.LearningResourceRecord; import edu.ithaca.dragon.tecmap.util.DataUtil; -import java.lang.reflect.Array; import java.util.*; /** * @author tdragon * 2/14/17. */ + public class AssessmentItem { String id; + String text; List responses; double maxPossibleKnowledgeEstimate; - public AssessmentItem(String id){ - this (id, 1); + public AssessmentItem(String id, String text){ + this (id, text,1); } - public AssessmentItem(String id, double maxPossibleKnowledgeEstimate){ + public AssessmentItem(String id, String text, double maxPossibleKnowledgeEstimate){ this.id = id; + this.text = text; this.responses = new ArrayList<>(); this.maxPossibleKnowledgeEstimate = maxPossibleKnowledgeEstimate; } public AssessmentItem(AssessmentItem other){ this.id = other.id; + this.text = other.text; this.maxPossibleKnowledgeEstimate = other.maxPossibleKnowledgeEstimate; this.responses = new ArrayList<>(); for (AssessmentItemResponse response : other.responses){ @@ -43,18 +46,19 @@ public AssessmentItem(AssessmentItem other){ //temprary fucntion to get htings working before switching to LearningResourceRecords public AssessmentItem(LearningResourceRecord record){ - this.id = record.getLearningResourceId(); + this.id = record.getId(); + this.text = record.getText(); this.maxPossibleKnowledgeEstimate = record.getMaxPossibleKnowledgeEstimate(); this.responses = new ArrayList<>(); } public void addResponse(AssessmentItemResponse response){ - if (id.equals(response.getLearningObjectId())) { + if (text.equals(response.getAssessmentItemText())) { responses.add(response); } else{ - throw new IllegalArgumentException("Response object id:"+ response.getLearningObjectId() - + " does not match LearningObjectId:" + id); + throw new IllegalArgumentException("AIR text: "+ response.getAssessmentItemText() + + " does not match AssessmentItemText: " + text); } } @@ -87,14 +91,16 @@ public static Map deepCopyLearningObjectMap(Map getResponses() { return responses; } + public String getText() { + return text; + } + + public String getId() {return id;} + public boolean equals(Object other){ if(other == null){ return false; @@ -102,8 +108,8 @@ public boolean equals(Object other){ if(!AssessmentItem.class.isAssignableFrom(other.getClass())){ return false; } - AssessmentItem otherNode = (AssessmentItem) other; - if(this.id.equals(otherNode.id) && this.responses.equals(otherNode.responses)){ + AssessmentItem assessmentItem = (AssessmentItem) other; + if(this.text.equals(assessmentItem.text) && this.responses.equals(assessmentItem.responses)){ return true; } else { return false; @@ -111,11 +117,11 @@ public boolean equals(Object other){ } public String toString(){ - return "LO ID:" + id + "\t" + "maxPossKnowEst:" + maxPossibleKnowledgeEstimate + "\t" + responses.toString(); + return "AI Text: " + text + "\t" + "maxPossKnowEst: " + maxPossibleKnowledgeEstimate + "\t" + responses.toString(); } public String getSummaryString(){ - return getId() + " Est:" + DataUtil.format(calcKnowledgeEstimate()) + " Imp:" + DataUtil.format(getDataImportance()) + " ResponseCount:" + getResponses().size(); + return getText() + " Est: " + DataUtil.format(calcKnowledgeEstimate()) + " Imp: " + DataUtil.format(getDataImportance()) + " ResponseCount: " + getResponses().size(); } public void setMatchingKnowledgeEstimates(Collection columnItems, Map loMap){ @@ -132,12 +138,13 @@ public void setMatchingKnowledgeEstimates(Collection columnItems public static List buildListFromAssessmentItemResponses(List responses, Map maxKnowledgeEstimates) { Map assessments = new HashMap<>(); for (AssessmentItemResponse response : responses) { - String assessmentId = response.getLearningObjectId(); + String assessmentId = response.getAssessmentItemId(); + String assessmentText = response.getAssessmentItemText(); if (assessments.containsKey(assessmentId)) { assessments.get(assessmentId).addResponse(response); } else { - double maxKE = maxKnowledgeEstimates.get(assessmentId); - AssessmentItem newAssessment = new AssessmentItem(assessmentId, maxKE); + double maxKE = maxKnowledgeEstimates.get(assessmentText); + AssessmentItem newAssessment = new AssessmentItem(assessmentId, assessmentText, maxKE); newAssessment.addResponse(response); assessments.put(assessmentId, newAssessment); } @@ -159,7 +166,7 @@ public static List getItemResponsesFromAssessmentList(Li public static List getAssessmentCopyWithoutResponses(List assessmentItems){ List assessmentsListNoResponses = new ArrayList<>(); for(AssessmentItem assessment : assessmentItems){ - AssessmentItem newAssessment = new AssessmentItem(assessment.getId(), assessment.getMaxPossibleKnowledgeEstimate()); + AssessmentItem newAssessment = new AssessmentItem(assessment.getId(), assessment.getText(), assessment.getMaxPossibleKnowledgeEstimate()); assessmentsListNoResponses.add(newAssessment); } return assessmentsListNoResponses; diff --git a/src/main/java/edu/ithaca/dragon/tecmap/learningresource/AssessmentItemResponse.java b/src/main/java/edu/ithaca/dragon/tecmap/learningresource/AssessmentItemResponse.java index 08e4fc3..0f62a95 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/learningresource/AssessmentItemResponse.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/learningresource/AssessmentItemResponse.java @@ -1,7 +1,7 @@ package edu.ithaca.dragon.tecmap.learningresource; -import edu.ithaca.dragon.tecmap.io.reader.TecmapCSVReader; -import edu.ithaca.dragon.tecmap.io.reader.SakaiReader; +import com.opencsv.exceptions.CsvException; +import edu.ithaca.dragon.tecmap.io.reader.*; import edu.ithaca.dragon.tecmap.util.DataUtil; import java.io.IOException; @@ -17,18 +17,21 @@ public class AssessmentItemResponse { private String userId; - private String learningObjectId; + private String assessmentItemId; + private String assessmentItemText; private double knowledgeEstimate; - public AssessmentItemResponse(String userId, String learningObjectId, double knowledgeEstimate) { + public AssessmentItemResponse(String userId, String assessmentItemId, String assessmentItemText, double knowledgeEstimate) { this.userId = userId; - this.learningObjectId = learningObjectId; + this.assessmentItemId = assessmentItemId; + this.assessmentItemText = assessmentItemText; this.knowledgeEstimate = knowledgeEstimate; } public AssessmentItemResponse(AssessmentItemResponse other){ this.userId = other.userId; - this.learningObjectId = other.learningObjectId; + this.assessmentItemId = other.assessmentItemId; + this.assessmentItemText = other.assessmentItemText; this.knowledgeEstimate = other.knowledgeEstimate; } @@ -49,7 +52,7 @@ public static Map> getUserResponseMap(List< return userIdToResponses; } - public String getLearningObjectId(){ return learningObjectId; } + public String getAssessmentItemId(){ return assessmentItemId; } public double calcKnowledgeEstimate(){ return knowledgeEstimate; @@ -59,6 +62,7 @@ public String getUserId(){ return userId; } + public String getAssessmentItemText(){ return assessmentItemText; } public boolean equals(Object other){ if(other == null){ @@ -69,7 +73,7 @@ public boolean equals(Object other){ } AssessmentItemResponse otherNode = (AssessmentItemResponse) other; if(this.userId.equals(otherNode.userId) && DataUtil.equalsDoubles(this.knowledgeEstimate, otherNode.knowledgeEstimate) - && this.learningObjectId.equals(otherNode.learningObjectId)){ + && this.assessmentItemId.equals(otherNode.assessmentItemId)){ return true; } else { return false; @@ -77,13 +81,16 @@ public boolean equals(Object other){ } public String toString(){ - return getLearningObjectId() + "\tuser: "+ getUserId() + "\t est: "+ calcKnowledgeEstimate(); + return getAssessmentItemText() + "\tuser: "+ getUserId() + "\t est: "+ calcKnowledgeEstimate(); } - public static List createAssessmentItemResponses(List assessmentFiles) throws IOException { + public static List createAssessmentItemResponses(List assessmentFiles) throws IOException, CsvException { List assessments = new ArrayList<>(); for (String aname: assessmentFiles){ - TecmapCSVReader tecmapCsvReader = new SakaiReader(aname); + List rows = CsvFileLibrary.parseRowsFromFile(aname); + List processors = new ArrayList<>(); + processors.add(new CanvasConverter()); + TecmapCSVReader tecmapCsvReader = new CanvasReader(rows, processors); List temp = tecmapCsvReader.getManualGradedResponses(); assessments.addAll(temp); } diff --git a/src/main/java/edu/ithaca/dragon/tecmap/learningresource/LearningMaterial.java b/src/main/java/edu/ithaca/dragon/tecmap/learningresource/LearningMaterial.java new file mode 100644 index 0000000..15276fe --- /dev/null +++ b/src/main/java/edu/ithaca/dragon/tecmap/learningresource/LearningMaterial.java @@ -0,0 +1,41 @@ +package edu.ithaca.dragon.tecmap.learningresource; + +import edu.ithaca.dragon.tecmap.io.record.LearningResourceRecord; +import lombok.Getter; + +import java.util.*; + +@Getter +public class LearningMaterial { + + protected Collection types; + private String id; + private String text; + + + public LearningMaterial(String id, Collection types, String text){ + this.id = id; + this.types = types; + this.text = text; + } + public LearningMaterial(String id, LearningResourceType type, String text){ + this(id, new ArrayList<>(Arrays.asList(type)), text); + } + + public LearningMaterial(LearningMaterial resource){ + this(resource.getId(), resource.getTypes(), resource.getText()); + } + + public LearningMaterial(LearningResourceRecord record){ + this(record.getId(), record.getResourceTypes(), record.getText()); + } + + public static Map deepCopyLearningMaterialMap(Map mapToCopy){ + Map newMap = new HashMap<>(); + for (Map.Entry entryToCopy : mapToCopy.entrySet()){ + newMap.put(entryToCopy.getKey(), new LearningMaterial(entryToCopy.getValue())); + } + return newMap; + } + +} diff --git a/src/main/java/edu/ithaca/dragon/tecmap/learningresource/LearningResource.java b/src/main/java/edu/ithaca/dragon/tecmap/learningresource/LearningResource.java deleted file mode 100644 index 18f8405..0000000 --- a/src/main/java/edu/ithaca/dragon/tecmap/learningresource/LearningResource.java +++ /dev/null @@ -1,41 +0,0 @@ -package edu.ithaca.dragon.tecmap.learningresource; - -import edu.ithaca.dragon.tecmap.io.record.LearningResourceRecord; - -import java.util.*; - -public class LearningResource { - - protected Collection types; - private String id; - - public LearningResource(String id, Collection types){ - this.id = id; - this.types = types; - } - - public LearningResource(String id, LearningResourceType type){ - this(id, new ArrayList<>(Arrays.asList(type))); - } - - public LearningResource(LearningResource material){ - this(material.getId(), material.types); - } - - public LearningResource(LearningResourceRecord record){ - this(record.getLearningResourceId(), record.getResourceTypes()); - } - - public String getId() { - return id; - } - - public static Map deepCopyLearningResourceMap(Map mapToCopy){ - Map newMap = new HashMap<>(); - for (Map.Entry entryToCopy : mapToCopy.entrySet()){ - newMap.put(entryToCopy.getKey(), new LearningResource(entryToCopy.getValue())); - } - return newMap; - } - -} diff --git a/src/main/java/edu/ithaca/dragon/tecmap/learningresource/ManualGradedResponse.java b/src/main/java/edu/ithaca/dragon/tecmap/learningresource/ManualGradedResponse.java index 8489966..8553a97 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/learningresource/ManualGradedResponse.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/learningresource/ManualGradedResponse.java @@ -10,9 +10,9 @@ public class ManualGradedResponse extends AssessmentItemResponse { double maxPossibleScore; double studentScore; - public ManualGradedResponse(String learningObjectId, double max, double studentScore, String userId){ + public ManualGradedResponse(String assessmentItemId, String text, double max, double studentScore, String userId){ - super(userId,learningObjectId,studentScore/max); + super(userId, assessmentItemId, text,studentScore/max); this.maxPossibleScore = max; diff --git a/src/main/java/edu/ithaca/dragon/tecmap/legacy/ConceptKnowledgeCalculator.java b/src/main/java/edu/ithaca/dragon/tecmap/legacy/ConceptKnowledgeCalculator.java index 03ef555..aaa6eb5 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/legacy/ConceptKnowledgeCalculator.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/legacy/ConceptKnowledgeCalculator.java @@ -1,10 +1,9 @@ package edu.ithaca.dragon.tecmap.legacy; +import com.opencsv.exceptions.CsvException; import edu.ithaca.dragon.tecmap.Settings; import edu.ithaca.dragon.tecmap.conceptgraph.*; -import edu.ithaca.dragon.tecmap.io.reader.TecmapCSVReader; -import edu.ithaca.dragon.tecmap.io.reader.ReaderTools; -import edu.ithaca.dragon.tecmap.io.reader.SakaiReader; +import edu.ithaca.dragon.tecmap.io.reader.*; import edu.ithaca.dragon.tecmap.io.record.CohortConceptGraphsRecord; import edu.ithaca.dragon.tecmap.io.record.ConceptGraphRecord; import edu.ithaca.dragon.tecmap.io.record.LearningResourceRecord; @@ -72,7 +71,7 @@ public ConceptKnowledgeCalculator(String structureFileName) throws IOException{ clearAndCreateStructureData(struct); } - public ConceptKnowledgeCalculator(String structureFilename, String resourceFilename, String assessmentFilename) throws IOException{ + public ConceptKnowledgeCalculator(String structureFilename, String resourceFilename, String assessmentFilename) throws IOException, CsvException { this(); List structure = new ArrayList<>(); @@ -87,7 +86,7 @@ public ConceptKnowledgeCalculator(String structureFilename, String resourceFilen clearAndCreateCohortData(structure, resource, assessment); } - public ConceptKnowledgeCalculator(List structureFilenames, List resourceFilenames, List assessmentFilenames) throws IOException{ + public ConceptKnowledgeCalculator(List structureFilenames, List resourceFilenames, List assessmentFilenames) throws IOException, CsvException { this(); clearAndCreateCohortData(structureFilenames, resourceFilenames, assessmentFilenames); } @@ -135,7 +134,7 @@ public void updateStructureFile(String file) throws IOException { @Override - public void clearAndCreateCohortData(List structureFilename, List resourceFilename, List assessmentFilename) throws IOException { + public void clearAndCreateCohortData(List structureFilename, List resourceFilename, List assessmentFilename) throws IOException, CsvException { structureGraph = null; cohortConceptGraphs=null; structureFiles.clear(); @@ -165,7 +164,10 @@ public void clearAndCreateCohortData(List structureFilename, List assessments = new ArrayList<>(); for (String aname: assessmentFiles){ - TecmapCSVReader tecmapCsvReader = new SakaiReader(aname); + List rows = CsvFileLibrary.parseRowsFromFile(aname); + List processors = new ArrayList<>(); + processors.add(new CanvasConverter()); + TecmapCSVReader tecmapCsvReader = new CanvasReader(rows, processors); List temp = tecmapCsvReader.getManualGradedResponses(); assessments.addAll(temp); } @@ -513,10 +515,10 @@ public String csvToResource() throws Exception { } public static void csvToResource(List assessmentFiles, String destinationFilepath) throws Exception{ - //TODO: hardcoded to sakai csv, need to hold a list of CSVReaders, or the information about which kind of reader it is... - List fullLoList = ReaderTools.assessmentItemsFromCSVList(2, assessmentFiles); - List lolrList = LearningResourceRecord.createLearningResourceRecordsFromAssessmentItems(fullLoList); - LearningResourceRecord.resourceRecordsToJSON(lolrList, destinationFilepath); + //TODO: hardcoded to canvas csv, need to hold a list of CSVReaders, or the information about which kind of reader it is... + List fullAIList = ReaderTools.assessmentItemsFromCSVList(assessmentFiles); + List lrrList = LearningResourceRecord.createLearningResourceRecordsFromAssessmentItems(fullAIList); + LearningResourceRecord.resourceRecordsToJSON(lrrList, destinationFilepath); } public static void conceptIdsToTextFile(Collection conceptIds, String destinationFilepath) throws Exception{ @@ -599,8 +601,11 @@ public boolean resourceIsValid(String name) throws IOException { } @Override - public boolean assessmentIsValid(String name) throws IOException { - TecmapCSVReader tecmapCsvReader = new SakaiReader(name); + public boolean assessmentIsValid(String name) throws IOException, CsvException { + List rows = CsvFileLibrary.parseRowsFromFile(name); + List processors = new ArrayList<>(); + processors.add(new CanvasConverter()); + TecmapCSVReader tecmapCsvReader = new CanvasReader(rows, processors); if (tecmapCsvReader.getManualGradedResponses().size()>0){ return true; }else{ diff --git a/src/main/java/edu/ithaca/dragon/tecmap/legacy/ConceptKnowledgeCalculatorAPI.java b/src/main/java/edu/ithaca/dragon/tecmap/legacy/ConceptKnowledgeCalculatorAPI.java index 7627aa3..3faa2c7 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/legacy/ConceptKnowledgeCalculatorAPI.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/legacy/ConceptKnowledgeCalculatorAPI.java @@ -1,5 +1,6 @@ package edu.ithaca.dragon.tecmap.legacy; +import com.opencsv.exceptions.CsvException; import edu.ithaca.dragon.tecmap.conceptgraph.CohortConceptGraphs; import edu.ithaca.dragon.tecmap.conceptgraph.ConceptGraph; import edu.ithaca.dragon.tecmap.suggester.GroupSuggester.Group; @@ -32,7 +33,7 @@ public interface ConceptKnowledgeCalculatorAPI { * @param resourceFilename a json file listing the resources and their links to the concepts * @param assessmentFilename a csv file containing rows of students and columns labeled with resourceIds */ - void clearAndCreateCohortData(List structureFilename, List resourceFilename, List assessmentFilename) throws IOException; + void clearAndCreateCohortData(List structureFilename, List resourceFilename, List assessmentFilename) throws IOException, CsvException; /** @@ -173,7 +174,7 @@ public interface ConceptKnowledgeCalculatorAPI { * @return true or false depending on if the file is valid * @throws IOException */ - boolean assessmentIsValid(String name)throws IOException; + boolean assessmentIsValid(String name) throws IOException, CsvException; boolean structureIsValid(String name) throws IOException; diff --git a/src/main/java/edu/ithaca/dragon/tecmap/suggester/ConceptGraphSuggesterLibrary.java b/src/main/java/edu/ithaca/dragon/tecmap/suggester/ConceptGraphSuggesterLibrary.java index ee5886d..20aece9 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/suggester/ConceptGraphSuggesterLibrary.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/suggester/ConceptGraphSuggesterLibrary.java @@ -4,6 +4,7 @@ import edu.ithaca.dragon.tecmap.conceptgraph.ConceptNode; import edu.ithaca.dragon.tecmap.learningresource.AssessmentItem; import edu.ithaca.dragon.tecmap.learningresource.AssessmentItemResponse; +import edu.ithaca.dragon.tecmap.learningresource.LearningMaterial; import java.util.*; @@ -76,7 +77,7 @@ public static HashMap> buildSuggestionM Map map = graph.buildLearningResourcePathCount(concept.getID()); Map linkMap = graph.buildDirectConceptLinkCount(); - List list = buildLearningResourceSuggestionList(map, graph.getAssessmentItemMap(), concept.getID(), linkMap); + List list = buildAssessmentItemSuggestionList(map, graph.getAssessmentItemMap(), concept.getID(), linkMap); sortSuggestions(list); @@ -115,14 +116,14 @@ public static void sortSuggestions(List myList){ *@param causedConcept- the ID of ConceptNode that the LearningResource came from *@returns a list of the created LearningResourceSuggestions */ - public static List buildLearningResourceSuggestionList(Map summaryList, Map assessmentItemMap, String causedConcept, Map directLinkMap){ + public static List buildAssessmentItemSuggestionList(Map summaryList, Map assessmentItemMap, String causedConcept, Map directLinkMap){ List myList = new ArrayList(); for (String key : summaryList.keySet()){ int lineNum = summaryList.get(key); AssessmentItem assessmentItem = assessmentItemMap.get(key); double estimate = assessmentItem.calcKnowledgeEstimate(); - int directConceptLinkCount = directLinkMap.get(assessmentItem.getId()); + int directConceptLinkCount = directLinkMap.get(assessmentItem.getText()); LearningResourceSuggestion.Level level; //fix to fit preconditions @@ -149,4 +150,20 @@ public static List buildLearningResourceSuggestionLi } return myList; } + + /** + * takes in a list of suggested concepts and returns a list of learning materials associated with those concepts + * @param suggestedConceptList a list of suggested concepts + * @return a list of learning materials + */ + public static List buildLearningMaterialSuggestionList(List suggestedConceptList) { + List list = new ArrayList<>(); + for (ConceptNode concept : suggestedConceptList) { + for (LearningMaterial learningMaterial : concept.getLearningMaterialMap().values()) { + LearningMaterialSuggestion learningMaterialSuggestion = new LearningMaterialSuggestion(learningMaterial.getId(), concept.getID(), learningMaterial.getText()); + list.add(learningMaterialSuggestion); + } + } + return list; + } } diff --git a/src/main/java/edu/ithaca/dragon/tecmap/suggester/LearningMaterialSuggestion.java b/src/main/java/edu/ithaca/dragon/tecmap/suggester/LearningMaterialSuggestion.java new file mode 100644 index 0000000..5853dbc --- /dev/null +++ b/src/main/java/edu/ithaca/dragon/tecmap/suggester/LearningMaterialSuggestion.java @@ -0,0 +1,21 @@ +package edu.ithaca.dragon.tecmap.suggester; + +import lombok.Getter; + +@Getter +public class LearningMaterialSuggestion { + private String id; + private String reasoning; + private String text; + + + public LearningMaterialSuggestion(String id, String caused, String text) { + this.id = id; + this.reasoning= caused; + this.text = text; + } + + public String toString(){ + return "Resource: " +id + "\t Concept it relates to: " + reasoning + "\n"; + } +} diff --git a/src/main/java/edu/ithaca/dragon/tecmap/suggester/LearningResourceSuggestion.java b/src/main/java/edu/ithaca/dragon/tecmap/suggester/LearningResourceSuggestion.java index beb4d69..3cc5614 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/suggester/LearningResourceSuggestion.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/suggester/LearningResourceSuggestion.java @@ -9,6 +9,7 @@ public class LearningResourceSuggestion { private String reasoning; private Level level; private int directConceptLinkCount; // how many concepts LR is linked to +// private String text; public enum Level{ //used to create ordering for suggestion diff --git a/src/main/java/edu/ithaca/dragon/tecmap/suggester/OrganizedLearningResourceSuggestions.java b/src/main/java/edu/ithaca/dragon/tecmap/suggester/OrganizedLearningResourceSuggestions.java index 2a25ec4..42f724a 100644 --- a/src/main/java/edu/ithaca/dragon/tecmap/suggester/OrganizedLearningResourceSuggestions.java +++ b/src/main/java/edu/ithaca/dragon/tecmap/suggester/OrganizedLearningResourceSuggestions.java @@ -104,9 +104,9 @@ public void completeList(ConceptGraph graph, int choice, List conce int itr = 0; while (itr < max) { for (int i = 0; i < suggestionOrder.size(); i++) { - List LOSList = suggestionMap.get(suggestionOrder.get(i)); - if (itr < LOSList.size()) { - LearningResourceSuggestion sug = LOSList.get(itr); + List LRSList = suggestionMap.get(suggestionOrder.get(i)); + if (itr < LRSList.size()) { + LearningResourceSuggestion sug = LRSList.get(itr); if (choice == 1) { incompleteList.add(sug); diff --git a/src/main/java/edu/ithaca/dragon/tecmap/ui/springbootui/gptModels/ChatCompletionRequest.java b/src/main/java/edu/ithaca/dragon/tecmap/ui/springbootui/gptModels/ChatCompletionRequest.java deleted file mode 100644 index 512cbf5..0000000 --- a/src/main/java/edu/ithaca/dragon/tecmap/ui/springbootui/gptModels/ChatCompletionRequest.java +++ /dev/null @@ -1,20 +0,0 @@ -package edu.ithaca.dragon.tecmap.ui.springbootui.gptModels; - -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -@Data -public class ChatCompletionRequest { - - private String model; - private List messages; - - - public ChatCompletionRequest(String model, String prompt) { - this.model = model; - this.messages = new ArrayList(); - this.messages.add(new ChatMessage("user", prompt)); - } -} diff --git a/src/main/java/edu/ithaca/dragon/tecmap/ui/springbootui/gptModels/ChatCompletionResponse.java b/src/main/java/edu/ithaca/dragon/tecmap/ui/springbootui/gptModels/ChatCompletionResponse.java deleted file mode 100644 index 264e3a2..0000000 --- a/src/main/java/edu/ithaca/dragon/tecmap/ui/springbootui/gptModels/ChatCompletionResponse.java +++ /dev/null @@ -1,24 +0,0 @@ -package edu.ithaca.dragon.tecmap.ui.springbootui.gptModels; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class ChatCompletionResponse { - private List choices; - - @Data - @AllArgsConstructor - @NoArgsConstructor - public static class Choice { - - private int index; - private ChatMessage message; - - } -} diff --git a/src/main/java/edu/ithaca/dragon/tecmap/ui/springbootui/gptModels/ChatMessage.java b/src/main/java/edu/ithaca/dragon/tecmap/ui/springbootui/gptModels/ChatMessage.java deleted file mode 100644 index f2ddfd7..0000000 --- a/src/main/java/edu/ithaca/dragon/tecmap/ui/springbootui/gptModels/ChatMessage.java +++ /dev/null @@ -1,15 +0,0 @@ -package edu.ithaca.dragon.tecmap.ui.springbootui.gptModels; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class ChatMessage { - private String role; - private String content; - - -} diff --git a/src/main/resources/author/comp105/comp105Resources.json b/src/main/resources/author/comp105/comp105Resources.json index 595f4c7..0142fe4 100644 --- a/src/main/resources/author/comp105/comp105Resources.json +++ b/src/main/resources/author/comp105/comp105Resources.json @@ -1,49 +1,49 @@ [ { - "learningResourceId" : "Final Project - Grade", + "text": "Final Project - Grade", "conceptIds" : [ "Content Outline", "Design", "Code", "Presentation", "Validation", "Asset Management" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Reflection1 – Then and Now", + "text": "Reflection1 – Then and Now", "conceptIds" : [ "Presentation" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab1 - Page One", + "text": "Lab1 - Page One", "conceptIds" : [ "Content Outline", "Validation", "Asset Management" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab2 – Profile – HTML", + "text": "Lab2 – Profile – HTML", "conceptIds" : [ "Content Outline", "Validation", "Asset Management", "HTML"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab3 – Profile – Style and Layout ", + "text": "Lab3 – Profile – Style and Layout ", "conceptIds" : [ "Content Outline", "Validation", "Asset Management", "Design", "HTML", "CSS", "Grid System"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Reflection #2 – Mid-Term Project Postmortem", + "text": "Reflection #2 – Mid-Term Project Postmortem", "conceptIds" : [ "Presentation" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab4 – Interactive Components", + "text": "Lab4 – Interactive Components", "conceptIds" : [ "Validation", "Asset Management", "Layout Sketchups", "HTML", "CSS", "Bootstrap Framework"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab5 – Site Theme", + "text": "Lab5 – Site Theme", "conceptIds" : [ "Validation", "Asset Management", "Design", "HTML", "CSS", "Bootstrap Framework"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab6 – Responsive Elements", + "text": "Lab6 – Responsive Elements", "conceptIds" : [ "Validation", "Asset Management", "Design", "Code", "Responsiveness"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Reflection#3 – Course Reflection", + "text": "Reflection#3 – Course Reflection", "conceptIds" : [ "Presentation" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Mid-Term - Project Grade", + "text": "Mid-Term - Project Grade", "conceptIds" : [ "Content Outline", "Design", "HTML", "CSS", "Grid System", "Presentation", "Validation", "Asset Management"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Course Grade", + "text": "Course Grade", "conceptIds" : [ "Content Outline", "Design", "Code", "Presentation", "Validation", "Asset Management" ], "dataImportance" : 1.0 } ] \ No newline at end of file diff --git a/src/main/resources/author/comp106/comp106Resources.json b/src/main/resources/author/comp106/comp106Resources.json index 572dd92..fc9628f 100644 --- a/src/main/resources/author/comp106/comp106Resources.json +++ b/src/main/resources/author/comp106/comp106Resources.json @@ -1,85 +1,85 @@ [ { - "learningResourceId" : "Final Project Design Concept Part 1", + "text": "Final Project Design Concept Part 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Final Project Implementation Part 2", + "text": "Final Project Implementation Part 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Browsers Editors and Tutorials", + "text": "Browsers Editors and Tutorials", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab1 Interaction Zero", + "text": "Lab1 Interaction Zero", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab2 Interaction Text Survey", + "text": "Lab2 Interaction Text Survey", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab3 Interaction Multimedia Choose Your Own Adventure", + "text": "Lab3 Interaction Multimedia Choose Your Own Adventure", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab4 Canvas Drawing Primitives ", + "text": "Lab4 Canvas Drawing Primitives ", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab5 Canvas Poster", + "text": "Lab5 Canvas Poster", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab6 Mouse Events", + "text": "Lab6 Mouse Events", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab7 Keyboard Events", + "text": "Lab7 Keyboard Events", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab8 Button Events", + "text": "Lab8 Button Events", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab9 Animated Artwork", + "text": "Lab9 Animated Artwork", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab10 Collision Bounding Box", + "text": "Lab10 Collision Bounding Box", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Course Reflection", + "text": "Course Reflection", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz 1 Interaction Basics", + "text": "Quiz 1 Interaction Basics", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz 2 JS Basics", + "text": "Quiz 2 JS Basics", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz 3 Canvas Drawing", + "text": "Quiz 3 Canvas Drawing", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz 4 Array Basics", + "text": "Quiz 4 Array Basics", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz 5 Event Handler Basics", + "text": "Quiz 5 Event Handler Basics", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz 6 Functions For Loops", + "text": "Quiz 6 Functions For Loops", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Course Grade", + "text": "Course Grade", "conceptIds" : [ ], "dataImportance" : 1.0 } ] \ No newline at end of file diff --git a/src/main/resources/author/comp110/comp110Resources.json b/src/main/resources/author/comp110/comp110Resources.json index 0a42409..716cb5d 100644 --- a/src/main/resources/author/comp110/comp110Resources.json +++ b/src/main/resources/author/comp110/comp110Resources.json @@ -1,137 +1,137 @@ [ { - "learningResourceId" : "Exam 1", + "text": "Exam 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Exam 2", + "text": "Exam 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 1 - Quiz 1", + "text": "Week 1 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 2 - Quiz 1", + "text": "Week 2 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 2 - Quiz 2", + "text": "Week 2 - Quiz 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 3 - Quiz 1", + "text": "Week 3 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 3 - Quiz 2", + "text": "Week 3 - Quiz 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 4 - Quiz 1", + "text": "Week 4 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 5 - Quiz 1", + "text": "Week 5 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 4 - Quiz 2", + "text": "Week 4 - Quiz 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 6 - Quiz 1", + "text": "Week 6 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 6 - Quiz 2", + "text": "Week 6 - Quiz 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 10 - Quiz 1", + "text": "Week 10 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 11 - Quiz 1", + "text": "Week 11 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 11 - Quiz 2", + "text": "Week 11 - Quiz 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 10 - Quiz 2", + "text": "Week 10 - Quiz 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 5 - Quiz 2", + "text": "Week 5 - Quiz 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 8 - Quiz 1", + "text": "Week 8 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 9 - Quiz 1", + "text": "Week 9 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 9 - Quiz 2", + "text": "Week 9 - Quiz 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Participation", + "text": "Participation", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Project 1", + "text": "Project 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Project 2", + "text": "Project 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Project 3", + "text": "Project 3", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 1 - Weekly Assignment", + "text": "Week 1 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 2 - Weekly Assignment", + "text": "Week 2 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 3 - Weekly Assignment", + "text": "Week 3 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 4 - Weekly Assignment", + "text": "Week 4 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 5 - Weekly Assignment", + "text": "Week 5 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 6 - Weekly Assignment", + "text": "Week 6 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 8 - Weekly Assignment", + "text": "Week 8 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 9 - Weekly Assignment", + "text": "Week 9 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 10 - Weekly Assignment", + "text": "Week 10 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 11 - Weekly Assignment", + "text": "Week 11 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 } ] \ No newline at end of file diff --git a/src/main/resources/author/comp115/comp115Resources.json b/src/main/resources/author/comp115/comp115Resources.json index b296052..cafd877 100644 --- a/src/main/resources/author/comp115/comp115Resources.json +++ b/src/main/resources/author/comp115/comp115Resources.json @@ -1,53 +1,53 @@ [ { - "learningResourceId" : "1", + "text": "1", "conceptIds" : ["Sum Rule", "Product Rule", "Multi-counting" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "2a", + "text": "2a", "conceptIds" : [ "Product Rule"], "dataImportance" : 1.0 }, { - "learningResourceId" : "2b", + "text": "2b", "conceptIds" : ["Sum Rule", "Product Rule", "Line Ups"], "dataImportance" : 1.0 }, { - "learningResourceId" : "2c", + "text": "2c", "conceptIds" : ["Sum Rule", "Product Rule", "Line Ups" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "3a", + "text": "3a", "conceptIds" : ["r-permutations", "Permutations with Repetition"], "dataImportance" : 1.0 }, { - "learningResourceId" : "3b", + "text": "3b", "conceptIds" : ["r-permutations", "Permutations with Repetition", "Counting by Compliment" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "3c", + "text": "3c", "conceptIds" : [ "r-permutations", "Permutations with Repetition", "Counting by Compliment"], "dataImportance" : 1.0 }, { - "learningResourceId" : "4", + "text": "4", "conceptIds" : [ "Counting Multisets"], "dataImportance" : 1.0 }, { - "learningResourceId" : "5", + "text": "5", "conceptIds" : ["r-permutations" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "6", + "text": "6", "conceptIds" : ["r-permutations", "Multi-counting", "Permutations with Repetition" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "7a", + "text": "7a", "conceptIds" : [ "Combinations","Counting Multisets"], "dataImportance" : 1.0 }, { - "learningResourceId" : "7b", + "text": "7b", "conceptIds" : [ "Combinations","Counting Multisets"], "dataImportance" : 1.0 }, { - "learningResourceId" : "7c", + "text": "7c", "conceptIds" : [ "Combinations","Counting Multisets"], "dataImportance" : 1.0 } ] \ No newline at end of file diff --git a/src/main/resources/author/comp171/comp171Resources-courseWork.json b/src/main/resources/author/comp171/comp171Resources-courseWork.json index b70d37f..3841c12 100644 --- a/src/main/resources/author/comp171/comp171Resources-courseWork.json +++ b/src/main/resources/author/comp171/comp171Resources-courseWork.json @@ -1,169 +1,169 @@ [ { - "learningResourceId" : "HW01", + "text": "HW01", "conceptIds" : [ "Designing Solutions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW02", + "text": "HW02", "conceptIds" : ["Designing Solutions" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW03", + "text": "HW03", "conceptIds" : [ "Designing Solutions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW04", + "text": "HW04", "conceptIds" : [ "Designing Solutions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW05", + "text": "HW05", "conceptIds" : ["Expressions", "Assignment", "Literals", "Integers", "Floats", "Strings" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW-quiz2", + "text": "HW-quiz2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW06", + "text": "HW06", "conceptIds" : [ "Booleans", "Boolean Expressions", "Assignment", "Stack Traces"], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW07", + "text": "HW07", "conceptIds" : [ "If Statements", "Boolean Expressions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW08", + "text": "HW08", "conceptIds" : ["While Loops", "Stack Traces" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW09", + "text": "HW09", "conceptIds" : ["While Loops" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW10", + "text": "HW10", "conceptIds" : ["While Loops" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW11", + "text": "HW11", "conceptIds" : ["Functions" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW11.5", + "text": "HW11.5", "conceptIds" : ["Defining Functions", "Calling Functions", "Stack Traces" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW12", + "text": "HW12", "conceptIds" : [ "For Loops"], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW13", + "text": "HW13", "conceptIds" : [ "Stack Traces", "Functions", "For Loops"], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW14", + "text": "HW14", "conceptIds" : [ "Functions", "For Loops", "Calling Functions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW15", + "text": "HW15", "conceptIds" : [ "Lists", "For Loops", "Stack Traces"], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW16", + "text": "HW16", "conceptIds" : ["Strings", "Lists", "Calling Functions" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW17", + "text": "HW17", "conceptIds" : [ "Collections of Collections", "Lists", "Strings"], "dataImportance" : 1.0 }, { - "learningResourceId" : "HW18", + "text": "HW18", "conceptIds" : ["Collections of Collections", "Stack Traces" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "lab02design", + "text": "lab02design", "conceptIds" : [ "Designing Solutions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "lab03design", + "text": "lab03design", "conceptIds" : [ "Designing Solutions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "lab04design", + "text": "lab04design", "conceptIds" : [ "Designing Solutions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "lab05design", + "text": "lab05design", "conceptIds" : [ "Designing Solutions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "lab06design", + "text": "lab06design", "conceptIds" : [ "Designing Solutions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "lab07design", + "text": "lab07design", "conceptIds" : [ "Designing Solutions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "lab08design", + "text": "lab08design", "conceptIds" : [ "Designing Solutions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "project01design", + "text": "project01design", "conceptIds" : [ "Designing Solutions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "project02design", + "text": "project02design", "conceptIds" : [ "Designing Solutions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "project03design", + "text": "project03design", "conceptIds" : [ "Designing Solutions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "project01implementation", + "text": "project01implementation", "conceptIds" : [ "While Loops", "If Statements", "Expressions", "Floats"], "dataImportance" : 1.0 }, { - "learningResourceId" : "project02implementation", + "text": "project02implementation", "conceptIds" : [ "Collections", "Loops", "Functions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "project03implementation", + "text": "project03implementation", "conceptIds" : [ "Collections", "Loops", "Calling Functions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz01", + "text": "Quiz01", "conceptIds" : [ "Designing Solutions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz02", + "text": "Quiz02", "conceptIds" : [ "Expressions", "Assignment", "Literals", "Integers", "Floats", "Strings"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz03", + "text": "Quiz03", "conceptIds" : [ "Boolean Expressions", "If Statements"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz04", + "text": "Quiz04", "conceptIds" : [ "While Loops", "Strings", "Stack Traces"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz05", + "text": "Quiz05", "conceptIds" : [ "Arguments", "Defining and Using Parameters", "Functions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz06", + "text": "Quiz06", "conceptIds" : [ "Functions", "Arguments", "Defining and Using Parameters", "Stack Traces"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz07", + "text": "Quiz07", "conceptIds" : [ "Lists", "Functions"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz08", + "text": "Quiz08", "conceptIds" : [ "Strings", "Lists", "For Loops", "Stack Traces"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz09", + "text": "Quiz09", "conceptIds" : ["Collections of Collections", "Lists", "Strings" ], "dataImportance" : 1.0 } ] \ No newline at end of file diff --git a/src/main/resources/author/comp220/comp220Resources-courseWork.json b/src/main/resources/author/comp220/comp220Resources-courseWork.json index bb41b45..5b825d6 100644 --- a/src/main/resources/author/comp220/comp220Resources-courseWork.json +++ b/src/main/resources/author/comp220/comp220Resources-courseWork.json @@ -1,69 +1,69 @@ [ { - "learningResourceId" : "Lab 1: Guess the Pattern", + "text": "Lab 1: Guess the Pattern", "conceptIds" : [".h and .cpp Files", "Interfaces"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab 2: Array Library", + "text": "Lab 2: Array Library", "conceptIds" : [ "Arrays", "Pass by Pointer", ".h and .cpp Files", "Interfaces", "Linear Search"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab 3: Comparing Array Library Efficiency", + "text": "Lab 3: Comparing Array Library Efficiency", "conceptIds" : ["Timing Efficiency", "Comparing Algorithms", "Pointers", "Pass by Pointer" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab 4: Recursion", + "text": "Lab 4: Recursion", "conceptIds" : ["Recursion", "const" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab 5: Comparing Searches", + "text": "Lab 5: Comparing Searches", "conceptIds" : ["Comparing Algorithms", "Bubble, Selection, Insert Sort", "Linear Search", "Binary Search", "Timing Efficiency" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab 6: ArrayList and Testing", + "text": "Lab 6: ArrayList and Testing", "conceptIds" : ["Object Oriented Programming in C++", "Destructor", "Pass by Reference", "Default Constructor, Copy Constructor, Assignment Operator", "Unit Testing"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab 7: Linked List", + "text": "Lab 7: Linked List", "conceptIds" : ["Linked Nodes", "Default Constructor, Copy Constructor, Assignment Operator", "Destructor" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab 8: Comparing Arrays and Linked Lists", + "text": "Lab 8: Comparing Arrays and Linked Lists", "conceptIds" : ["Lists", "Abstract Data Types", "Comparing Data Structures", "Arrays", "Linked Nodes", "Interfaces" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Overall Project Score", + "text": "Overall Project Score", "conceptIds" : [ ], "dataImportance" : 0.1 }, { - "learningResourceId" : "Day 03 Reading - C++ intro and pointers", + "text": "Day 03 Reading - C++ intro and pointers", "conceptIds" : ["Pointers" ], "dataImportance" : 0.1 }, { - "learningResourceId" : "Day 02 Reading - C++ Intro", + "text": "Day 02 Reading - C++ Intro", "conceptIds" : [ ".h and .cpp Files" ], "dataImportance" : 0.1 }, { - "learningResourceId" : "Day 06 Reading - Pointers, Arrays, and Dynamic Memory", + "text": "Day 06 Reading - Pointers, Arrays, and Dynamic Memory", "conceptIds" : [ "Pointers", "Arrays", "Memory Management"], "dataImportance" : 0.1 }, { - "learningResourceId" : "Day 09 Reading - Ponters and const", + "text": "Day 09 Reading - Ponters and const", "conceptIds" : [ "Pointers", "const"], "dataImportance" : 0.1 }, { - "learningResourceId" : "Day 10 Reading - Recursion", + "text": "Day 10 Reading - Recursion", "conceptIds" : [ "Recursion"], "dataImportance" : 0.1 }, { - "learningResourceId" : "Day 15 Reading - Big-O Notation", + "text": "Day 15 Reading - Big-O Notation", "conceptIds" : [ "Big-O Notation"], "dataImportance" : 0.1 }, { - "learningResourceId" : "Day 17 Reading - OOP in C++", + "text": "Day 17 Reading - OOP in C++", "conceptIds" : [ "Object Oriented Programming in C++"], "dataImportance" : 0.1 }, { - "learningResourceId" : "Day 27 Reading - Copying Objects", + "text": "Day 27 Reading - Copying Objects", "conceptIds" : ["Object Memory Management: Deep vs. Shallow Copies", "Default Constructor, Copy Constructor, Assignment Operator", "Destructor" ], "dataImportance" : 0.1 } ] \ No newline at end of file diff --git a/src/main/resources/author/comp220/comp220Resources-e1.json b/src/main/resources/author/comp220/comp220Resources-e1.json index e5caae5..a278144 100644 --- a/src/main/resources/author/comp220/comp220Resources-e1.json +++ b/src/main/resources/author/comp220/comp220Resources-e1.json @@ -1,49 +1,49 @@ [ { - "learningResourceId" : "1", + "text": "1", "conceptIds" : ["Interfaces", ".h and .cpp Files" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "2", + "text": "2", "conceptIds" : ["Arrays", "Comparing Data Structures" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "3", + "text": "3", "conceptIds" : ["const", "Pointers" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "4", + "text": "4", "conceptIds" : ["Memory Leaks", "Dangling Pointers" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "5", + "text": "5", "conceptIds" : ["Comparing Algorithms", "Binary Search", "Linear Search" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "6", + "text": "6", "conceptIds" : ["Big-O Notation" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "7", + "text": "7", "conceptIds" : [ "Memory Diagrams"], "dataImportance" : 1.0 }, { - "learningResourceId" : "7-HG", + "text": "7-HG", "conceptIds" : ["Arrays", "Linear Search", "Pointers"], "dataImportance" : 1.0 }, { - "learningResourceId" : "7-AG", + "text": "7-AG", "conceptIds" : ["Recursion", "Arrays" ], "dataImportance" : 2.0 }, { - "learningResourceId" : "7-SG", + "text": "7-SG", "conceptIds" : ["Bubble, Selection, Insert Sort", "Arrays" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "8", + "text": "8", "conceptIds" : [ "Comparing Algorithms", "Big-O Notation"], "dataImportance" : 2.0 }, { - "learningResourceId" : "9", + "text": "9", "conceptIds" : ["Object Oriented Programming in C++", "Destructor" ], "dataImportance" : 1.0 } ] \ No newline at end of file diff --git a/src/main/resources/author/comp220/comp220Resources-e2.json b/src/main/resources/author/comp220/comp220Resources-e2.json index 7701f2e..b2d6948 100644 --- a/src/main/resources/author/comp220/comp220Resources-e2.json +++ b/src/main/resources/author/comp220/comp220Resources-e2.json @@ -1,57 +1,57 @@ [ { - "learningResourceId" : "e2-1", + "text": "e2-1", "conceptIds" : [ "Abstract Data Types", "Abstract Classes and Inheritance"], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-2", + "text": "e2-2", "conceptIds" : ["Pass by Reference", "Pass by Pointer" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-3", + "text": "e2-3", "conceptIds" : ["Object Memory Management: Deep vs. Shallow Copies", "Destructor", "Default Constructor, Copy Constructor, Assignment Operator" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-4", + "text": "e2-4", "conceptIds" : ["Comparing Data Structures", "Arrays", "Linked Nodes" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-5", + "text": "e2-5", "conceptIds" : [], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-6", + "text": "e2-6", "conceptIds" : [ "Stacks and Queues", "Comparing Data Structures", "Arrays", "Linked Nodes" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-Trace", + "text": "e2-Trace", "conceptIds" : ["Memory Diagrams" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-C-3", + "text": "e2-C-3", "conceptIds" : ["Destructor" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-C-4", + "text": "e2-C-4", "conceptIds" : ["Linked Nodes", "Object Oriented Programming in C++" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-CA-1", + "text": "e2-CA-1", "conceptIds" : [ "Object Oriented Programming in C++", "Pointers"], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-CA-2", + "text": "e2-CA-2", "conceptIds" : [ "Object Oriented Programming in C++", "Arrays"], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-CA-3", + "text": "e2-CA-3", "conceptIds" : [ "Object Oriented Programming in C++", "Arrays"], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-CA-4", + "text": "e2-CA-4", "conceptIds" : ["Big-O Notation", "Comparing Algorithms" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-CA-5", + "text": "e2-CA-5", "conceptIds" : ["Object Memory Management: Deep vs. Shallow Copies", "Default Constructor, Copy Constructor, Assignment Operator" ], "dataImportance" : 1.0 } ] \ No newline at end of file diff --git a/src/main/resources/author/comp220/comp220Resources-finalExam.json b/src/main/resources/author/comp220/comp220Resources-finalExam.json index eb69e38..82b33b3 100644 --- a/src/main/resources/author/comp220/comp220Resources-finalExam.json +++ b/src/main/resources/author/comp220/comp220Resources-finalExam.json @@ -1,77 +1,77 @@ [ { - "learningResourceId" : "final-1", + "text": "final-1", "conceptIds" : ["Pass by Value", "Object Memory Management: Deep vs. Shallow Copies" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-2", + "text": "final-2", "conceptIds" : [ "Dangling Pointers"], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-3", + "text": "final-3", "conceptIds" : [ "Memory Leaks", "Object Oriented Programming in C++", "Destructor"], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-4", + "text": "final-4", "conceptIds" : [ "Recursion"], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-5", + "text": "final-5", "conceptIds" : [ "Comparing Data Structures", "Linked Nodes", "Arrays"], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-6", + "text": "final-6", "conceptIds" : [ "Comparing Algorithms", "Merge Sort", "Bubble, Selection, Insert Sort", "Big-O Notation"], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-Trace", + "text": "final-Trace", "conceptIds" : [ "Memory Diagrams", "Recursion"], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-8", + "text": "final-8", "conceptIds" : ["Linked Nodes" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-9", + "text": "final-9", "conceptIds" : [ "Stacks and Queues"], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-10", + "text": "final-10", "conceptIds" : [ "Default Constructor, Copy Constructor, Assignment Operator"], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-11", + "text": "final-11", "conceptIds" : ["Default Constructor, Copy Constructor, Assignment Operator", "Object Memory Management: Deep vs. Shallow Copies" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Tree-1", + "text": "Tree-1", "conceptIds" : ["Trees" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Tree-2-a", + "text": "Tree-2-a", "conceptIds" : ["Trees" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Tree-2-b", + "text": "Tree-2-b", "conceptIds" : ["Trees"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Tree-2-c", + "text": "Tree-2-c", "conceptIds" : ["Trees", "Timing Efficiency" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Tree-code-1", + "text": "Tree-code-1", "conceptIds" : ["Trees", "Recursion" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Tree-code-1-1", + "text": "Tree-code-1-1", "conceptIds" : ["Trees", "Big-O Notation", "Timing Efficiency" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "tree-code-2", + "text": "tree-code-2", "conceptIds" : ["Trees", "Recursion" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Tree-code-2-2", + "text": "Tree-code-2-2", "conceptIds" : ["Trees", "Big-O Notation", "Timing Efficiency" ], "dataImportance" : 1.0 } ] \ No newline at end of file diff --git a/src/main/resources/datastore/AnalysisExample/AnalysisExample1.csv b/src/main/resources/datastore/AnalysisExample/AnalysisExample1.csv index d62e7cf..1448604 100644 --- a/src/main/resources/datastore/AnalysisExample/AnalysisExample1.csv +++ b/src/main/resources/datastore/AnalysisExample/AnalysisExample1.csv @@ -1,9 +1,10 @@ -Student ID,Name,Q1 [10],Q2 [5],Q3 [10],Q4 [5],Q5 [100] +Name,Student ID,,,Q1,Q2,Q3,Q4,Q5 -s01,Bart,9,0,10,1,98 -s02,Marge,10,1,8.5,1.5,100 -s03,Homer,10,1.5,9,0.5,95 -s04,Lisa,8,1.25,9,1,99 -s05,Apu,9,1,9,1,100 -s06,Maggie,10,0.5,8,1.26,97 -s07,Milhouse,9,0.7,8.6,1,95, \ No newline at end of file +Points Possible,,,,10,5,10,5,100 +Bart,s01,,,9,0,10,1,98 +Marge,s02,,,10,1,8.5,1.5,100 +Homer,s03,,,10,1.5,9,0.5,95 +Lisa,s04,,,8,1.25,9,1,99 +Apu,s05,,,9,1,9,1,100 +Maggie,s06,,,10,0.5,8,1.26,97 +Milhouse,s07,,,9,0.7,8.6,1,95, \ No newline at end of file diff --git a/src/main/resources/datastore/AnalysisExample/AnalysisExample1small.csv b/src/main/resources/datastore/AnalysisExample/AnalysisExample1small.csv index 209b57c..90d1871 100644 --- a/src/main/resources/datastore/AnalysisExample/AnalysisExample1small.csv +++ b/src/main/resources/datastore/AnalysisExample/AnalysisExample1small.csv @@ -1,6 +1,7 @@ -student ID,Name,Q1 [10],Q2 [5],Q3 [10],Q4 [5],Q5 [100] +Name,Student ID,,,Q1,Q2,Q3,Q4,Q5 -s01,Bart,9,0,10,1,98 -s02,Lisa,10,1,8.5,1.5,100 -s03,Milhouse,10,1.5,9,0.5,95 +Points Possible,,,,10,5,10,5,100 +Bart,s01,,,9,0,10,1,98 +Lisa,s02,,,10,1,8.5,1.5,100 +Milhouse,s03,,,10,1.5,9,0.5,95 diff --git a/src/main/resources/datastore/AnalysisExample/AnalysisResources.json b/src/main/resources/datastore/AnalysisExample/AnalysisResources.json index 4be836a..92eb779 100644 --- a/src/main/resources/datastore/AnalysisExample/AnalysisResources.json +++ b/src/main/resources/datastore/AnalysisExample/AnalysisResources.json @@ -1,29 +1,29 @@ [ { - "learningResourceId" : "Q1", + "text": "Q1", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "If Statements"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Q2", + "text": "Q2", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "While Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Q3", + "text": "Q3", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "For Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Q4", + "text": "Q4", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Q5", + "text": "Q5", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "Intro CS"], "dataImportance" : 0.0, diff --git a/src/main/resources/datastore/Cs1Example/Cs1ExampleAssessment1.csv b/src/main/resources/datastore/Cs1Example/Cs1ExampleAssessment1.csv index c37a519..3b7476e 100644 --- a/src/main/resources/datastore/Cs1Example/Cs1ExampleAssessment1.csv +++ b/src/main/resources/datastore/Cs1Example/Cs1ExampleAssessment1.csv @@ -1,6 +1,7 @@ -student ID,Name,Q1 [10],Q2 [5],Q3 [10],Q4 [5],Q5 [100] +Name,student ID,,,Q1,Q2,Q3,Q4,Q5 -s01,Bart,5,2.5,5,2.5,50 -s02,Lisa,10,5,10,5,100 -s03,Milhouse,10,4,8,2.5,75 +Points Possible,,,,10,5,10,5,100 +Bart,s01,,,5,2.5,5,2.5,50 +Lisa,s02,,,10,5,10,5,100 +Milhouse,s03,,,10,4,8,2.5,75 diff --git a/src/main/resources/datastore/Cs1Example/Cs1ExampleAssessment2.csv b/src/main/resources/datastore/Cs1Example/Cs1ExampleAssessment2.csv index b44fd6f..0b55693 100644 --- a/src/main/resources/datastore/Cs1Example/Cs1ExampleAssessment2.csv +++ b/src/main/resources/datastore/Cs1Example/Cs1ExampleAssessment2.csv @@ -1,5 +1,6 @@ -student ID,Name,HW1 [1],HW2 [5],HW3 [2],HW4 [1],HW5 [1] +Name,student ID,,,HW1,HW2,HW3,HW4,HW5 -s01,Bart,0,0,0,1,0 -s02,Lisa,1,5,2,1,1 -s03,Milhouse,1,4,2,0,1 +Points Possible,,,,1,5,2,1,1 +Bart,s01,,,0,0,0,1,0 +Lisa,s02,,,1,5,2,1,1 +Milhouse,s03,,,1,4,2,0,1 diff --git a/src/main/resources/datastore/Cs1Example/Cs1ExampleResources.json b/src/main/resources/datastore/Cs1Example/Cs1ExampleResources.json index e741074..1197f63 100644 --- a/src/main/resources/datastore/Cs1Example/Cs1ExampleResources.json +++ b/src/main/resources/datastore/Cs1Example/Cs1ExampleResources.json @@ -1,59 +1,59 @@ [ { - "learningResourceId" : "Q1", + "text": "Q1", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "If Statements"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Q2", + "text": "Q2", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "While Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Q3", + "text": "Q3", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "For Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Q4", + "text": "Q4", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Q5", + "text": "Q5", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "Intro CS"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 100.0 }, { - "learningResourceId" : "HW1", + "text": "HW1", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "Boolean Expressions"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 1.0 }, { - "learningResourceId" : "HW2", + "text": "HW2", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "Boolean Expressions"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "HW3", + "text": "HW3", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "If Statements"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 2.0 }, { - "learningResourceId" : "HW4", + "text": "HW4", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "While Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 1.0 }, { - "learningResourceId" : "HW5", + "text": "HW5", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "For Loops"], "dataImportance" : 0.0, diff --git a/src/main/resources/datastore/TecmapDatastore.json b/src/main/resources/datastore/TecmapDatastore.json index d461a0c..5b6636c 100644 --- a/src/main/resources/datastore/TecmapDatastore.json +++ b/src/main/resources/datastore/TecmapDatastore.json @@ -1,5 +1,10 @@ { "allRecords" : [ { + "id" : "AnalysisExample", + "graphFile" : "src/test/resources/datastore/AnalysisExample/AnalysisGraph.json", + "resourceFiles" : [ "src/test/resources/datastore/AnalysisExample/AnalysisResources.json" ], + "assessmentFiles" : [ "src/test/resources/datastore/AnalysisExample/AnalysisExample1.csv" ] + }, { "id" : "Cs1Example", "graphFile" : "src/test/resources/datastore/Cs1Example/Cs1ExampleGraph.json", "resourceFiles" : [ "src/test/resources/datastore/Cs1Example/Cs1ExampleResources.json" ], @@ -24,6 +29,11 @@ "graphFile" : "src/main/resources/datastore/comp171Dragon/comp171DragonGraph.json", "resourceFiles" : [ ], "assessmentFiles" : [ ] + }, { + "id" : "comp220-2024", + "graphFile" : "src/main/resources/datastore/comp220-2024/graph.json", + "resourceFiles" : [ "src/main/resources/datastore/comp220-2024/learningResources.json", "src/main/resources/datastore/comp220-2024/chatGPTResources.json" ], + "assessmentFiles" : [ "src/main/resources/datastore/comp220-2024/assessmentGrades.csv" ] }, { "id" : "comp220Dragon-2017", "graphFile" : "src/main/resources/datastore/comp220Dragon-2017/comp220DragonGraph.json", @@ -33,16 +43,6 @@ "id" : "comp220Dragon-2018", "graphFile" : "src/main/resources/datastore/comp220Dragon-2018/comp220DragonGraph.json", "resourceFiles" : [ "src/main/resources/datastore/comp220Dragon-2018/comp220Dragon-2018Resources.json" ], - "assessmentFiles" : [ "src/main/resources/datastore/comp220Dragon-2018/private/220-Exam1Grades-totalPoints-removeNames.csv", "src/main/resources/datastore/comp220Dragon-2018/private/comp220-gradebook-2018-removeNames.csv" ] - }, { - "id" : "AnalysisExample", - "graphFile" : "src/test/resources/datastore/AnalysisExample/AnalysisGraph.json", - "resourceFiles" : [ "src/test/resources/datastore/AnalysisExample/AnalysisResources.json" ], - "assessmentFiles" : [ "src/test/resources/datastore/AnalysisExample/AnalysisExample1.csv" ] - }, { - "id" : "comp220-2024", - "graphFile" : "src/main/resources/datastore/comp220-2024/graph.json", - "resourceFiles" : [ "src/main/resources/datastore/comp220-2024/learningMaterials.json" ], - "assessmentFiles" : [ "src/main/resources/datastore/comp220-2024/assessmentGrades.csv" ] + "assessmentFiles" : [ ] } ] } \ No newline at end of file diff --git a/src/main/resources/datastore/comp105/comp105Resources.json b/src/main/resources/datastore/comp105/comp105Resources.json index 595f4c7..0142fe4 100644 --- a/src/main/resources/datastore/comp105/comp105Resources.json +++ b/src/main/resources/datastore/comp105/comp105Resources.json @@ -1,49 +1,49 @@ [ { - "learningResourceId" : "Final Project - Grade", + "text": "Final Project - Grade", "conceptIds" : [ "Content Outline", "Design", "Code", "Presentation", "Validation", "Asset Management" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Reflection1 – Then and Now", + "text": "Reflection1 – Then and Now", "conceptIds" : [ "Presentation" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab1 - Page One", + "text": "Lab1 - Page One", "conceptIds" : [ "Content Outline", "Validation", "Asset Management" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab2 – Profile – HTML", + "text": "Lab2 – Profile – HTML", "conceptIds" : [ "Content Outline", "Validation", "Asset Management", "HTML"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab3 – Profile – Style and Layout ", + "text": "Lab3 – Profile – Style and Layout ", "conceptIds" : [ "Content Outline", "Validation", "Asset Management", "Design", "HTML", "CSS", "Grid System"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Reflection #2 – Mid-Term Project Postmortem", + "text": "Reflection #2 – Mid-Term Project Postmortem", "conceptIds" : [ "Presentation" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab4 – Interactive Components", + "text": "Lab4 – Interactive Components", "conceptIds" : [ "Validation", "Asset Management", "Layout Sketchups", "HTML", "CSS", "Bootstrap Framework"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab5 – Site Theme", + "text": "Lab5 – Site Theme", "conceptIds" : [ "Validation", "Asset Management", "Design", "HTML", "CSS", "Bootstrap Framework"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab6 – Responsive Elements", + "text": "Lab6 – Responsive Elements", "conceptIds" : [ "Validation", "Asset Management", "Design", "Code", "Responsiveness"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Reflection#3 – Course Reflection", + "text": "Reflection#3 – Course Reflection", "conceptIds" : [ "Presentation" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Mid-Term - Project Grade", + "text": "Mid-Term - Project Grade", "conceptIds" : [ "Content Outline", "Design", "HTML", "CSS", "Grid System", "Presentation", "Validation", "Asset Management"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Course Grade", + "text": "Course Grade", "conceptIds" : [ "Content Outline", "Design", "Code", "Presentation", "Validation", "Asset Management" ], "dataImportance" : 1.0 } ] \ No newline at end of file diff --git a/src/main/resources/datastore/comp106/comp106Resources.json b/src/main/resources/datastore/comp106/comp106Resources.json index 572dd92..fc9628f 100644 --- a/src/main/resources/datastore/comp106/comp106Resources.json +++ b/src/main/resources/datastore/comp106/comp106Resources.json @@ -1,85 +1,85 @@ [ { - "learningResourceId" : "Final Project Design Concept Part 1", + "text": "Final Project Design Concept Part 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Final Project Implementation Part 2", + "text": "Final Project Implementation Part 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Browsers Editors and Tutorials", + "text": "Browsers Editors and Tutorials", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab1 Interaction Zero", + "text": "Lab1 Interaction Zero", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab2 Interaction Text Survey", + "text": "Lab2 Interaction Text Survey", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab3 Interaction Multimedia Choose Your Own Adventure", + "text": "Lab3 Interaction Multimedia Choose Your Own Adventure", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab4 Canvas Drawing Primitives ", + "text": "Lab4 Canvas Drawing Primitives ", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab5 Canvas Poster", + "text": "Lab5 Canvas Poster", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab6 Mouse Events", + "text": "Lab6 Mouse Events", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab7 Keyboard Events", + "text": "Lab7 Keyboard Events", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab8 Button Events", + "text": "Lab8 Button Events", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab9 Animated Artwork", + "text": "Lab9 Animated Artwork", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab10 Collision Bounding Box", + "text": "Lab10 Collision Bounding Box", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Course Reflection", + "text": "Course Reflection", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz 1 Interaction Basics", + "text": "Quiz 1 Interaction Basics", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz 2 JS Basics", + "text": "Quiz 2 JS Basics", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz 3 Canvas Drawing", + "text": "Quiz 3 Canvas Drawing", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz 4 Array Basics", + "text": "Quiz 4 Array Basics", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz 5 Event Handler Basics", + "text": "Quiz 5 Event Handler Basics", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Quiz 6 Functions For Loops", + "text": "Quiz 6 Functions For Loops", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Course Grade", + "text": "Course Grade", "conceptIds" : [ ], "dataImportance" : 1.0 } ] \ No newline at end of file diff --git a/src/main/resources/datastore/comp110/comp110Resources.json b/src/main/resources/datastore/comp110/comp110Resources.json index 0a42409..716cb5d 100644 --- a/src/main/resources/datastore/comp110/comp110Resources.json +++ b/src/main/resources/datastore/comp110/comp110Resources.json @@ -1,137 +1,137 @@ [ { - "learningResourceId" : "Exam 1", + "text": "Exam 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Exam 2", + "text": "Exam 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 1 - Quiz 1", + "text": "Week 1 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 2 - Quiz 1", + "text": "Week 2 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 2 - Quiz 2", + "text": "Week 2 - Quiz 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 3 - Quiz 1", + "text": "Week 3 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 3 - Quiz 2", + "text": "Week 3 - Quiz 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 4 - Quiz 1", + "text": "Week 4 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 5 - Quiz 1", + "text": "Week 5 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 4 - Quiz 2", + "text": "Week 4 - Quiz 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 6 - Quiz 1", + "text": "Week 6 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 6 - Quiz 2", + "text": "Week 6 - Quiz 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 10 - Quiz 1", + "text": "Week 10 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 11 - Quiz 1", + "text": "Week 11 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 11 - Quiz 2", + "text": "Week 11 - Quiz 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 10 - Quiz 2", + "text": "Week 10 - Quiz 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 5 - Quiz 2", + "text": "Week 5 - Quiz 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 8 - Quiz 1", + "text": "Week 8 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 9 - Quiz 1", + "text": "Week 9 - Quiz 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 9 - Quiz 2", + "text": "Week 9 - Quiz 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Participation", + "text": "Participation", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Project 1", + "text": "Project 1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Project 2", + "text": "Project 2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Project 3", + "text": "Project 3", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 1 - Weekly Assignment", + "text": "Week 1 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 2 - Weekly Assignment", + "text": "Week 2 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 3 - Weekly Assignment", + "text": "Week 3 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 4 - Weekly Assignment", + "text": "Week 4 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 5 - Weekly Assignment", + "text": "Week 5 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 6 - Weekly Assignment", + "text": "Week 6 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 8 - Weekly Assignment", + "text": "Week 8 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 9 - Weekly Assignment", + "text": "Week 9 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 10 - Weekly Assignment", + "text": "Week 10 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Week 11 - Weekly Assignment", + "text": "Week 11 - Weekly Assignment", "conceptIds" : [ ], "dataImportance" : 1.0 } ] \ No newline at end of file diff --git a/src/main/resources/datastore/comp115/comp115Resources.json b/src/main/resources/datastore/comp115/comp115Resources.json index b296052..cafd877 100644 --- a/src/main/resources/datastore/comp115/comp115Resources.json +++ b/src/main/resources/datastore/comp115/comp115Resources.json @@ -1,53 +1,53 @@ [ { - "learningResourceId" : "1", + "text": "1", "conceptIds" : ["Sum Rule", "Product Rule", "Multi-counting" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "2a", + "text": "2a", "conceptIds" : [ "Product Rule"], "dataImportance" : 1.0 }, { - "learningResourceId" : "2b", + "text": "2b", "conceptIds" : ["Sum Rule", "Product Rule", "Line Ups"], "dataImportance" : 1.0 }, { - "learningResourceId" : "2c", + "text": "2c", "conceptIds" : ["Sum Rule", "Product Rule", "Line Ups" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "3a", + "text": "3a", "conceptIds" : ["r-permutations", "Permutations with Repetition"], "dataImportance" : 1.0 }, { - "learningResourceId" : "3b", + "text": "3b", "conceptIds" : ["r-permutations", "Permutations with Repetition", "Counting by Compliment" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "3c", + "text": "3c", "conceptIds" : [ "r-permutations", "Permutations with Repetition", "Counting by Compliment"], "dataImportance" : 1.0 }, { - "learningResourceId" : "4", + "text": "4", "conceptIds" : [ "Counting Multisets"], "dataImportance" : 1.0 }, { - "learningResourceId" : "5", + "text": "5", "conceptIds" : ["r-permutations" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "6", + "text": "6", "conceptIds" : ["r-permutations", "Multi-counting", "Permutations with Repetition" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "7a", + "text": "7a", "conceptIds" : [ "Combinations","Counting Multisets"], "dataImportance" : 1.0 }, { - "learningResourceId" : "7b", + "text": "7b", "conceptIds" : [ "Combinations","Counting Multisets"], "dataImportance" : 1.0 }, { - "learningResourceId" : "7c", + "text": "7c", "conceptIds" : [ "Combinations","Counting Multisets"], "dataImportance" : 1.0 } ] \ No newline at end of file diff --git a/src/main/resources/datastore/comp220-2024/chatGPTResources.json b/src/main/resources/datastore/comp220-2024/chatGPTResources.json new file mode 100644 index 0000000..757b8c0 --- /dev/null +++ b/src/main/resources/datastore/comp220-2024/chatGPTResources.json @@ -0,0 +1,371 @@ +[ + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Queue", + "Linked Structures" + ], + "text": "Create a queue using a singly linked list. Implement all standard operations (enqueue, dequeue, front, and isEmpty)." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Queue", + "Stack" + ], + "text": "Design a queue implementation using two stacks. Implement the enqueue and dequeue operations." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Queue", + "Recursion" + ], + "text": "Write a function to reverse the elements of a queue. You can only use recursion and the queue itself." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Priority Queue" + ], + "text": "Implement a priority queue where each element has a priority associated with it. The queue should serve elements with higher priority first." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Queue" + ], + "text": "Implement a circular queue. Include methods for enqueue, dequeue, and checking if the queue is empty or full." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Queue", + "Arrays" + ], + "text": "Implement a queue using an array. Include methods for enqueue, dequeue, front, rear, and checking if the queue is empty or full." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Queue" + ], + "text": "Create a double-ended queue (deque) that supports insertion and deletion from both ends. Implement the necessary methods." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Queue", + "Linked Structures" + ], + "text": "Write a function to implement a queue using a single linked list. Include methods for enqueue, dequeue, and getting the size of the queue." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Queue" + ], + "text": "Design a queue that can also support getting the minimum element in constant time. Implement the necessary operations." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Queue" + ], + "text": "Simulate the process of a queue by implementing a ticketing system where customers are queued and processed based on their ticket numbers." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Queue", + "Arrays" + ], + "text": "Implement a queue using an array. Ensure to handle the scenario where the queue gets full and needs to be resized." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Queue" + ], + "text": "Create a double-ended queue (deque) implementation that allows insertion and deletion of elements from both ends." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Queue" + ], + "text": "Write an algorithm to check if a sequence of brackets is balanced using a queue." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Queue" + ], + "text": "Implement a queue that supports the following operations: enqueue, dequeue, and peek, and also allows you to retrieve the maximum element in constant time." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Queue" + ], + "text": "Simulate a queue of people waiting for a service, implementing the logic to serve customers based on their arrival time and service time." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Binary Trees" + ], + "text": "Write a function to perform an in-order traversal of a binary tree and return the values in an array." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Binary Trees" + ], + "text": "Implement a function to determine if a given binary tree is a valid binary search tree (BST)." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Binary Trees" + ], + "text": "Create a function that calculates the height of a binary tree." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Binary Trees" + ], + "text": "Write a function to find the lowest common ancestor of two nodes in a binary tree." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Binary Trees" + ], + "text": "Implement a function to serialize and deserialize a binary tree, allowing it to be stored in a string format." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "BigO", + "Arrays" + ], + "text": "Analyze the time complexity of a function that calculates the sum of all elements in an array. Provide a Big O notation for your answer." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "BigO", + "Arrays" + ], + "text": "Write a function that takes a sorted array and a target value, and uses binary search to determine if the target exists in the array. Explain the time complexity and provide the Big O notation." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "BigO", + "Set" + ], + "text": "Create a function that generates all subsets of a given set of integers. Discuss the time complexity of your solution and express it in Big O notation." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "BigO" + ], + "text": "Implement a bubble sort algorithm and analyze its time complexity in the worst, best, and average cases. Provide Big O notation for each." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "BigO" + ], + "text": "Write a function that determines if a given string is a palindrome. Discuss the time complexity of your solution and the factors that impact it in terms of Big O notation." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Map" + ], + "text": "Implement a basic map data structure using an array of linked lists. Include methods for inserting, deleting, and searching for keys." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Map" + ], + "text": "Write a function that takes two maps and returns a new map that is the union of both. Keys should have the sum of their values in the resulting map." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Map" + ], + "text": "Create a method to find the first non-repeating character in a given string using a map to count occurrences." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Map" + ], + "text": "Implement a frequency map that takes an array and returns an object containing the number of times each unique element appears in the array." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": [ + "Map" + ], + "text": "Design a function that checks whether two maps are equal, meaning they have the same keys with the same corresponding values." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Hash Tables", "Chained Hash Tables"], + "text": "Implement a hash map from scratch, allowing for insertion, deletion, and retrieval of key-value pairs." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Hash Tables", "Map"], + "text": "Write a function that returns the first non-repeating character in a given string using a hash map." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Hash Tables", "Map"], + "text": "Create a function that groups an array of strings by their anagrams using a hash map." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Hash Tables", "Chained Hash Tables", "BigO"], + "text": "Design a hash map that supports the following operations: insert, get, and remove. Each operation should run in average constant time." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Hash Tables", "Map"], + "text": "Write a function that finds all pairs of integers in an array that sum up to a specific target using a hash map." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Linked Structures", "List"], + "text": "Implement a singly linked list in your chosen programming language and include methods for adding, removing, and displaying elements." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Linked Structures", "List"], + "text": "Write a function that reverses a singly linked list." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Linked Structures", "List"], + "text": "Create a method that detects a cycle in a linked list and returns the node where the cycle begins." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Linked Structures", "List"], + "text": "Develop a function that merges two sorted linked lists into one sorted linked list." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Linked Structures", "List"], + "text": "Implement a doubly linked list and include methods for inserting and deleting nodes at both ends." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Arrays", "List"], + "text": "Write a function that takes an array of integers and returns a new array with all the even numbers removed." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Arrays", "List"], + "text": "Implement a function that takes an array of strings and returns the longest string. If there are multiple strings of the same longest length, return the first one." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Arrays", "List"], + "text": "Create a function that rotates an array to the right by a given number of steps. For example, rotating [1,2,3,4,5] by 2 steps results in [4,5,1,2,3]." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Arrays", "List"], + "text": "Write a function that merges two sorted arrays into a single sorted array without using additional space." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Arrays", "Set"], + "text": "Design a function that accepts an array of integers and returns a new array containing only the unique elements from the original array." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Chained Hash Tables", "Hash Tables"], + "text": "Implement a basic Chained Hash Table using an array of linked lists. Include methods for insertion, deletion, and searching." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Chained Hash Tables", "Theoretical"], + "text": "Explain the advantages of using chained hashing over open addressing in handling collisions." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Chained Hash Tables", "BigO"], + "text": "Write a function that returns the load factor of a chained hash table. Discuss how the load factor impacts the performance of the hash table." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Chained Hash Tables", "Theoretical"], + "text": "Create a function that expands a chained hash table when the load factor exceeds a certain threshold. Describe the process involved in rehashing the elements." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Chained Hash Tables", "Theoretical"], + "text": "Design a method to find the entry with the maximum number of collisions in your chained hash table implementation and explain why this might be significant." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Priority Queue"], + "text": "Implement a min-heap based priority queue with methods to insert an element, remove the minimum element, and get the minimum element." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Priority Queue", "BigO"], + "text": "Write a function that sorts an array of numbers using a priority queue. Describe the time complexity of your solution." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Priority Queue"], + "text": "Design a method that merges two priority queues into one, ensuring that the resulting priority queue maintains the correct order." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Priority Queue", "BigO"], + "text": "Create a function that returns the first k largest elements from a list using a priority queue. What is the complexity of your solution?" + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Priority Queue", "Theoretical"], + "text": "Develop a simulation of a hospital emergency room where patients are treated based on severity using a priority queue. How would you structure your queue?" + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["List"], + "text": "Write a function that takes a list of integers and returns a new list containing only the even numbers." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["List"], + "text": "Implement a function that takes a list of strings and returns the longest string in the list. If there are multiple longest strings, return any one of them." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["List"], + "text": "Create a function that merges two sorted lists into a single sorted list." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["List"], + "text": "Write a function that rotates a list to the right by a given number of steps." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["List", "Set"], + "text": "Design a function that removes all duplicates from a list and returns a new list with unique items." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Set"], + "text": "Write a function that takes two sets and returns a new set that is the union of both." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Set"], + "text": "Create a function that accepts two sets and returns a new set that is the intersection of both." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Set"], + "text": "Design a function that checks if a set is a subset of another set and returns a boolean value." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Set"], + "text": "Implement a function that takes a set of numbers and returns a new set containing only the even numbers." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Set"], + "text": "Write a function that generates the symmetric difference of two sets, returning the elements that are in either of the sets but not in both." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Stack"], + "text": "Implement a stack using an array and provide methods for push, pop, and peek." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Stack"], + "text": "Write a function that checks if a given string has balanced parentheses using a stack." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Stack", "BigO"], + "text": "Design a stack that supports the following operations: push, pop, top, and retrieving the minimum element in constant time." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Stack"], + "text": "Create a function that reverses a string using a stack." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["Stack"], + "text": "Implement a function that evaluates a postfix expression using a stack." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["List"], + "text": "Write a function that takes a list of integers and returns a new list containing only the even integers." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["List"], + "text": "Implement a function that merges two sorted lists into a single sorted list." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["List"], + "text": "Create a function that reverses a given list without using any built-in reverse functions." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["List", "Set"], + "text": "Write a function that removes duplicate elements from a list and returns a new list with unique elements." + }, + {"resourceTypes" : ["PRACTICE" ], + "conceptIds": ["List"], + "text": "Design a function that finds the longest consecutive subsequence in a list of integers." + } +] \ No newline at end of file diff --git a/src/main/resources/datastore/comp220-2024/graph.json b/src/main/resources/datastore/comp220-2024/graph.json index 101d1d8..857dab7 100644 --- a/src/main/resources/datastore/comp220-2024/graph.json +++ b/src/main/resources/datastore/comp220-2024/graph.json @@ -1,135 +1,99 @@ { - "name" : "COMP 220", - "concepts" : [ - {"id" : "Comparing Data Structures"}, - {"id" : "Interfaces"}, + "name": "COMP 220", + "concepts": [ + {"id": "ADT/Interfaces For Modularity"}, + {"id": "Common ADTs"}, + {"id": "List"}, + {"id": "Stack"}, + {"id": "Queue"}, + {"id": "Priority Queue"}, + {"id": "Set"}, + {"id": "Map"}, - {"id" : "Abstract Data Types"}, - {"id" : "Stack"}, - {"id" : "Queue"}, - {"id" : "List"}, - {"id" : "Object Oriented Programming"}, - - {"id" : "Data Structure Implementations"}, - {"id" : "Array"}, - {"id" : "Linked Nodes"}, - - {"id" : "Pointers"}, - {"id" : "Dangling Pointers"}, - {"id" : "Stack vs. Heap"}, - {"id" : "Memory Leak"}, - {"id" : "Pass by Pointer"}, - {"id" : "Deep vs. Shallow Copies"}, - {"id" : "Pass by Value"}, - {"id" : "Pass by Reference"}, - {"id" : "Copy Constructor, Destructor, Assignment Operator"}, - - {"id" : "Search"}, - {"id" : "Sort"}, - {"id" : "Recursion"}, - - {"id" : "Testing Time Efficiency"} + {"id": "Concrete Implementation Techniques/Tools"}, + {"id": "Hash Tables"}, + {"id": "Arrays"}, + {"id": "Linked Structures"}, + {"id": "Binary Trees"}, + {"id": "Chained Hash Tables"}, + {"id": "Runtime Efficiency Of Different Implementation Of Same ADT"}, + {"id": "BigO"}, + {"id": "Theoretical"}, + {"id": "Empirical"} ], - "links" : [ + + "links": [ { - "parent" : "Comparing Data Structures", - "child" : "Abstract Data Types" + "parent": "ADT/Interfaces For Modularity", + "child": "Common ADTs" }, { - "parent" : "Interfaces", - "child" : "Abstract Data Types" + "parent": "ADT/Interfaces For Modularity", + "child": "Concrete Implementation Techniques/Tools" }, { - "parent" : "Comparing Data Structures", - "child" : "Data Structure Implementations" + "parent": "ADT/Interfaces For Modularity", + "child": "Runtime Efficiency Of Different Implementation Of Same ADT" }, { - "parent" : "Abstract Data Types", - "child" : "Stack" + "parent": "Common ADTs", + "child": "List" }, { - "parent" : "Abstract Data Types", - "child" : "Queue" + "parent": "Common ADTs", + "child": "Stack" }, { - "parent" : "Abstract Data Types", - "child" : "List" - }, - - { - "parent" : "Data Structure Implementations", - "child" : "Array" + "parent": "Common ADTs", + "child": "Queue" }, { - "parent" : "Data Structure Implementations", - "child" : "Linked Nodes" + "parent": "Common ADTs", + "child": "Priority Queue" }, { - "parent" : "Array", - "child" : "Pointers" + "parent": "Common ADTs", + "child": "Set" }, { - "parent" : "Linked Nodes", - "child" : "Pointers" + "parent": "Common ADTs", + "child": "Map" }, { - "parent" : "Pointers", - "child" : "Dangling Pointers" + "parent": "Concrete Implementation Techniques/Tools", + "child": "Hash Tables" }, { - "parent" : "Pointers", - "child" : "Memory Leak" + "parent": "Concrete Implementation Techniques/Tools", + "child": "Arrays" }, { - "parent" : "Pointers", - "child" : "Pass by Pointer" + "parent": "Concrete Implementation Techniques/Tools", + "child": "Linked Structures" }, { - "parent" : "Stack vs. Heap", - "child" : "Pointers" - },{ - "parent" : "Pass by Reference", - "child" : "Stack vs. Heap" - },{ - "parent" : "Pass by Reference", - "child" : "Pointers" - },{ - "parent" : "Deep vs. Shallow Copies", - "child" : "Pass by Value" - },{ - "parent" : "Deep vs. Shallow Copies", - "child" : "Pass by Reference" - },{ - "parent" : "Deep vs. Shallow Copies", - "child" : "Stack vs. Heap" - },{ - "parent" : "Copy Constructor, Destructor, Assignment Operator", - "child" : "Deep vs. Shallow Copies" - },{ - "parent" : "Object Oriented Programming", - "child" : "Copy Constructor, Destructor, Assignment Operator" - },{ - "parent" : "Abstract Data Types", - "child" : "Object Oriented Programming" + "parent": "Concrete Implementation Techniques/Tools", + "child": "Binary Trees" }, { - "parent" : "Comparing Data Structures", - "child" : "Testing Time Efficiency" - }, { - "parent" : "Search", - "child" : "Testing Time Efficiency" - }, { - "parent" : "Sort", - "child" : "Testing Time Efficiency" - }, { - "parent" : "Search", - "child" : "Recursion" - }, { - "parent" : "Sort", - "child" : "Recursion" - }, { - "parent" : "Search", - "child" : "Array" + "parent": "Hash Tables", + "child": "Chained Hash Tables" + }, + + { + "parent": "Linked Structures", + "child": "Chained Hash Tables" + }, + + { + "parent": "Linked Structures", + "child": "Binary Trees" + }, + + { + "parent": "Runtime Efficiency Of Different Implementation Of Same ADT", + "child": "BigO" }, { - "parent" : "Sort", - "child" : "Array" + "parent": "Runtime Efficiency Of Different Implementation Of Same ADT", + "child": "Theoretical" }, { - "parent" : "Linked Nodes", - "child" : "Recursion" - } ] + "parent": "Runtime Efficiency Of Different Implementation Of Same ADT", + "child": "Empirical" + } + ] } \ No newline at end of file diff --git a/src/main/resources/datastore/comp220-2024/learningMaterials.json b/src/main/resources/datastore/comp220-2024/learningResources.json similarity index 64% rename from src/main/resources/datastore/comp220-2024/learningMaterials.json rename to src/main/resources/datastore/comp220-2024/learningResources.json index a37bf0f..29ce6ed 100644 --- a/src/main/resources/datastore/comp220-2024/learningMaterials.json +++ b/src/main/resources/datastore/comp220-2024/learningResources.json @@ -1,43 +1,43 @@ [ { - "learningResourceId" : "Q1", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "List", "Arrays"], "dataImportance" : 0.0, - "maxPossibleKnowledgeEstimate" : 10.0 + "maxPossibleKnowledgeEstimate" : 10.0, + "text" : "Q1" }, { - "learningResourceId" : "Q2", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "Stack", "Queue", "List"], "dataImportance" : 0.0, - "maxPossibleKnowledgeEstimate" : 10.0 + "maxPossibleKnowledgeEstimate" : 10.0, + "text" : "Q2" }, { - "learningResourceId" : "Q3", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "Map"], "dataImportance" : 0.0, - "maxPossibleKnowledgeEstimate" : 5.0 + "maxPossibleKnowledgeEstimate" : 5.0, + "text" : "Q3" }, { - "learningResourceId" : "Q4", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "Binary Trees"], "dataImportance" : 0.0, - "maxPossibleKnowledgeEstimate" : 5.0 + "maxPossibleKnowledgeEstimate" : 5.0, + "text" : "Q4" }, { - "learningResourceId" : "Q5", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "BigO", "Theoretical", "Empirical"], "dataImportance" : 0.0, - "maxPossibleKnowledgeEstimate" : 100.0 + "maxPossibleKnowledgeEstimate" : 100.0, + "text" : "Q5" } , { - "learningResourceId" : "Q6", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "BigO", "Binary Trees", "Chained Hash Tables"], "dataImportance" : 0.0, - "maxPossibleKnowledgeEstimate" : 50.0 + "maxPossibleKnowledgeEstimate" : 50.0, + "text" : "Q6" }, { - "learningResourceId" : "Q7", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "Concrete Implementation Techniques/Tools"], "dataImportance" : 0.0, - "maxPossibleKnowledgeEstimate" : 100.0 + "maxPossibleKnowledgeEstimate" : 100.0, + "text" : "Q7" }] diff --git a/src/main/resources/datastore/comp220Dragon-2017/comp220Resources-courseWork.json b/src/main/resources/datastore/comp220Dragon-2017/comp220Resources-courseWork.json index bb41b45..5b825d6 100644 --- a/src/main/resources/datastore/comp220Dragon-2017/comp220Resources-courseWork.json +++ b/src/main/resources/datastore/comp220Dragon-2017/comp220Resources-courseWork.json @@ -1,69 +1,69 @@ [ { - "learningResourceId" : "Lab 1: Guess the Pattern", + "text": "Lab 1: Guess the Pattern", "conceptIds" : [".h and .cpp Files", "Interfaces"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab 2: Array Library", + "text": "Lab 2: Array Library", "conceptIds" : [ "Arrays", "Pass by Pointer", ".h and .cpp Files", "Interfaces", "Linear Search"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab 3: Comparing Array Library Efficiency", + "text": "Lab 3: Comparing Array Library Efficiency", "conceptIds" : ["Timing Efficiency", "Comparing Algorithms", "Pointers", "Pass by Pointer" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab 4: Recursion", + "text": "Lab 4: Recursion", "conceptIds" : ["Recursion", "const" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab 5: Comparing Searches", + "text": "Lab 5: Comparing Searches", "conceptIds" : ["Comparing Algorithms", "Bubble, Selection, Insert Sort", "Linear Search", "Binary Search", "Timing Efficiency" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab 6: ArrayList and Testing", + "text": "Lab 6: ArrayList and Testing", "conceptIds" : ["Object Oriented Programming in C++", "Destructor", "Pass by Reference", "Default Constructor, Copy Constructor, Assignment Operator", "Unit Testing"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab 7: Linked List", + "text": "Lab 7: Linked List", "conceptIds" : ["Linked Nodes", "Default Constructor, Copy Constructor, Assignment Operator", "Destructor" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Lab 8: Comparing Arrays and Linked Lists", + "text": "Lab 8: Comparing Arrays and Linked Lists", "conceptIds" : ["Lists", "Abstract Data Types", "Comparing Data Structures", "Arrays", "Linked Nodes", "Interfaces" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Overall Project Score", + "text": "Overall Project Score", "conceptIds" : [ ], "dataImportance" : 0.1 }, { - "learningResourceId" : "Day 03 Reading - C++ intro and pointers", + "text": "Day 03 Reading - C++ intro and pointers", "conceptIds" : ["Pointers" ], "dataImportance" : 0.1 }, { - "learningResourceId" : "Day 02 Reading - C++ Intro", + "text": "Day 02 Reading - C++ Intro", "conceptIds" : [ ".h and .cpp Files" ], "dataImportance" : 0.1 }, { - "learningResourceId" : "Day 06 Reading - Pointers, Arrays, and Dynamic Memory", + "text": "Day 06 Reading - Pointers, Arrays, and Dynamic Memory", "conceptIds" : [ "Pointers", "Arrays", "Memory Management"], "dataImportance" : 0.1 }, { - "learningResourceId" : "Day 09 Reading - Ponters and const", + "text": "Day 09 Reading - Ponters and const", "conceptIds" : [ "Pointers", "const"], "dataImportance" : 0.1 }, { - "learningResourceId" : "Day 10 Reading - Recursion", + "text": "Day 10 Reading - Recursion", "conceptIds" : [ "Recursion"], "dataImportance" : 0.1 }, { - "learningResourceId" : "Day 15 Reading - Big-O Notation", + "text": "Day 15 Reading - Big-O Notation", "conceptIds" : [ "Big-O Notation"], "dataImportance" : 0.1 }, { - "learningResourceId" : "Day 17 Reading - OOP in C++", + "text": "Day 17 Reading - OOP in C++", "conceptIds" : [ "Object Oriented Programming in C++"], "dataImportance" : 0.1 }, { - "learningResourceId" : "Day 27 Reading - Copying Objects", + "text": "Day 27 Reading - Copying Objects", "conceptIds" : ["Object Memory Management: Deep vs. Shallow Copies", "Default Constructor, Copy Constructor, Assignment Operator", "Destructor" ], "dataImportance" : 0.1 } ] \ No newline at end of file diff --git a/src/main/resources/datastore/comp220Dragon-2017/comp220Resources-e1.json b/src/main/resources/datastore/comp220Dragon-2017/comp220Resources-e1.json index e5caae5..a278144 100644 --- a/src/main/resources/datastore/comp220Dragon-2017/comp220Resources-e1.json +++ b/src/main/resources/datastore/comp220Dragon-2017/comp220Resources-e1.json @@ -1,49 +1,49 @@ [ { - "learningResourceId" : "1", + "text": "1", "conceptIds" : ["Interfaces", ".h and .cpp Files" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "2", + "text": "2", "conceptIds" : ["Arrays", "Comparing Data Structures" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "3", + "text": "3", "conceptIds" : ["const", "Pointers" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "4", + "text": "4", "conceptIds" : ["Memory Leaks", "Dangling Pointers" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "5", + "text": "5", "conceptIds" : ["Comparing Algorithms", "Binary Search", "Linear Search" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "6", + "text": "6", "conceptIds" : ["Big-O Notation" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "7", + "text": "7", "conceptIds" : [ "Memory Diagrams"], "dataImportance" : 1.0 }, { - "learningResourceId" : "7-HG", + "text": "7-HG", "conceptIds" : ["Arrays", "Linear Search", "Pointers"], "dataImportance" : 1.0 }, { - "learningResourceId" : "7-AG", + "text": "7-AG", "conceptIds" : ["Recursion", "Arrays" ], "dataImportance" : 2.0 }, { - "learningResourceId" : "7-SG", + "text": "7-SG", "conceptIds" : ["Bubble, Selection, Insert Sort", "Arrays" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "8", + "text": "8", "conceptIds" : [ "Comparing Algorithms", "Big-O Notation"], "dataImportance" : 2.0 }, { - "learningResourceId" : "9", + "text": "9", "conceptIds" : ["Object Oriented Programming in C++", "Destructor" ], "dataImportance" : 1.0 } ] \ No newline at end of file diff --git a/src/main/resources/datastore/comp220Dragon-2017/comp220Resources-e2.json b/src/main/resources/datastore/comp220Dragon-2017/comp220Resources-e2.json index 7701f2e..b2d6948 100644 --- a/src/main/resources/datastore/comp220Dragon-2017/comp220Resources-e2.json +++ b/src/main/resources/datastore/comp220Dragon-2017/comp220Resources-e2.json @@ -1,57 +1,57 @@ [ { - "learningResourceId" : "e2-1", + "text": "e2-1", "conceptIds" : [ "Abstract Data Types", "Abstract Classes and Inheritance"], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-2", + "text": "e2-2", "conceptIds" : ["Pass by Reference", "Pass by Pointer" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-3", + "text": "e2-3", "conceptIds" : ["Object Memory Management: Deep vs. Shallow Copies", "Destructor", "Default Constructor, Copy Constructor, Assignment Operator" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-4", + "text": "e2-4", "conceptIds" : ["Comparing Data Structures", "Arrays", "Linked Nodes" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-5", + "text": "e2-5", "conceptIds" : [], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-6", + "text": "e2-6", "conceptIds" : [ "Stacks and Queues", "Comparing Data Structures", "Arrays", "Linked Nodes" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-Trace", + "text": "e2-Trace", "conceptIds" : ["Memory Diagrams" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-C-3", + "text": "e2-C-3", "conceptIds" : ["Destructor" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-C-4", + "text": "e2-C-4", "conceptIds" : ["Linked Nodes", "Object Oriented Programming in C++" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-CA-1", + "text": "e2-CA-1", "conceptIds" : [ "Object Oriented Programming in C++", "Pointers"], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-CA-2", + "text": "e2-CA-2", "conceptIds" : [ "Object Oriented Programming in C++", "Arrays"], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-CA-3", + "text": "e2-CA-3", "conceptIds" : [ "Object Oriented Programming in C++", "Arrays"], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-CA-4", + "text": "e2-CA-4", "conceptIds" : ["Big-O Notation", "Comparing Algorithms" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "e2-CA-5", + "text": "e2-CA-5", "conceptIds" : ["Object Memory Management: Deep vs. Shallow Copies", "Default Constructor, Copy Constructor, Assignment Operator" ], "dataImportance" : 1.0 } ] \ No newline at end of file diff --git a/src/main/resources/datastore/comp220Dragon-2017/comp220Resources-finalExam.json b/src/main/resources/datastore/comp220Dragon-2017/comp220Resources-finalExam.json index eb69e38..82b33b3 100644 --- a/src/main/resources/datastore/comp220Dragon-2017/comp220Resources-finalExam.json +++ b/src/main/resources/datastore/comp220Dragon-2017/comp220Resources-finalExam.json @@ -1,77 +1,77 @@ [ { - "learningResourceId" : "final-1", + "text": "final-1", "conceptIds" : ["Pass by Value", "Object Memory Management: Deep vs. Shallow Copies" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-2", + "text": "final-2", "conceptIds" : [ "Dangling Pointers"], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-3", + "text": "final-3", "conceptIds" : [ "Memory Leaks", "Object Oriented Programming in C++", "Destructor"], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-4", + "text": "final-4", "conceptIds" : [ "Recursion"], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-5", + "text": "final-5", "conceptIds" : [ "Comparing Data Structures", "Linked Nodes", "Arrays"], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-6", + "text": "final-6", "conceptIds" : [ "Comparing Algorithms", "Merge Sort", "Bubble, Selection, Insert Sort", "Big-O Notation"], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-Trace", + "text": "final-Trace", "conceptIds" : [ "Memory Diagrams", "Recursion"], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-8", + "text": "final-8", "conceptIds" : ["Linked Nodes" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-9", + "text": "final-9", "conceptIds" : [ "Stacks and Queues"], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-10", + "text": "final-10", "conceptIds" : [ "Default Constructor, Copy Constructor, Assignment Operator"], "dataImportance" : 1.0 }, { - "learningResourceId" : "final-11", + "text": "final-11", "conceptIds" : ["Default Constructor, Copy Constructor, Assignment Operator", "Object Memory Management: Deep vs. Shallow Copies" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Tree-1", + "text": "Tree-1", "conceptIds" : ["Trees" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Tree-2-a", + "text": "Tree-2-a", "conceptIds" : ["Trees" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Tree-2-b", + "text": "Tree-2-b", "conceptIds" : ["Trees"], "dataImportance" : 1.0 }, { - "learningResourceId" : "Tree-2-c", + "text": "Tree-2-c", "conceptIds" : ["Trees", "Timing Efficiency" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Tree-code-1", + "text": "Tree-code-1", "conceptIds" : ["Trees", "Recursion" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Tree-code-1-1", + "text": "Tree-code-1-1", "conceptIds" : ["Trees", "Big-O Notation", "Timing Efficiency" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "tree-code-2", + "text": "tree-code-2", "conceptIds" : ["Trees", "Recursion" ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Tree-code-2-2", + "text": "Tree-code-2-2", "conceptIds" : ["Trees", "Big-O Notation", "Timing Efficiency" ], "dataImportance" : 1.0 } ] \ No newline at end of file diff --git a/src/main/resources/datastore/comp220Dragon-2018/comp220Dragon-2018Resources.json b/src/main/resources/datastore/comp220Dragon-2018/comp220Dragon-2018Resources.json index 813d2df..6dbcec8 100644 --- a/src/main/resources/datastore/comp220Dragon-2018/comp220Dragon-2018Resources.json +++ b/src/main/resources/datastore/comp220Dragon-2018/comp220Dragon-2018Resources.json @@ -1,215 +1,215 @@ [ { - "learningResourceId" : "exam1-1", + "text" : "exam1-1", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 4.0 }, { - "learningResourceId" : "exam1-2", + "text" : "exam1-2", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 6.0 }, { - "learningResourceId" : "exam1-3", + "text" : "exam1-3", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 4.0 }, { - "learningResourceId" : "exam1-4", + "text" : "exam1-4", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 4.0 }, { - "learningResourceId" : "exam1-5", + "text" : "exam1-5", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 4.0 }, { - "learningResourceId" : "exam1-6", + "text" : "exam1-6", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 4.0 }, { - "learningResourceId" : "exam1-7", + "text" : "exam1-7", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 4.0 }, { - "learningResourceId" : "exam1-8-trace", + "text" : "exam1-8-trace", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 12.0 }, { - "learningResourceId" : "exam1-8-traceComment", + "text" : "exam1-8-traceComment", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 3.0 }, { - "learningResourceId" : "exam1-8-traceRec", + "text" : "exam1-8-traceRec", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 2.0 }, { - "learningResourceId" : "exam1-8-traceMem", + "text" : "exam1-8-traceMem", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 2.0 }, { - "learningResourceId" : "exam1-8a", + "text" : "exam1-8a", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 7.0 }, { - "learningResourceId" : "exam1-8b", + "text" : "exam1-8b", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 9.0 }, { - "learningResourceId" : "exam1-8c", + "text" : "exam1-8c", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 9.0 }, { - "learningResourceId" : "exam1-8d", + "text" : "exam1-8d", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 9.0 }, { - "learningResourceId" : "exam1-9a", + "text" : "exam1-9a", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 4.0 }, { - "learningResourceId" : "exam1-9b", + "text" : "exam1-9b", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 3.0 }, { - "learningResourceId" : "CLion - IDE Setup", + "text" : "CLion - IDE Setup", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Day 01 Reading - C++ Intro", + "text" : "Day 01 Reading - C++ Intro", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 8.0 }, { - "learningResourceId" : "Day 03 Reading - Pointers and Arrays", + "text" : "Day 03 Reading - Pointers and Arrays", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 6.0 }, { - "learningResourceId" : "Day 04 Reading - Dynamic Memory (the heap)", + "text" : "Day 04 Reading - Dynamic Memory (the heap)", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 7.0 }, { - "learningResourceId" : "Day 06 Practice - Trace", + "text" : "Day 06 Practice - Trace", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Lab 1: Interfaces and Testing", + "text" : "Lab 1: Interfaces and Testing", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Day 05 Reading - const", + "text" : "Day 05 Reading - const", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 3.0 }, { - "learningResourceId" : "Lab 2: Array Library", + "text": "Lab 2: Array Library", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Day 09 Reading - Recursion", + "text": "Day 09 Reading - Recursion", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 7.0 }, { - "learningResourceId" : "Lab 3: Testing Array Efficiency", + "text": "Lab 3: Testing Array Efficiency", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Day 12 Reading - Big O", + "text": "Day 12 Reading - Big O", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 4.0 }, { - "learningResourceId" : "Day 13 Reading - Parameter Passing", + "text": "Day 13 Reading - Parameter Passing", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 8.0 }, { - "learningResourceId" : "Lab 4: Recursive Array Library", + "text": "Lab 4: Recursive Array Library", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Exam 1", + "text": "Exam 1", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 90.0 }, { - "learningResourceId" : "Day 18 Reading - Classes in C++", + "text": "Day 18 Reading - Classes in C++", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Day 19 Reading - Deep vs. Shallow Copies", + "text": "Day 19 Reading - Deep vs. Shallow Copies", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 6.0 }, { - "learningResourceId" : "Lab 06: ArrayList", + "text": "Lab 06: ArrayList", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Lab 07: Linked Stacks and Queues", + "text": "Lab 07: Linked Stacks and Queues", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Lab 08: The List ADT and LinkedList implementation", + "text": "Lab 08: The List ADT and LinkedList implementation", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, diff --git a/src/main/resources/static/js/CheckboxMatrixFunctions.js b/src/main/resources/static/js/CheckboxMatrixFunctions.js index bdd2530..269e3b9 100644 --- a/src/main/resources/static/js/CheckboxMatrixFunctions.js +++ b/src/main/resources/static/js/CheckboxMatrixFunctions.js @@ -1,11 +1,11 @@ 'use strict'; -function updateResourceRecords(resourceRecords, resourceId, conceptId) { +function updateResourceRecords(resourceRecords, resourceText, conceptId) { var toChange, i = 0; for (i = 0; i < resourceRecords.length; i += 1) { - if (resourceRecords[i].learningResourceId === resourceId) { + if (resourceRecords[i].learningResourceId === resourceText) { toChange = resourceRecords[i].conceptIds; if (toChange.includes(conceptId)) { toChange.pop(conceptId); diff --git a/src/main/resources/static/js/ConnectResources.js b/src/main/resources/static/js/ConnectResources.js index 2f8554a..f2f0587 100644 --- a/src/main/resources/static/js/ConnectResources.js +++ b/src/main/resources/static/js/ConnectResources.js @@ -14,12 +14,12 @@ function goHome() { } //linked to the addResource button in the html page -function addResource(newResourceId, maxKnowledgeEstimate) { - if (newResourceId === "" || newResourceId === "New Resource ID") { - window.alert("No Resource ID to Add"); +function addResource(newResourceText, maxKnowledgeEstimate) { + if (newResourceText === "" || newResourceText === "New Resource Text") { + window.alert("No Resource Text to Add"); } else { //defined in CheckboxMatrixFunctions.js with other resourceRecords functions - addResourceToRecords(resourceRecords, newResourceId, maxKnowledgeEstimate); + addResourceToRecords(resourceRecords, newResourceText, maxKnowledgeEstimate); //defined in Comm.js submitToAPI("/api/connectResources/" + courseId, resourceRecords); } diff --git a/src/main/resources/templates/ConnectResources.html b/src/main/resources/templates/ConnectResources.html index c3ade36..e951ce4 100644 --- a/src/main/resources/templates/ConnectResources.html +++ b/src/main/resources/templates/ConnectResources.html @@ -20,9 +20,9 @@

Connect Resources to Concepts

- - + + diff --git a/src/test/java/edu/ithaca/dragon/tecmap/comp220Testing/Comp220Testing.java b/src/test/java/edu/ithaca/dragon/tecmap/comp220Testing/Comp220Testing.java index 59db4bf..81c92f2 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/comp220Testing/Comp220Testing.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/comp220Testing/Comp220Testing.java @@ -1,11 +1,11 @@ package edu.ithaca.dragon.tecmap.comp220Testing; +import com.opencsv.exceptions.CsvException; import edu.ithaca.dragon.tecmap.Settings; import edu.ithaca.dragon.tecmap.conceptgraph.CohortConceptGraphs; import edu.ithaca.dragon.tecmap.conceptgraph.ConceptGraph; import edu.ithaca.dragon.tecmap.conceptgraph.ConceptNode; -import edu.ithaca.dragon.tecmap.io.reader.SakaiReader; -import edu.ithaca.dragon.tecmap.io.reader.TecmapCSVReader; +import edu.ithaca.dragon.tecmap.io.reader.*; import edu.ithaca.dragon.tecmap.io.record.ConceptGraphRecord; import edu.ithaca.dragon.tecmap.io.record.LearningResourceRecord; import edu.ithaca.dragon.tecmap.learningresource.AssessmentItemResponse; @@ -16,6 +16,7 @@ import org.junit.jupiter.api.Test; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -28,14 +29,17 @@ public class Comp220Testing { private CohortConceptGraphs cohortConceptGraphs; @BeforeEach - public void setup() throws IOException { + public void setup() throws IOException, CsvException { //create the graph structure to be copied for each user ConceptGraphRecord structureRecord = ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "comp220_Summer2024/graph.json"); List linkRecord = LearningResourceRecord.createLearningResourceRecordsFromJsonFile(Settings.TEST_RESOURCE_DIR + "comp220_Summer2024/learningResources.json"); ConceptGraph graph = new ConceptGraph(structureRecord, linkRecord); //create the data to be used to create and populate the graph copies - TecmapCSVReader tecmapCsvReader = new SakaiReader(Settings.TEST_RESOURCE_DIR + "comp220_Summer2024/assessmentGrades.csv"); + List rows = CsvFileLibrary.parseRowsFromFile(Settings.TEST_RESOURCE_DIR + "comp220_Summer2024/assessmentGrades.csv"); + List processors = new ArrayList<>(); + processors.add(new CanvasConverter()); + TecmapCSVReader tecmapCsvReader = new CanvasReader(rows, processors); List assessments = tecmapCsvReader.getManualGradedResponses(); //create the average and individual graphs diff --git a/src/test/java/edu/ithaca/dragon/tecmap/conceptgraph/CohortConceptGraphsTest.java b/src/test/java/edu/ithaca/dragon/tecmap/conceptgraph/CohortConceptGraphsTest.java index 529a8b2..5519126 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/conceptgraph/CohortConceptGraphsTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/conceptgraph/CohortConceptGraphsTest.java @@ -1,6 +1,9 @@ package edu.ithaca.dragon.tecmap.conceptgraph; +import com.opencsv.exceptions.CsvException; import edu.ithaca.dragon.tecmap.Settings; +import edu.ithaca.dragon.tecmap.io.reader.CsvFileLibrary; +import edu.ithaca.dragon.tecmap.io.reader.CsvProcessor; import edu.ithaca.dragon.tecmap.io.reader.TecmapCSVReader; import edu.ithaca.dragon.tecmap.io.reader.SakaiReader; import edu.ithaca.dragon.tecmap.io.record.CohortConceptGraphsRecord; @@ -17,10 +20,7 @@ import org.junit.jupiter.api.Test; import java.io.IOException; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Map; +import java.util.*; import static org.junit.jupiter.api.Assertions.*; @@ -145,7 +145,10 @@ private void matchingIdsForTreeCopies(ConceptGraph orig, ConceptGraphRecord tree @Test public void buildCohortConceptTreeRecordComplexTest() { try{ - TecmapCSVReader tecmapCsvReader = new SakaiReader(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); + List rows = CsvFileLibrary.parseRowsFromFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); + List processors = new ArrayList<>(); + TecmapCSVReader tecmapCsvReader = new SakaiReader(rows, processors); + ConceptGraph structure = new ConceptGraph(ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticConceptGraph.json"), LearningResourceRecord.createLearningResourceRecordsFromJsonFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticResource.json" )); CohortConceptGraphs group = new CohortConceptGraphs(structure, tecmapCsvReader.getManualGradedResponses()); @@ -153,7 +156,7 @@ public void buildCohortConceptTreeRecordComplexTest() { CohortConceptGraphsRecord record = group.buildCohortConceptTreeRecord(); matchingIdsForTreeCopies(group.getAvgGraph(), record.getGraphRecords().get(0)); - } catch (IOException e) { + } catch (IOException | CsvException e) { e.printStackTrace(); fail(); } @@ -166,7 +169,10 @@ public void buildCohortConceptTreeRecordComplexTest() { @Test public void onlyOneLearningObject(){ try { - TecmapCSVReader tecmapCsvReader = new SakaiReader(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); + List rows = CsvFileLibrary.parseRowsFromFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); + List processors = new ArrayList<>(); + TecmapCSVReader tecmapCsvReader = new SakaiReader(rows, processors); + ConceptGraph graph = new ConceptGraph(ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticConceptGraph.json"), LearningResourceRecord.createLearningResourceRecordsFromJsonFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticResource.json")); CohortConceptGraphs gcg = new CohortConceptGraphs(graph, tecmapCsvReader.getManualGradedResponses()); @@ -185,7 +191,9 @@ public void onlyOneLearningObject(){ @Test public void calcKnowledgeEstimateSameInCohortAndConceptGraphsTest(){ try { - TecmapCSVReader tecmapCsvReader = new SakaiReader(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); + List rows = CsvFileLibrary.parseRowsFromFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); + List processors = new ArrayList<>(); + TecmapCSVReader tecmapCsvReader = new SakaiReader(rows, processors); ConceptGraph singleGraph = new ConceptGraph(ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticConceptGraph.json"), LearningResourceRecord.createLearningResourceRecordsFromJsonFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticResource.json"), @@ -210,7 +218,7 @@ public void calcKnowledgeEstimateSameInCohortAndConceptGraphsTest(){ } @Test - public void calcTotalKnowledgeEstimateTest() throws IOException { + public void calcTotalKnowledgeEstimateTest() throws IOException, CsvException { ConceptGraph graph = new ConceptGraph(ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/simpleConceptGraphTest.json")); List assessmentItemResponses = AssessmentItemResponse.createAssessmentItemResponses(Arrays.asList(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/simpleAssessmentTest.csv")); List links = LearningResourceRecord.createLearningResourceRecordsFromJsonFiles(Arrays.asList(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/simpleResourceTest.json")); @@ -237,7 +245,7 @@ public void calcTotalKnowledgeEstimateTest() throws IOException { @Test - public void calcTotalKnowledgeEstimate2() throws IOException { + public void calcTotalKnowledgeEstimate2() throws IOException, CsvException { ConceptGraph graph = new ConceptGraph(ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/researchConceptGraph.json")); List assessmentItemResponses = AssessmentItemResponse.createAssessmentItemResponses(Arrays.asList(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/researchAssessment1.csv")); List links = LearningResourceRecord.createLearningResourceRecordsFromJsonFiles(Arrays.asList(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/researchResource1.json")); diff --git a/src/test/java/edu/ithaca/dragon/tecmap/conceptgraph/ConceptGraphTest.java b/src/test/java/edu/ithaca/dragon/tecmap/conceptgraph/ConceptGraphTest.java index 8f8a271..3cc2717 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/conceptgraph/ConceptGraphTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/conceptgraph/ConceptGraphTest.java @@ -143,8 +143,8 @@ public void linkLearningObjectsTest(){ //TODO: Did this line matter, because it can't work like that anymore... //graph.addLearningObjects(ExampleLearningObjectLinkRecordFactory.makeSimpleLearningObjectDef()); - AssessmentItem duplicateObject = new AssessmentItem("Q1"); - AssessmentItemResponse duplicateResponse = new AssessmentItemResponse("user1","Q1",1); + AssessmentItem duplicateObject = new AssessmentItem(LearningResourceRecord.generateUniqueID(null),"Q1"); + AssessmentItemResponse duplicateResponse = new AssessmentItemResponse("user1","_PracticeProblem1","Q1",1); // Tries to add Q1 but it already exists so it does not get added and returns false duplicateObject.addResponse(duplicateResponse); @@ -155,8 +155,8 @@ public void linkLearningObjectsTest(){ // New question to be linked in to the existing graph - AssessmentItem myObject = new AssessmentItem("Q7"); - AssessmentItemResponse myResponse = new AssessmentItemResponse("user1","Q7",1); + AssessmentItem myObject = new AssessmentItem("_PracticeProblem7","Q7"); + AssessmentItemResponse myResponse = new AssessmentItemResponse("user1","_PracticeProblem7","Q7",1); concepts.add("D"); myObject.addResponse(myResponse); @@ -167,12 +167,12 @@ public void linkLearningObjectsTest(){ // all info is correct assertEquals(myObject, graph.findNodeById("B").getAssessmentItemMap().get("Q7")); assertEquals(myObject.getResponses().size(),graph.findNodeById("B").getAssessmentItemMap().get("Q7").getResponses().size()); - assertEquals("Q7",graph.findNodeById("B").getAssessmentItemMap().get("Q7").getId()); + assertEquals("Q7",graph.findNodeById("B").getAssessmentItemMap().get("Q7").getText()); assertEquals("user1",graph.findNodeById("B").getAssessmentItemMap().get("Q7").getResponses().get(0).getUserId()); assertEquals(3,graph.findNodeById("B").getAssessmentItemMap().size()); // If adding learning object to multiple different Concepts, it points to the same learning object - assertEquals(true, graph.findNodeById("B").getAssessmentItemMap().get("Q7") == graph.findNodeById("C").getAssessmentItemMap().get("Q7")); - assertEquals("Q7",graph.getAssessmentItemMap().get("Q7").getId()); + assertSame(graph.findNodeById("B").getAssessmentItemMap().get("Q7"), graph.findNodeById("C").getAssessmentItemMap().get("Q7")); + assertEquals("Q7",graph.getAssessmentItemMap().get("Q7").getText()); // Makes sure the new question was only added once to Learning Object map (previously had 6 questions, now 7) assertEquals(7,graph.getAssessmentItemMap().size()); } @@ -184,8 +184,8 @@ public void addLearningObjectsFromLearningObjectLinkRecordsTest(){ List responses = new ArrayList<>(); - responses.add( new AssessmentItemResponse("user1","Q1",1)); - responses.add( new AssessmentItemResponse("user1","Q7",1)); + responses.add( new AssessmentItemResponse("user1","_PracticeProblem1","Q1",1)); + responses.add( new AssessmentItemResponse("user1","_PracticeProblem7","Q7",1)); //Creating learningObjectLinkedRecord list List learningObjectLinkRecords = new ArrayList<>(); @@ -193,7 +193,7 @@ public void addLearningObjectsFromLearningObjectLinkRecordsTest(){ List concepts = new ArrayList<>(); concepts.add("B"); concepts.add("C"); - LearningResourceRecord question7Record = new LearningResourceRecord("Q7", Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE),concepts, 1, 1); + LearningResourceRecord question7Record = new LearningResourceRecord(Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE),concepts, 1, 1, "Q7"); learningObjectLinkRecords.add(question7Record); graph.addLearningResourcesFromRecords(learningObjectLinkRecords); @@ -201,12 +201,12 @@ public void addLearningObjectsFromLearningObjectLinkRecordsTest(){ // all info is correct assertEquals(1,graph.findNodeById("B").getAssessmentItemMap().get("Q7").getResponses().size()); - assertEquals("Q7",graph.findNodeById("B").getAssessmentItemMap().get("Q7").getId()); + assertEquals("Q7",graph.findNodeById("B").getAssessmentItemMap().get("Q7").getText()); assertEquals("user1",graph.findNodeById("B").getAssessmentItemMap().get("Q7").getResponses().get(0).getUserId()); assertEquals(3,graph.findNodeById("B").getAssessmentItemMap().size()); // If adding learning object to multiple different Concepts, it points to the same learning object - assertEquals(true, graph.findNodeById("B").getAssessmentItemMap().get("Q7") == graph.findNodeById("C").getAssessmentItemMap().get("Q7")); - assertEquals("Q7",graph.getAssessmentItemMap().get("Q7").getId()); + assertSame(graph.findNodeById("B").getAssessmentItemMap().get("Q7"), graph.findNodeById("C").getAssessmentItemMap().get("Q7")); + assertEquals("Q7",graph.getAssessmentItemMap().get("Q7").getText()); // Makes sure the new question was only added once to Learning Object map (previously had 6 questions, now 7) assertEquals(7,graph.getAssessmentItemMap().size()); } @@ -331,7 +331,7 @@ public void getNodesWithAssessmentId() throws IOException { ConceptGraph conceptGraph = new ConceptGraph(ConceptGraphRecord.buildFromJson(Settings.DEFAULT_TEST_DATASTORE_PATH + "Cs1Example/Cs1ExampleGraph.json"), loRecords); - List nodesWithQ4 = conceptGraph.getNodesWithAssessmentId("Q4"); + List nodesWithQ4 = conceptGraph.getNodesWithAssessmentText("Q4"); assertEquals(1, nodesWithQ4.size()); assertEquals("Loops", nodesWithQ4.get(0).getID()); } @@ -342,7 +342,7 @@ public void getAssessmentsBelowNode() throws IOException { ConceptGraph conceptGraph = new ConceptGraph(ConceptGraphRecord.buildFromJson(Settings.DEFAULT_TEST_DATASTORE_PATH + "Cs1Example/Cs1ExampleGraph.json"), loRecords); - List nodesWithQ4 = conceptGraph.getNodesWithAssessmentId("Q4"); + List nodesWithQ4 = conceptGraph.getNodesWithAssessmentText("Q4"); //Test 0 steps down Set assessmentsXBelowQ4 = conceptGraph.getAssessmentsBelowNode(new HashSet<>(), nodesWithQ4.get(0), 0); assertEquals(0, assessmentsXBelowQ4.size()); diff --git a/src/test/java/edu/ithaca/dragon/tecmap/conceptgraph/ExampleConceptGraphFactory.java b/src/test/java/edu/ithaca/dragon/tecmap/conceptgraph/ExampleConceptGraphFactory.java index c912cf0..77c9928 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/conceptgraph/ExampleConceptGraphFactory.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/conceptgraph/ExampleConceptGraphFactory.java @@ -3,13 +3,13 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import edu.ithaca.dragon.tecmap.Settings; -import edu.ithaca.dragon.tecmap.io.reader.TecmapCSVReader; -import edu.ithaca.dragon.tecmap.io.reader.SakaiReader; +import edu.ithaca.dragon.tecmap.io.reader.*; import edu.ithaca.dragon.tecmap.io.record.ConceptGraphRecord; import edu.ithaca.dragon.tecmap.io.record.LearningResourceRecord; import edu.ithaca.dragon.tecmap.learningresource.ExampleLearningObjectLinkRecordFactory; import edu.ithaca.dragon.tecmap.learningresource.ExampleLearningObjectResponseFactory; +import java.util.ArrayList; import java.util.List; /** @@ -106,13 +106,15 @@ public static ConceptGraph makeSuperComplex(){ public static ConceptGraph willExampleConceptGraphTestOneStudent() { try{ - TecmapCSVReader tecmapCsvReader = new SakaiReader(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); - ConceptGraphRecord graphRecord = ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticConceptGraph.json"); - List LOLRlist = LearningResourceRecord.createLearningResourceRecordsFromJsonFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticResource.json"); + List rows = CsvFileLibrary.parseRowsFromFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); + List processors = new ArrayList<>(); + processors.add(new CanvasConverter()); + TecmapCSVReader tecmapCsvReader = new CanvasReader(rows, processors); - ConceptGraph graph = new ConceptGraph(graphRecord, LOLRlist, tecmapCsvReader.getManualGradedResponses()); + ConceptGraphRecord graphRecord = ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticConceptGraph.json"); + List learningResourceRecords = LearningResourceRecord.createLearningResourceRecordsFromJsonFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticResource.json"); + ConceptGraph graph = new ConceptGraph(graphRecord, learningResourceRecords, tecmapCsvReader.getManualGradedResponses()); graph.calcKnowledgeEstimates(); - //System.out.println(graph.toString()); return graph; @@ -129,10 +131,13 @@ public static ConceptGraph simpleTestGraphTest() { graphMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); try{ - TecmapCSVReader tecmapCsvReader = new SakaiReader(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/simpleAssessment.csv"); + List rows = CsvFileLibrary.parseRowsFromFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/simpleAssessment.csv"); + List processors = new ArrayList<>(); + processors.add(new CreateMaxScoreRow()); + TecmapCSVReader tecmapCsvReader = new SakaiReader(rows, processors); ConceptGraphRecord graphRecord = ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/simpleConceptGraph.json"); - List LOLRlist = LearningResourceRecord.createLearningResourceRecordsFromJsonFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/simpleResource.json"); - ConceptGraph graph = new ConceptGraph(graphRecord, LOLRlist, tecmapCsvReader.getManualGradedResponses()); + List lrrList = LearningResourceRecord.createLearningResourceRecordsFromJsonFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/simpleResource.json"); + ConceptGraph graph = new ConceptGraph(graphRecord, lrrList, tecmapCsvReader.getManualGradedResponses()); graph.calcKnowledgeEstimates(); // System.out.println(graph.toString()); diff --git a/src/test/java/edu/ithaca/dragon/tecmap/conceptgraph/PracticalConceptGraphTest.java b/src/test/java/edu/ithaca/dragon/tecmap/conceptgraph/PracticalConceptGraphTest.java index 996787d..1d902b9 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/conceptgraph/PracticalConceptGraphTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/conceptgraph/PracticalConceptGraphTest.java @@ -3,14 +3,14 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import edu.ithaca.dragon.tecmap.Settings; -import edu.ithaca.dragon.tecmap.io.reader.TecmapCSVReader; -import edu.ithaca.dragon.tecmap.io.reader.SakaiReader; +import edu.ithaca.dragon.tecmap.io.reader.*; import edu.ithaca.dragon.tecmap.io.record.ConceptGraphRecord; import edu.ithaca.dragon.tecmap.io.record.LearningResourceRecord; import edu.ithaca.dragon.tecmap.util.DataUtil; import org.junit.jupiter.api.Test; import java.io.File; +import java.util.ArrayList; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -27,7 +27,9 @@ public void basicRealisticConceptGraphTest(){ graphMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); try{ - TecmapCSVReader tecmapCsvReader = new SakaiReader(TEST_DIR+"basicRealisticAssessment.csv"); + List rows = CsvFileLibrary.parseRowsFromFile(TEST_DIR+"basicRealisticAssessment.csv"); + List processors = new ArrayList<>(); + TecmapCSVReader tecmapCsvReader = new SakaiReader(rows, processors); ConceptGraphRecord graphRecord = ConceptGraphRecord.buildFromJson(TEST_DIR+"mediumRealisticConceptGraph.json"); @@ -63,8 +65,10 @@ public void basicRealisticTest(){ graphMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); try{ - TecmapCSVReader tecmapCsvReader = new SakaiReader(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); - + List rows = CsvFileLibrary.parseRowsFromFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); + List processors = new ArrayList<>(); + processors.add(new CanvasConverter()); + TecmapCSVReader tecmapCsvReader = new CanvasReader(rows, processors); ConceptGraphRecord graphRecord = ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticConceptGraph.json"); @@ -103,8 +107,9 @@ public void advancedRealisticConceptGraphTest(){ graphMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); try{ - TecmapCSVReader tecmapCsvReader = new SakaiReader(TEST_DIR+"advancedRealisticAssessment.csv"); - + List rows = CsvFileLibrary.parseRowsFromFile(TEST_DIR+"advancedRealisticAssessment.csv"); + List processors = new ArrayList<>(); + TecmapCSVReader tecmapCsvReader = new SakaiReader(rows, processors); ConceptGraphRecord graphRecord = ConceptGraphRecord.buildFromJson(TEST_DIR+"mediumRealisticConceptGraph.json"); @@ -140,7 +145,10 @@ public void SingleStudentRealisticConceptGraphTest(){ graphMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); try{ - TecmapCSVReader tecmapCsvReader = new SakaiReader(TEST_DIR+"singleStudentRealisticAssessment.csv"); + List rows = CsvFileLibrary.parseRowsFromFile(TEST_DIR+"singleStudentRealisticAssessment.csv"); + List processors = new ArrayList<>(); + processors.add(new CreateMaxScoreRow()); + TecmapCSVReader tecmapCsvReader = new SakaiReader(rows, processors); ConceptGraphRecord graphRecord = ConceptGraphRecord.buildFromJson(TEST_DIR+"mediumRealisticConceptGraph.json"); List LOLRlist = LearningResourceRecord.createLearningResourceRecordsFromJsonFile(TEST_DIR+"mediumRealisticResource.json"); diff --git a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/AnonymizerTest.java b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/AnonymizerTest.java index 15738c7..a7027c6 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/AnonymizerTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/AnonymizerTest.java @@ -24,15 +24,15 @@ class AnonymizerTest { @Test public void anonymizeTest() throws IOException , CsvException { - List newRows = CsvRepresentation.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH+"Cs1Example/Cs1ExampleAssessment1.csv"); - Anonymizer anonymizer = new Anonymizer(2); + List newRows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH+"Cs1Example/Cs1ExampleAssessment1.csv"); + Anonymizer anonymizer = new Anonymizer(2, 1, 0); anonymizer.anonymize(newRows); //check labels werent disturbed assertEquals("student ID", newRows.get(0)[0]); assertEquals("Name", newRows.get(0)[1]); - List origRows = CsvRepresentation.parseRowsFromFile( + List origRows = CsvFileLibrary.parseRowsFromFile( Settings.DEFAULT_TEST_DATASTORE_PATH + "Cs1Example/Cs1ExampleAssessment1.csv"); Map real2anonId = anonymizer.getRealId2anonId(); diff --git a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/CanvasConverterTest.java b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/CanvasConverterTest.java new file mode 100644 index 0000000..9b6ce01 --- /dev/null +++ b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/CanvasConverterTest.java @@ -0,0 +1,77 @@ +package edu.ithaca.dragon.tecmap.io.reader; + +import com.opencsv.exceptions.CsvException; +import edu.ithaca.dragon.tecmap.Settings; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class CanvasConverterTest { + + + @Test + void canvasConverterTest1() throws IOException, CsvException { + // test combination of swap name and id and create max score (order not matter) + List newRows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "ConvertToCanvasFiles/canvasConverterTest1.csv"); + SwapNameAndIDColumn.swapNameAndIDColumn(newRows); + CreateMaxScoreRow.createMaxScoreRow(newRows); + + List orgRows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "ConvertToCanvasFiles/CanvasGradeExample.csv"); + + for (int row = 0; row < orgRows.size(); row++) { + for (int column = 0; column < orgRows.get(row).length; column++) { + assertEquals(orgRows.get(row)[column], newRows.get(row)[column]); + } + } + } + + @Test + void canvasConverterTest2() throws IOException, CsvException { + // test combination of move gradeStartColumnIndex and create max score (order not matter) + List newRows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "ConvertToCanvasFiles/canvasConverterTest2.csv"); + MoveGradeStartColumnIndex.moveGradeStartColumnIndex(newRows); + CreateMaxScoreRow.createMaxScoreRow(newRows); + + List orgRows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "ConvertToCanvasFiles/CorrectGradeStartColumnIndex.csv"); + + for (int row = 0; row < orgRows.size(); row++) { + for (int column = 0; column < orgRows.get(row).length; column++) { + assertEquals(orgRows.get(row)[column], newRows.get(row)[column]); + } + } + } + + @Test + void canvasConverterTest3() throws IOException, CsvException { + // test combination of swap name and id and move gradeStartColumnIndex (order not matter) + List newRows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "ConvertToCanvasFiles/canvasConverterTest3.csv"); + SwapNameAndIDColumn.swapNameAndIDColumn(newRows); + MoveGradeStartColumnIndex.moveGradeStartColumnIndex(newRows); + + List orgRows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "ConvertToCanvasFiles/CorrectGradeStartColumnIndex.csv"); + + for (int row = 0; row < orgRows.size(); row++) { + for (int column = 0; column < orgRows.get(row).length; column++) { + assertEquals(orgRows.get(row)[column], newRows.get(row)[column]); + } + } + } + + @Test + void canvasConverterTest() throws IOException, CsvException { + // test all 3 + List newRows = CsvFileLibrary.parseRowsFromFile(Settings.TEST_RESOURCE_DIR + "comp220_Summer2024/assessmentGrades.csv"); + CanvasConverter.canvasConverter(newRows); + + List orgRows = CsvFileLibrary.parseRowsFromFile(Settings.TEST_RESOURCE_DIR + "comp220_Summer2024/gradesCanvasFormat.csv"); + + for (int row = 0; row < orgRows.size(); row++) { + for (int column = 0; column < orgRows.get(row).length; column++) { + assertEquals(orgRows.get(row)[column], newRows.get(row)[column]); + } + } + } +} diff --git a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/CanvasTest.java b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/CanvasTest.java index af6e979..9b3ea6a 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/CanvasTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/CanvasTest.java @@ -8,6 +8,7 @@ import org.junit.jupiter.api.Test; import java.io.IOException; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -17,17 +18,19 @@ public class CanvasTest { @Test public void anonymizeTest() throws IOException, CsvException { - List newRows = CsvRepresentation.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH+"CanvasFiles/CanvasGradeExample.csv"); + List newRows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "ConvertToCanvasFiles/CanvasGradeExample.csv"); Anonymizer anonymizer = new Anonymizer(3); anonymizer.anonymize(newRows); - List origRows = CsvRepresentation.parseRowsFromFile( - Settings.DEFAULT_TEST_DATASTORE_PATH + "CanvasFiles/CanvasGradeExample.csv"); + List origRows = CsvFileLibrary.parseRowsFromFile( + Settings.DEFAULT_TEST_DATASTORE_PATH + "ConvertToCanvasFiles/CanvasGradeExample.csv"); // check labels weren't disturbed - for (int i = 0; i < anonymizer.getGradeStartColumnIndex(); i++) { - for (int j = 0; j < origRows.get(0).length; j++) { - assertEquals(origRows.get(i)[j], newRows.get(i)[j]); + for (int row = 0; row < anonymizer.getNameStartRowIndex(); row++) { + if (origRows.get(row).length > 1) { + for (int column = 0; column < origRows.get(0).length; column++) { + assertEquals(origRows.get(row)[column], newRows.get(row)[column]); + } } } @@ -46,10 +49,10 @@ public void anonymizeTest() throws IOException, CsvException { } } } - for (int i = 3; i < newRows.size() - 1; i++) { - for (int j = i + 1; j < newRows.size(); j++) { - assertNotEquals(newRows.get(i)[0], newRows.get(j)[0]); // check if anonName is unique (different from the rest) - assertNotEquals(newRows.get(i)[1], newRows.get(j)[1]); // check if anonId is unique (different from the rest) + for (int row = 3; row < newRows.size() - 1; row++) { + for (int column = row + 1; column < newRows.size(); column++) { + assertNotEquals(newRows.get(row)[0], newRows.get(column)[0]); // check if anonName is unique (different from the rest) + assertNotEquals(newRows.get(row)[1], newRows.get(column)[1]); // check if anonId is unique (different from the rest) } } } @@ -57,28 +60,32 @@ public void anonymizeTest() throws IOException, CsvException { @Test void createQuestionsTest() throws IOException, CsvException { - // need to convert from Canvas to Sakai label or use converted file - CanvasReader file = new CanvasReader(Settings.DEFAULT_TEST_DATASTORE_PATH + "CanvasFiles/convertedCanvasGradeExample.csv"); + List rows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "ConvertToCanvasFiles/CanvasGradeExample.csv"); + List processors = new ArrayList<>(); + + CanvasReader file = new CanvasReader(rows, processors); List manualGradedResponseList = file.getManualGradedResponses(); List manualGradedColumnItemList = file.getManualGradedLearningObjects(); //testing title entries from the csv files //Testing for first entry in the CSV assertEquals(8 * 9, manualGradedResponseList.size()); - ManualGradedResponse testQ = new ManualGradedResponse("172-Task00-01-Reading-Python Review (227500)", 4, 4, "1"); + ManualGradedResponse testQ = new ManualGradedResponse("_PracticeProblem1","172-Task00-01-Reading-Python Review (227500)", 4, 4, "1"); + // id doesn't matter, not check assertEquals(testQ.calcKnowledgeEstimate(), manualGradedResponseList.get(0).calcKnowledgeEstimate(), 0); assertEquals(testQ.getNonNormalizedScore(), ((ManualGradedResponse) manualGradedResponseList.get(0)).getNonNormalizedScore(), 0); assertEquals(testQ.getMaxPossibleScore(), ((ManualGradedResponse) manualGradedResponseList.get(0)).getMaxPossibleScore(), 0); assertEquals(testQ.getUserId(), manualGradedResponseList.get(0).getUserId()); - assertEquals(testQ.getLearningObjectId(), manualGradedResponseList.get(0).getLearningObjectId()); + assertEquals(testQ.getAssessmentItemText(), manualGradedResponseList.get(0).getAssessmentItemText()); //Testing for last entry in CSV - ManualGradedResponse testQ2 = new ManualGradedResponse("172-Task01-04- Tracing Objects (230529)", 3, 3, "8"); + ManualGradedResponse testQ2 = new ManualGradedResponse("_PracticeProblem2","172-Task01-04- Tracing Objects (230529)", 3, 3, "8"); int lastIndex = manualGradedResponseList.size() - 1; + // id doesn't matter, not check assertEquals(testQ2.calcKnowledgeEstimate(), manualGradedResponseList.get(lastIndex).calcKnowledgeEstimate(), 0); assertEquals(testQ2.getNonNormalizedScore(), ((ManualGradedResponse) manualGradedResponseList.get(lastIndex)).getNonNormalizedScore(), 0); assertEquals(testQ2.getMaxPossibleScore(), ((ManualGradedResponse) manualGradedResponseList.get(lastIndex)).getMaxPossibleScore(), 0); assertEquals(testQ2.getUserId(), manualGradedResponseList.get(lastIndex).getUserId()); - assertEquals(testQ2.getLearningObjectId(), manualGradedResponseList.get(lastIndex).getLearningObjectId()); + assertEquals(testQ2.getAssessmentItemText(), manualGradedResponseList.get(lastIndex).getAssessmentItemText()); //Testing for the Learning Objects assertEquals(9, manualGradedColumnItemList.size()); @@ -86,7 +93,7 @@ void createQuestionsTest() throws IOException, CsvException { //Making sure the first item in the ManualGradedResponses list is the first item in the first learning object of the learning object list assertEquals(manualGradedResponseList.get(0).calcKnowledgeEstimate(), manualGradedColumnItemList.get(0).getResponses().get(0).calcKnowledgeEstimate(), 0); assertEquals(manualGradedResponseList.get(0).getUserId(), manualGradedColumnItemList.get(0).getResponses().get(0).getUserId()); - assertEquals(manualGradedResponseList.get(0).getLearningObjectId(), manualGradedColumnItemList.get(0).getResponses().get(0).getLearningObjectId()); + assertEquals(manualGradedResponseList.get(0).getAssessmentItemId(), manualGradedColumnItemList.get(0).getResponses().get(0).getAssessmentItemId()); } diff --git a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/ConvertToSakaiLabelTest.java b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/ConvertToSakaiLabelTest.java deleted file mode 100644 index dfbe59c..0000000 --- a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/ConvertToSakaiLabelTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package edu.ithaca.dragon.tecmap.io.reader; - -import com.opencsv.exceptions.CsvException; -import edu.ithaca.dragon.tecmap.Settings; -import org.junit.jupiter.api.Test; - -import java.io.IOException; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class ConvertToSakaiLabelTest { - - @Test - void addPointTotalsToQuestionLabelsTest()throws IOException, CsvException { - List rowsToConvert = CsvRepresentation.parseRowsFromFile("src/test/resources/singleUseFiles/pointsOffExample.csv"); - ConvertToSakaiLabel.addPointTotalsToQuestionLabels(rowsToConvert.get(0), rowsToConvert.get(1), 2); - - List correctRowsExample = CsvRepresentation.parseRowsFromFile("src/test/resources/singleUseFiles/convertedPointsOffExample.csv"); - String[] convertedRow = rowsToConvert.get(0); - String[] correctRowExample = correctRowsExample.get(0); - assertEquals(correctRowExample.length, convertedRow.length); - for (int colIdx=0; colIdx rowsToConvert = CsvRepresentation.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH+"CanvasFiles/CanvasGradeExample.csv"); - ConvertToSakaiLabel.addPointTotalsToQuestionLabels(rowsToConvert.get(0), rowsToConvert.get(2), 4); - - List correctRowsExample = CsvRepresentation.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH+"CanvasFiles/convertedCanvasGradeExample.csv"); - String[] convertedRow = rowsToConvert.get(0); - String[] correctRowExample = correctRowsExample.get(0); - assertEquals(correctRowExample.length, convertedRow.length); - for (int colIdx=0; colIdx newRows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "ConvertToCanvasFiles/WithoutMaxScoreRow.csv"); + CreateMaxScoreRow.createMaxScoreRow(newRows); + + List orgRows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "ConvertToCanvasFiles/CanvasGradeExample.csv"); + + for (int row = 0; row < orgRows.size(); row++) { + for (int column = 0; column < orgRows.get(row).length; column++) { + assertEquals(orgRows.get(row)[column], newRows.get(row)[column]); + } + } + } +} diff --git a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/CsvRepresentationTest.java b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/CsvRepresentationTest.java index 5ec6eaf..4b3a690 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/CsvRepresentationTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/CsvRepresentationTest.java @@ -6,7 +6,6 @@ import java.io.File; import java.io.IOException; -import java.util.Arrays; import java.util.List; import static org.junit.jupiter.api.Assertions.*; @@ -15,7 +14,7 @@ class CsvRepresentationTest { @Test void parseAllRowsFromFileTest() throws IOException, CsvException { - List rows = CsvRepresentation.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "Cs1Example/Cs1ExampleAssessment1.csv"); + List rows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "Cs1Example/Cs1ExampleAssessment1.csv"); assertEquals("student ID", rows.get(0)[0]); assertEquals("", rows.get(1)[0]); assertEquals("Lisa", rows.get(3)[1]); @@ -24,12 +23,12 @@ void parseAllRowsFromFileTest() throws IOException, CsvException { @Test void writeRowsToFileTest() throws IOException, CsvException { - List rows = CsvRepresentation.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "Cs1Example/Cs1ExampleAssessment1.csv"); + List rows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "Cs1Example/Cs1ExampleAssessment1.csv"); //change some stuff to wrote to the file rows.get(2)[0] ="s100"; rows.get(3)[6] ="50"; - CsvRepresentation.writeRowsToFile(rows, Settings.DEFAULT_TEST_DATASTORE_PATH+"autogenerated/CsvRepresentationTest-writeRowsToFileTest.csv"); - rows = CsvRepresentation.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH+"autogenerated/CsvRepresentationTest-writeRowsToFileTest.csv"); + CsvFileLibrary.writeRowsToFile(rows, Settings.DEFAULT_TEST_DATASTORE_PATH+"autogenerated/CsvRepresentationTest-writeRowsToFileTest.csv"); + rows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH+"autogenerated/CsvRepresentationTest-writeRowsToFileTest.csv"); //expect changes assertEquals("s100", rows.get(2)[0]); assertEquals("50", rows.get(3)[6]); diff --git a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/MoveGradeStartColumnIndexTest.java b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/MoveGradeStartColumnIndexTest.java new file mode 100644 index 0000000..f1286ad --- /dev/null +++ b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/MoveGradeStartColumnIndexTest.java @@ -0,0 +1,27 @@ +package edu.ithaca.dragon.tecmap.io.reader; + +import com.opencsv.exceptions.CsvException; +import edu.ithaca.dragon.tecmap.Settings; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class MoveGradeStartColumnIndexTest { + + @Test + void moveGradeStartColumnIndexTest() throws IOException, CsvException { + List newRows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "ConvertToCanvasFiles/WrongGradeStartColumnIndex.csv"); + MoveGradeStartColumnIndex.moveGradeStartColumnIndex(newRows); + + List orgRows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "ConvertToCanvasFiles/CorrectGradeStartColumnIndex.csv"); + + for (int row = 0; row < orgRows.size(); row++) { + for (int column = 0; column < orgRows.get(row).length; column++) { + assertEquals(orgRows.get(row)[column], newRows.get(row)[column]); + } + } + } +} diff --git a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/PointsOffConverterTest.java b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/PointsOffConverterTest.java index b128698..b6cf6a1 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/PointsOffConverterTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/PointsOffConverterTest.java @@ -13,13 +13,12 @@ class PointsOffConverterTest { @Test void convertFromPointsOffToTotalPointsTest()throws IOException, CsvException { - List rowsToConvert = CsvRepresentation.parseRowsFromFile("src/test/resources/singleUseFiles/pointsOffExample.csv"); - ConvertToSakaiLabel.addPointTotalsToQuestionLabels(rowsToConvert.get(0), rowsToConvert.get(1), 2); + List rowsToConvert = CsvFileLibrary.parseRowsFromFile("src/test/resources/singleUseFiles/pointsOffExample.csv"); PointsOffConverter.convertFromPointsOffToTotalPoints(rowsToConvert); - List correctRowsExample = CsvRepresentation.parseRowsFromFile("src/test/resources/singleUseFiles/convertedPointsOffExample.csv"); + List correctRowsExample = CsvFileLibrary.parseRowsFromFile("src/test/resources/singleUseFiles/convertedPointsOffExample.csv"); assertEquals(correctRowsExample.size(), rowsToConvert.size()); - for (int rowIdx=0; rowIdx < rowsToConvert.size(); rowIdx++){ + for (int rowIdx=2; rowIdx < rowsToConvert.size(); rowIdx++){ String[] convertedRow = rowsToConvert.get(rowIdx); String[] correctRowExample = correctRowsExample.get(rowIdx); assertEquals(correctRowExample.length, convertedRow.length); diff --git a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/ReaderToolsTest.java b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/ReaderToolsTest.java index f52c835..5211906 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/ReaderToolsTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/ReaderToolsTest.java @@ -1,7 +1,13 @@ package edu.ithaca.dragon.tecmap.io.reader; +import com.opencsv.exceptions.CsvException; +import edu.ithaca.dragon.tecmap.Settings; +import edu.ithaca.dragon.tecmap.conceptgraph.ConceptNode; +import edu.ithaca.dragon.tecmap.learningresource.AssessmentItem; +import edu.ithaca.dragon.tecmap.learningresource.AssessmentItemResponse; import org.junit.jupiter.api.Test; +import java.io.IOException; import java.util.Arrays; import java.util.List; @@ -120,4 +126,15 @@ public void titleColonTest() { fail(); } } + + @Test + void assessmentItemsFromListTest() throws IOException, CsvException { + List rows = CsvFileLibrary.parseRowsFromFile(Settings.TEST_RESOURCE_DIR + "comp220_Summer2024/assessmentGrades.csv"); + // convert sakai file to canvas format + CanvasConverter.canvasConverter(rows); + List aiList = ReaderTools.assessmentItemsFromList(rows); + List ai = aiList.stream().map(AssessmentItem::getText).toList(); + List expectedAIList = Arrays.asList("Q1","Q2","Q3","Q4","Q5","Q6","Q7"); + assertEquals(expectedAIList, ai); + } } diff --git a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/SwapNameAndIDColumnTest.java b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/SwapNameAndIDColumnTest.java new file mode 100644 index 0000000..5b43910 --- /dev/null +++ b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/SwapNameAndIDColumnTest.java @@ -0,0 +1,27 @@ +package edu.ithaca.dragon.tecmap.io.reader; + +import com.opencsv.exceptions.CsvException; +import edu.ithaca.dragon.tecmap.Settings; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class SwapNameAndIDColumnTest { + + @Test + void swapNameAndIDColumnTest() throws IOException, CsvException { + List newRows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "ConvertToCanvasFiles/WrongIdAndStudentColumn.csv"); + SwapNameAndIDColumn.swapNameAndIDColumn(newRows); + + List orgRows = CsvFileLibrary.parseRowsFromFile(Settings.DEFAULT_TEST_DATASTORE_PATH + "ConvertToCanvasFiles/CanvasGradeExample.csv"); + + for (int row = 0; row < orgRows.size(); row++) { + for (int column = 0; column < orgRows.get(row).length; column++) { + assertEquals(orgRows.get(row)[column], newRows.get(row)[column]); + } + } + } +} diff --git a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/TecmapCSVReaderTest.java b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/TecmapCSVReaderTest.java index 40bf6b5..4fbc2ad 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/TecmapCSVReaderTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/TecmapCSVReaderTest.java @@ -1,5 +1,6 @@ package edu.ithaca.dragon.tecmap.io.reader; +import com.opencsv.exceptions.CsvException; import edu.ithaca.dragon.tecmap.Settings; import edu.ithaca.dragon.tecmap.learningresource.AssessmentItem; import edu.ithaca.dragon.tecmap.learningresource.AssessmentItemResponse; @@ -7,6 +8,7 @@ import org.junit.jupiter.api.Test; import java.io.IOException; +import java.util.ArrayList; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -19,45 +21,46 @@ // make pull request from dev to commaTest public class TecmapCSVReaderTest { @Test - public void createQuestionsTest() { + public void createQuestionsTest() throws IOException, CsvException { + // sakai format String file = Settings.TEST_RESOURCE_DIR + "ManuallyCreated/complexRealisticAssessment.csv"; - try { - SakaiReader readfile = new SakaiReader(file); - List manualGradedResponseList = readfile.getManualGradedResponses(); - List manualGradedColumnItemList = readfile.getManualGradedLearningObjects(); - //testing title entries from the csv files - - //Testing for first entry in the CSV - assertEquals(25 * 9, manualGradedResponseList.size()); - ManualGradedResponse testQ = new ManualGradedResponse("Week 8 Exercises", 6, 6, "stu1"); - assertEquals(testQ.calcKnowledgeEstimate(), manualGradedResponseList.get(0).calcKnowledgeEstimate(), 0); - assertEquals(testQ.getNonNormalizedScore(), ((ManualGradedResponse) manualGradedResponseList.get(0)).getNonNormalizedScore(), 0); - assertEquals(testQ.getMaxPossibleScore(), ((ManualGradedResponse) manualGradedResponseList.get(0)).getMaxPossibleScore(), 0); - assertEquals(testQ.getUserId(), manualGradedResponseList.get(0).getUserId()); - assertEquals(testQ.getLearningObjectId(), manualGradedResponseList.get(0).getLearningObjectId()); - - //Testing for last entry in CSV - ManualGradedResponse testQ2 = new ManualGradedResponse("Lab 3: Function Practice (House Paint Calculator)", 10, 10, "stu25"); - int lastIndex = manualGradedResponseList.size() - 1; - assertEquals(testQ2.calcKnowledgeEstimate(), manualGradedResponseList.get(lastIndex).calcKnowledgeEstimate(), 0); - assertEquals(testQ2.getNonNormalizedScore(), ((ManualGradedResponse) manualGradedResponseList.get(lastIndex)).getNonNormalizedScore(), 0); - assertEquals(testQ2.getMaxPossibleScore(), ((ManualGradedResponse) manualGradedResponseList.get(lastIndex)).getMaxPossibleScore(), 0); - assertEquals(testQ2.getUserId(), manualGradedResponseList.get(lastIndex).getUserId()); - assertEquals(testQ2.getLearningObjectId(), manualGradedResponseList.get(lastIndex).getLearningObjectId()); - - //Testing for the Learning Objects - assertEquals(9, manualGradedColumnItemList.size()); - assertEquals(25, manualGradedColumnItemList.get(0).getResponses().size()); - //Making sure the first item in the ManualGradedResponses list is the first item in the first learning object of the learning object list - assertEquals(manualGradedResponseList.get(0).calcKnowledgeEstimate(), manualGradedColumnItemList.get(0).getResponses().get(0).calcKnowledgeEstimate(), 0); - assertEquals(manualGradedResponseList.get(0).getUserId(), manualGradedColumnItemList.get(0).getResponses().get(0).getUserId()); - assertEquals(manualGradedResponseList.get(0).getLearningObjectId(), manualGradedColumnItemList.get(0).getResponses().get(0).getLearningObjectId()); - //Can't access these but they are tested above - //assertEquals(manualGradedResponseList.get(0).getNonNormalizedScore(),manualGradedColumnItemList.get(0).getResponses().get(0).getNonNormalizedScore(),0); - //assertEquals(manualGradedResponseList.get(0).getMaxPossibleScore(),manualGradedColumnItemList.get(0).getResponses().get(0).getMaxPossibleScore(),0); - } catch (IOException e) { - fail(); - } + List rows = CsvFileLibrary.parseRowsFromFile(file); + List processors = new ArrayList<>(); + processors.add(new CanvasConverter()); + CanvasReader readfile = new CanvasReader(rows, processors); + List manualGradedResponseList = readfile.getManualGradedResponses(); + List manualGradedColumnItemList = readfile.getManualGradedLearningObjects(); + //testing title entries from the csv files + //Testing for first entry in the CSV + assertEquals(25 * 9, manualGradedResponseList.size()); + ManualGradedResponse testQ = new ManualGradedResponse("_PracticeProblem1","Week 8 Exercises", 6, 6, "stu1"); + // id doesn't matter, not check + assertEquals(testQ.calcKnowledgeEstimate(), manualGradedResponseList.get(0).calcKnowledgeEstimate(), 0); + assertEquals(testQ.getNonNormalizedScore(), ((ManualGradedResponse) manualGradedResponseList.get(0)).getNonNormalizedScore(), 0); + assertEquals(testQ.getMaxPossibleScore(), ((ManualGradedResponse) manualGradedResponseList.get(0)).getMaxPossibleScore(), 0); + assertEquals(testQ.getUserId(), manualGradedResponseList.get(0).getUserId()); + assertEquals(testQ.getAssessmentItemText(), manualGradedResponseList.get(0).getAssessmentItemText()); + + //Testing for last entry in CSV + ManualGradedResponse testQ2 = new ManualGradedResponse("_PracticeProblem2","Lab 3: Function Practice (House Paint Calculator)", 10, 10, "stu25"); + int lastIndex = manualGradedResponseList.size() - 1; + // id doesn't matter, not check + assertEquals(testQ2.calcKnowledgeEstimate(), manualGradedResponseList.get(lastIndex).calcKnowledgeEstimate(), 0); + assertEquals(testQ2.getNonNormalizedScore(), ((ManualGradedResponse) manualGradedResponseList.get(lastIndex)).getNonNormalizedScore(), 0); + assertEquals(testQ2.getMaxPossibleScore(), ((ManualGradedResponse) manualGradedResponseList.get(lastIndex)).getMaxPossibleScore(), 0); + assertEquals(testQ2.getUserId(), manualGradedResponseList.get(lastIndex).getUserId()); + assertEquals(testQ2.getAssessmentItemText(), manualGradedResponseList.get(lastIndex).getAssessmentItemText()); + + //Testing for the Learning Objects + assertEquals(9, manualGradedColumnItemList.size()); + assertEquals(25, manualGradedColumnItemList.get(0).getResponses().size()); + //Making sure the first item in the ManualGradedResponses list is the first item in the first learning object of the learning object list + assertEquals(manualGradedResponseList.get(0).calcKnowledgeEstimate(), manualGradedColumnItemList.get(0).getResponses().get(0).calcKnowledgeEstimate(), 0); + assertEquals(manualGradedResponseList.get(0).getUserId(), manualGradedColumnItemList.get(0).getResponses().get(0).getUserId()); + assertEquals(manualGradedResponseList.get(0).getAssessmentItemId(), manualGradedColumnItemList.get(0).getResponses().get(0).getAssessmentItemId()); + //Can't access these but they are tested above + //assertEquals(manualGradedResponseList.get(0).getNonNormalizedScore(),manualGradedColumnItemList.get(0).getResponses().get(0).getNonNormalizedScore(),0); + //assertEquals(manualGradedResponseList.get(0).getMaxPossibleScore(),manualGradedColumnItemList.get(0).getResponses().get(0).getMaxPossibleScore(),0); } } diff --git a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/ZybooksReaderTest.java b/src/test/java/edu/ithaca/dragon/tecmap/io/reader/ZybooksReaderTest.java deleted file mode 100644 index 558852f..0000000 --- a/src/test/java/edu/ithaca/dragon/tecmap/io/reader/ZybooksReaderTest.java +++ /dev/null @@ -1,66 +0,0 @@ -package edu.ithaca.dragon.tecmap.io.reader; - -import edu.ithaca.dragon.tecmap.Settings; -import edu.ithaca.dragon.tecmap.learningresource.AssessmentItem; -import edu.ithaca.dragon.tecmap.learningresource.AssessmentItemResponse; -import edu.ithaca.dragon.tecmap.learningresource.ManualGradedResponse; -import org.junit.jupiter.api.Test; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.fail; - -/** - * Created by rdebolt on 10/23/18. - */ - -// make pull request from dev to commaTest -public class ZybooksReaderTest { - - @Test - public void createQuestionsTest() { - String file = Settings.TEST_RESOURCE_DIR + "io/assessmentSources/zybook-comp115-DataExample.csv"; - try { - ZybooksReader readfile = new ZybooksReader(file); - List manualGradedResponseList = readfile.getManualGradedResponses(); - List manualGradedColumnItemList = readfile.getManualGradedLearningObjects(); - //testing title entries from the csv files - - //Testing for first entry in the CSV - assertEquals(16 * 26, manualGradedResponseList.size()); - ManualGradedResponse testQ = new ManualGradedResponse("Participation total", 148, 78.37837838, "lname01 fname01"); - assertEquals(testQ.calcKnowledgeEstimate(), manualGradedResponseList.get(0).calcKnowledgeEstimate(), 0); - assertEquals(testQ.getNonNormalizedScore(), ((ManualGradedResponse) manualGradedResponseList.get(0)).getNonNormalizedScore(), 0); - assertEquals(testQ.getMaxPossibleScore(), ((ManualGradedResponse) manualGradedResponseList.get(0)).getMaxPossibleScore(), 0); - assertEquals(testQ.getUserId(), manualGradedResponseList.get(0).getUserId()); - assertEquals(testQ.getLearningObjectId(), manualGradedResponseList.get(0).getLearningObjectId()); - - //Testing for last entry in CSV - ManualGradedResponse testQ2 = new ManualGradedResponse("1.12 - Challenge", 0, 0, "lname16 fname16"); - int lastIndex = manualGradedResponseList.size() - 1; - assertEquals(testQ2.calcKnowledgeEstimate(), manualGradedResponseList.get(lastIndex).calcKnowledgeEstimate(), 0); - assertEquals(testQ2.getNonNormalizedScore(), ((ManualGradedResponse) manualGradedResponseList.get(lastIndex)).getNonNormalizedScore(), 0); - assertEquals(testQ2.getMaxPossibleScore(), ((ManualGradedResponse) manualGradedResponseList.get(lastIndex)).getMaxPossibleScore(), 0); - assertEquals(testQ2.getUserId(), manualGradedResponseList.get(lastIndex).getUserId()); - assertEquals(testQ2.getLearningObjectId(), manualGradedResponseList.get(lastIndex).getLearningObjectId()); - - //Testing for the Learning Objects - assertEquals(26, manualGradedColumnItemList.size()); - assertEquals(16, manualGradedColumnItemList.get(0).getResponses().size()); - //Making sure the first item in the ManualGradedResponses list is the first item in the first learning object of the learning object list - assertEquals(manualGradedResponseList.get(0).calcKnowledgeEstimate(), manualGradedColumnItemList.get(0).getResponses().get(0).calcKnowledgeEstimate(), 0); - assertEquals(manualGradedResponseList.get(0).getUserId(), manualGradedColumnItemList.get(0).getResponses().get(0).getUserId()); - assertEquals(manualGradedResponseList.get(0).getLearningObjectId(), manualGradedColumnItemList.get(0).getResponses().get(0).getLearningObjectId()); - //Can't access these but they are tested above - //assertEquals(manualGradedResponseList.get(0).getNonNormalizedScore(),manualGradedColumnItemList.get(0).getResponses().get(0).getNonNormalizedScore(),0); - //assertEquals(manualGradedResponseList.get(0).getMaxPossibleScore(),manualGradedColumnItemList.get(0).getResponses().get(0).getMaxPossibleScore(),0); - } catch (IOException e) { - fail(); - } - - } -} \ No newline at end of file diff --git a/src/test/java/edu/ithaca/dragon/tecmap/io/record/LearningResourceRecordTest.java b/src/test/java/edu/ithaca/dragon/tecmap/io/record/LearningResourceRecordTest.java index 68ba034..e9c55fa 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/io/record/LearningResourceRecordTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/io/record/LearningResourceRecordTest.java @@ -2,11 +2,14 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; +import com.opencsv.exceptions.CsvException; import edu.ithaca.dragon.tecmap.Settings; +import edu.ithaca.dragon.tecmap.io.reader.CsvFileLibrary; +import edu.ithaca.dragon.tecmap.io.reader.CsvProcessor; import edu.ithaca.dragon.tecmap.io.reader.TecmapCSVReader; import edu.ithaca.dragon.tecmap.io.reader.SakaiReader; import edu.ithaca.dragon.tecmap.learningresource.AssessmentItem; -import edu.ithaca.dragon.tecmap.learningresource.LearningResource; +import edu.ithaca.dragon.tecmap.learningresource.LearningMaterial; import edu.ithaca.dragon.tecmap.learningresource.LearningResourceType; import edu.ithaca.dragon.tecmap.util.DataUtil; import org.junit.jupiter.api.Test; @@ -24,7 +27,7 @@ public class LearningResourceRecordTest { @Test public void testBuildingResourcesFromRecords(){ Collection assessments = new ArrayList<>(); - Collection materials = new ArrayList<>(); + Collection materials = new ArrayList<>(); try { Collection fromFile = LearningResourceRecord.createLearningResourceRecordsFromJsonFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/LearningRecordResourceTest-MissingFields.json"); @@ -40,7 +43,7 @@ public void testBuildingResourcesFromRecords(){ if (record.isType(LearningResourceType.INFORMATION) || record.isType(LearningResourceType.PRACTICE)){ //since we've already added an assessment for this record, remove it so the list can be used to create the material directly from the list record.getResourceTypes().remove(LearningResourceType.ASSESSMENT); - materials.add(new LearningResource(record)); + materials.add(new LearningMaterial(record)); } } assertEquals(2, assessments.size()); @@ -55,35 +58,35 @@ public static Collection buildTestInstances(){ Collection list = new ArrayList<>(); list.add( new LearningResourceRecord( - "variableHiddenQuizQuestion", Arrays.asList(LearningResourceType.ASSESSMENT), Arrays.asList("Variables", "Assignments"), 1, - 1 + 1, + "variableHiddenQuizQuestion" )); list.add( new LearningResourceRecord( - "reassignReturnedQuizQuestion", Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), Arrays.asList("Variables", "Assignments"), 1, - 1 + 1, + "reassignReturnedQuizQuestion" )); list.add( new LearningResourceRecord( - "VariablesChapter", Arrays.asList(LearningResourceType.INFORMATION), Arrays.asList("Variables", "Assignments"), 1, - 1 + 1, + "VariablesChapter" )); list.add( new LearningResourceRecord( - "reassignQuizQuestion", Arrays.asList(LearningResourceType.INFORMATION, LearningResourceType.PRACTICE), Arrays.asList("Variables", "Assignments"), 1, - 1 + 1, + "reassignQuizQuestion" )); return list; @@ -104,16 +107,16 @@ public static void main(String[] args){ public void addConceptIDTest(){ ArrayList concepts = new ArrayList<>(); concepts.add("Concept 1"); - String id = "id 1"; - LearningResourceRecord loObject = new LearningResourceRecord(id,Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), concepts, 1, 1); - assertEquals("Concept 1",loObject.getConceptIds().iterator().next()); - assertEquals(1,loObject.getConceptIds().size()); - assertEquals("id 1", loObject.getLearningResourceId()); - loObject.addConceptId("Concept 2"); - Iterator checker = loObject.getConceptIds().iterator(); + String text = "text 1"; + LearningResourceRecord learningResourceRecord = new LearningResourceRecord(Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), concepts, 1, 1, text); + assertEquals("Concept 1",learningResourceRecord.getConceptIds().iterator().next()); + assertEquals(1,learningResourceRecord.getConceptIds().size()); + assertEquals("text 1", learningResourceRecord.getText()); + learningResourceRecord.addConceptId("Concept 2"); + Iterator checker = learningResourceRecord.getConceptIds().iterator(); checker.next(); assertEquals("Concept 2", checker.next()); - assertEquals(2,loObject.getConceptIds().size()); + assertEquals(2,learningResourceRecord.getConceptIds().size()); } @Test @@ -121,9 +124,9 @@ public void toStringTest(){ ArrayList concepts = new ArrayList<>(); concepts.add("Concept 1"); concepts.add("Concept 2"); - String id = "id 1"; - LearningResourceRecord loObject = new LearningResourceRecord(id,Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), concepts, 1, 1); - assertEquals("(Learning Resource ID: id 1 Concept IDs: Concept 1, Concept 2)",loObject.toString()); + String text = "text 1"; + LearningResourceRecord learningResourceRecord = new LearningResourceRecord(Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), concepts, 1, 1, text); + assertEquals("(Learning Resource Text: text 1 Concept IDs: Concept 1, Concept 2)", learningResourceRecord.toString()); } @Test @@ -131,8 +134,8 @@ public void toJsonTest(){ ArrayList concepts = new ArrayList<>(); concepts.add("Concept 1"); concepts.add("Concept 2"); - String id = "id 1"; - LearningResourceRecord loObject = new LearningResourceRecord(id,Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), concepts, 1, 1); + String text = "text 1"; + LearningResourceRecord loObject = new LearningResourceRecord(Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), concepts, 1, 1, text); ObjectMapper mapper = new ObjectMapper(); try { @@ -147,7 +150,7 @@ public void toJsonTest(){ try { LearningResourceRecord record = mapper.readValue(new File(Settings.TEST_RESOURCE_DIR + "practicalExamples/SystemCreated/recordToJson.json"), LearningResourceRecord.class); - assertEquals("id 1", record.getLearningResourceId()); + assertEquals("text 1", record.getText()); assertEquals(2, record.getConceptIds().size()); Iterator checker = loObject.getConceptIds().iterator(); checker.next(); @@ -168,7 +171,7 @@ public void readSimpleFromFile(){ List list = LearningResourceRecord.createLearningResourceRecordsFromJsonFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/simpleResource.json"); assertEquals(6, list.size()); - assertEquals("Q1", list.get(0).getLearningResourceId()); + assertEquals("Q1", list.get(0).getText()); assertEquals(1, list.get(0).getConceptIds().size()); assertEquals("C", list.get(2).getConceptIds().iterator().next()); assertEquals(1, list.get(0).getDataImportance(), DataUtil.OK_FLOAT_MARGIN); @@ -182,20 +185,22 @@ public void readSimpleFromFile(){ } @Test - public void createLearningObjectLinkRecordsTest(){ + public void createLearningObjectLinkRecordsTest() throws IOException, CsvException { + List rows = CsvFileLibrary.parseRowsFromFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/complexRealisticAssessment.csv"); + List processors = new ArrayList<>(); try { - TecmapCSVReader test = new SakaiReader(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/complexRealisticAssessment.csv"); + TecmapCSVReader test = new SakaiReader(rows, processors); Collection list = test.getManualGradedLearningObjects(); List list2 = test.getManualGradedLearningObjects(); - List lolrList = LearningResourceRecord.createLearningResourceRecordsFromAssessmentItems(list); + List lrrList = LearningResourceRecord.createLearningResourceRecordsFromAssessmentItems(list); List resultString = new ArrayList(); - for (LearningResourceRecord lolr : lolrList) { - resultString.add(lolr.getLearningResourceId()); + for (LearningResourceRecord learningResourceRecord : lrrList) { + resultString.add(learningResourceRecord.getText()); } List list2string = new ArrayList(); - for (AssessmentItem lo : list2) { - list2string.add(lo.getId()); + for (AssessmentItem assessmentItem : list2) { + list2string.add(assessmentItem.getText()); } assertEquals(list2string.toString(), resultString.toString()); }catch (IOException e){ diff --git a/src/test/java/edu/ithaca/dragon/tecmap/learningresource/AssessmentItemTest.java b/src/test/java/edu/ithaca/dragon/tecmap/learningresource/AssessmentItemTest.java index cdad769..2a27fe9 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/learningresource/AssessmentItemTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/learningresource/AssessmentItemTest.java @@ -3,25 +3,25 @@ import edu.ithaca.dragon.tecmap.Settings; import edu.ithaca.dragon.tecmap.TecmapAPI; import edu.ithaca.dragon.tecmap.conceptgraph.ConceptGraph; +import edu.ithaca.dragon.tecmap.conceptgraph.ConceptNode; import edu.ithaca.dragon.tecmap.data.TecmapDatastore; import edu.ithaca.dragon.tecmap.data.TecmapFileDatastore; import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsInAnyOrder; import static org.junit.jupiter.api.Assertions.*; public class AssessmentItemTest { @Test public void lorEqualsTest(){ - AssessmentItemResponse lor0 = new AssessmentItemResponse("student1", "Q1", 1); - AssessmentItemResponse lor1 = new AssessmentItemResponse("student1", "Q1", 1); - AssessmentItemResponse lor2 = new AssessmentItemResponse("student1", "Q2", 1); - AssessmentItemResponse lor3 = new AssessmentItemResponse("student2", "Q2", 1); - AssessmentItemResponse lor4 = new AssessmentItemResponse("student3", "Q2", 0); + AssessmentItemResponse lor0 = new AssessmentItemResponse("student1", "_PracticeProblem1", "Q1", 1); + AssessmentItemResponse lor1 = new AssessmentItemResponse("student1", "_PracticeProblem1", "Q1", 1); + AssessmentItemResponse lor2 = new AssessmentItemResponse("student1", "_PracticeProblem2", "Q2", 1); + AssessmentItemResponse lor3 = new AssessmentItemResponse("student2", "_PracticeProblem2", "Q2", 1); + AssessmentItemResponse lor4 = new AssessmentItemResponse("student3", "_PracticeProblem2", "Q2", 0); assertEquals(true, lor0.equals(lor1)); assertEquals(false, lor0.equals(lor2)); @@ -32,17 +32,17 @@ public void lorEqualsTest(){ @Test public void loEqualsTest(){ - AssessmentItem lo1 = new AssessmentItem("Q1"); - lo1.addResponse(new AssessmentItemResponse("student1", "Q1", 1)); - lo1.addResponse(new AssessmentItemResponse("student1", "Q1", 1)); + AssessmentItem lo1 = new AssessmentItem("_PracticeProblem1", "Q1"); + lo1.addResponse(new AssessmentItemResponse("student1", "_PracticeProblem1", "Q1", 1)); + lo1.addResponse(new AssessmentItemResponse("student1", "_PracticeProblem1", "Q1", 1)); - AssessmentItem lo2 = new AssessmentItem("Q1"); - lo2.addResponse(new AssessmentItemResponse("student1", "Q1", 1)); - lo2.addResponse(new AssessmentItemResponse("student1", "Q1", 1)); + AssessmentItem lo2 = new AssessmentItem("_PracticeProblem1", "Q1"); + lo2.addResponse(new AssessmentItemResponse("student1", "_PracticeProblem1", "Q1", 1)); + lo2.addResponse(new AssessmentItemResponse("student1", "_PracticeProblem1", "Q1", 1)); - AssessmentItem lo3 = new AssessmentItem("Q2"); - lo3.addResponse(new AssessmentItemResponse("student1", "Q2", 1)); - lo3.addResponse(new AssessmentItemResponse("student1", "Q2", 1)); + AssessmentItem lo3 = new AssessmentItem("_PracticeProblem2", "Q2"); + lo3.addResponse(new AssessmentItemResponse("student1", "_PracticeProblem2", "Q2", 1)); + lo3.addResponse(new AssessmentItemResponse("student1", "_PracticeProblem2", "Q2", 1)); assertEquals(true, lo1.equals(lo2)); assertEquals(false, lo1.equals(lo3)); @@ -54,7 +54,7 @@ public void deepCopyLearningObjectMapTest(){ Map newMap = AssessmentItem.deepCopyLearningObjectMap(toCopy); for (AssessmentItem orig : toCopy.values()){ - AssessmentItem copy = newMap.get(orig.getId()); + AssessmentItem copy = newMap.get(orig.getText()); assertEquals(orig, copy); assertNotSame(orig, copy); } @@ -67,18 +67,19 @@ public void deepCopyLearningObjectMapTest(){ @Test public void buildListFromAssessmentItemResponses() { List responseList = new ArrayList<>(); - responseList.add(new AssessmentItemResponse("s01", "AI1", 1)); - responseList.add(new AssessmentItemResponse("s02", "AI1", 1)); - responseList.add(new AssessmentItemResponse("s01", "AI2", 2)); - responseList.add(new AssessmentItemResponse("s02", "AI2", 2)); + responseList.add(new AssessmentItemResponse("s01", "_PracticeProblem1", "AI1", 1)); + responseList.add(new AssessmentItemResponse("s02", "_PracticeProblem1", "AI1", 1)); + responseList.add(new AssessmentItemResponse("s01", "_PracticeProblem2", "AI2", 2)); + responseList.add(new AssessmentItemResponse("s02", "_PracticeProblem2", "AI2", 2)); Map maxKnowledgeEstimatesForAssessments = new HashMap<>(); maxKnowledgeEstimatesForAssessments.put("AI1", 1.0); maxKnowledgeEstimatesForAssessments.put("AI2", 2.0); List columnItems = AssessmentItem.buildListFromAssessmentItemResponses(responseList, maxKnowledgeEstimatesForAssessments); assertEquals(2, columnItems.size()); - assertEquals("AI1", columnItems.get(0).getId()); - assertEquals("AI2", columnItems.get(1).getId()); + List expectedcolumnItems = Arrays.asList("AI1", "AI2"); + List conceptIds3 = columnItems.stream().map(AssessmentItem::getText).toList(); + assertThat(conceptIds3, containsInAnyOrder(expectedcolumnItems.toArray())); } @Test diff --git a/src/test/java/edu/ithaca/dragon/tecmap/learningresource/ExampleLearningObjectLinkRecordFactory.java b/src/test/java/edu/ithaca/dragon/tecmap/learningresource/ExampleLearningObjectLinkRecordFactory.java index 00a0d02..a6e8cbc 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/learningresource/ExampleLearningObjectLinkRecordFactory.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/learningresource/ExampleLearningObjectLinkRecordFactory.java @@ -13,16 +13,16 @@ public class ExampleLearningObjectLinkRecordFactory { public static List makeSimpleLOLRecords(){ - List clList = new ArrayList<>(); + List lrrList = new ArrayList<>(); - clList.add(new LearningResourceRecord("Q1", Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), Arrays.asList("B"),1 , 1)); - clList.add(new LearningResourceRecord("Q2", Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), Arrays.asList("B"),1 , 1)); - clList.add(new LearningResourceRecord("Q3", Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), Arrays.asList("C"),1 , 1)); - clList.add(new LearningResourceRecord("Q4", Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), Arrays.asList("C"),1 , 1)); - clList.add(new LearningResourceRecord("Q5", Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), Arrays.asList("C"),1 , 1)); - clList.add(new LearningResourceRecord("Q6", Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), Arrays.asList("C"),1 , 1)); + lrrList.add(new LearningResourceRecord(Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), Arrays.asList("B"),1 , 1, "Q1")); + lrrList.add(new LearningResourceRecord(Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), Arrays.asList("B"),1 , 1, "Q2")); + lrrList.add(new LearningResourceRecord(Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), Arrays.asList("C"),1 , 1, "Q3")); + lrrList.add(new LearningResourceRecord(Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), Arrays.asList("C"),1 , 1, "Q4")); + lrrList.add(new LearningResourceRecord(Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), Arrays.asList("C"),1 , 1, "Q5")); + lrrList.add(new LearningResourceRecord(Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), Arrays.asList("C"),1 , 1, "Q6")); - return clList; + return lrrList; } diff --git a/src/test/java/edu/ithaca/dragon/tecmap/learningresource/ExampleLearningObjectResponseFactory.java b/src/test/java/edu/ithaca/dragon/tecmap/learningresource/ExampleLearningObjectResponseFactory.java index 07b5b92..dfaaff7 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/learningresource/ExampleLearningObjectResponseFactory.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/learningresource/ExampleLearningObjectResponseFactory.java @@ -15,26 +15,26 @@ public class ExampleLearningObjectResponseFactory { public static List makeSimpleResponses(){ List responses = new ArrayList<>(); - responses.add(new AssessmentItemResponse("student1", "Q1", 1)); - responses.add(new AssessmentItemResponse("student1", "Q2", 1)); - responses.add(new AssessmentItemResponse("student1", "Q3", 1)); - responses.add(new AssessmentItemResponse("student1", "Q4", 1)); - responses.add(new AssessmentItemResponse("student1", "Q5", 1)); - responses.add(new AssessmentItemResponse("student1", "Q6", 1)); + responses.add(new AssessmentItemResponse("student1", "_PracticeProblem1","Q1", 1)); + responses.add(new AssessmentItemResponse("student1", "_PracticeProblem2","Q2", 1)); + responses.add(new AssessmentItemResponse("student1", "_PracticeProblem3","Q3", 1)); + responses.add(new AssessmentItemResponse("student1", "_PracticeProblem4","Q4", 1)); + responses.add(new AssessmentItemResponse("student1", "_PracticeProblem5","Q5", 1)); + responses.add(new AssessmentItemResponse("student1", "_PracticeProblem6","Q6", 1)); - responses.add(new AssessmentItemResponse("student2", "Q1", 1)); - responses.add(new AssessmentItemResponse("student2", "Q2", 1)); - responses.add(new AssessmentItemResponse("student2", "Q3", 1)); - responses.add(new AssessmentItemResponse("student2", "Q4", 0)); - responses.add(new AssessmentItemResponse("student2", "Q5", 0)); - responses.add(new AssessmentItemResponse("student2", "Q6", 0)); + responses.add(new AssessmentItemResponse("student2", "_PracticeProblem1","Q1", 1)); + responses.add(new AssessmentItemResponse("student2", "_PracticeProblem2","Q2", 1)); + responses.add(new AssessmentItemResponse("student2", "_PracticeProblem3","Q3", 1)); + responses.add(new AssessmentItemResponse("student2", "_PracticeProblem4","Q4", 0)); + responses.add(new AssessmentItemResponse("student2", "_PracticeProblem5","Q5", 0)); + responses.add(new AssessmentItemResponse("student2", "_PracticeProblem6","Q6", 0)); - responses.add(new AssessmentItemResponse("student3", "Q1", 1)); - responses.add(new AssessmentItemResponse("student3", "Q2", 1)); - responses.add(new AssessmentItemResponse("student3", "Q3", 0)); - responses.add(new AssessmentItemResponse("student3", "Q4", 0)); + responses.add(new AssessmentItemResponse("student3", "_PracticeProblem1","Q1", 1)); + responses.add(new AssessmentItemResponse("student3", "_PracticeProblem2","Q2", 1)); + responses.add(new AssessmentItemResponse("student3", "_PracticeProblem3","Q3", 0)); + responses.add(new AssessmentItemResponse("student3", "_PracticeProblem4","Q4", 0)); return responses; } @@ -42,15 +42,15 @@ public static List makeSimpleResponses(){ public static Map makeSimpleLearningObjectMap(){ Map los = new HashMap<>(); - los.put("Q1", new AssessmentItem("Q1")); - los.put("Q2", new AssessmentItem("Q2")); - los.put("Q3", new AssessmentItem("Q3")); - los.put("Q4", new AssessmentItem("Q4")); - los.put("Q5", new AssessmentItem("Q5")); - los.put("Q6", new AssessmentItem("Q6")); + los.put("Q1", new AssessmentItem("_PracticeProblem1","Q1")); + los.put("Q2", new AssessmentItem("_PracticeProblem2","Q2")); + los.put("Q3", new AssessmentItem("_PracticeProblem3","Q3")); + los.put("Q4", new AssessmentItem("_PracticeProblem4","Q4")); + los.put("Q5", new AssessmentItem("_PracticeProblem5","Q5")); + los.put("Q6", new AssessmentItem("_PracticeProblem6","Q6")); for (AssessmentItemResponse resp : makeSimpleResponses()){ - los.get(resp.getLearningObjectId()).addResponse(resp); + los.get(resp.getAssessmentItemText()).addResponse(resp); } return los; } diff --git a/src/test/java/edu/ithaca/dragon/tecmap/legacy/ConceptKnowledgeCalculatorTest.java b/src/test/java/edu/ithaca/dragon/tecmap/legacy/ConceptKnowledgeCalculatorTest.java index 5dd4626..b7dd029 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/legacy/ConceptKnowledgeCalculatorTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/legacy/ConceptKnowledgeCalculatorTest.java @@ -1,12 +1,12 @@ package edu.ithaca.dragon.tecmap.legacy; +import com.opencsv.exceptions.CsvException; import edu.ithaca.dragon.tecmap.Settings; import edu.ithaca.dragon.tecmap.conceptgraph.CohortConceptGraphs; import edu.ithaca.dragon.tecmap.conceptgraph.ConceptGraph; import edu.ithaca.dragon.tecmap.io.record.LearningResourceRecord; import edu.ithaca.dragon.tecmap.learningresource.AssessmentItem; import edu.ithaca.dragon.tecmap.learningresource.AssessmentItemResponse; -import edu.ithaca.dragon.tecmap.suggester.ConceptGraphSuggesterLibrary; import edu.ithaca.dragon.tecmap.suggester.GroupSuggester.*; import edu.ithaca.dragon.tecmap.suggester.LearningResourceSuggestion; import edu.ithaca.dragon.tecmap.suggester.OrganizedLearningResourceSuggestions; @@ -38,10 +38,9 @@ public void realDataCreateSmallGroupTest(){ ckc = new ConceptKnowledgeCalculator(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/researchConceptGraph.json", Settings.TEST_RESOURCE_DIR + "ManuallyCreated/researchResource1.json", Settings.TEST_RESOURCE_DIR + "ManuallyCreated/researchAssessment1.csv"); - } catch (IOException e) { + } catch (IOException | CsvException e) { fail("Unable to load default files. Test unable to run"); } - //set up for buckets List> ranges = new ArrayList<>(); List temp = new ArrayList<>(); @@ -95,7 +94,7 @@ public void getModeTest(){ ckc = new ConceptKnowledgeCalculator(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticConceptGraph.json", Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticResource.json", Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); assertEquals(ckc.getCurrentMode(), ConceptKnowledgeCalculator.Mode.COHORTGRAPH); - } catch (IOException e) { + } catch (IOException | CsvException e) { fail("Unable to load default files. Test unable to run"); } } @@ -106,7 +105,7 @@ public void getCohortData(){ try { ckc = new ConceptKnowledgeCalculator(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticConceptGraph.json", Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticResource.json", Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); assertEquals(ckc.currentStructure().get(0),Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticConceptGraph.json" ); - } catch (IOException e) { + } catch (IOException | CsvException e) { fail("Unable to load default files. Test unable to run"); } } @@ -117,7 +116,7 @@ public void calcIndividualConceptNodesSuggestionsTest(){ ConceptKnowledgeCalculatorAPI ckc = null; try { ckc = new ConceptKnowledgeCalculator(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticConceptGraph.json", Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticResource.json", Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); - } catch (IOException e) { + } catch (IOException | CsvException e) { fail("Unable to load default files. Test unable to run"); } @@ -253,7 +252,7 @@ public void calcIndividualGraphSuggestionsTest(){ ConceptKnowledgeCalculatorAPI ckc = null; try { ckc = new ConceptKnowledgeCalculator(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticConceptGraph.json", Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticResource.json", Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); - } catch (IOException e) { + } catch (IOException | CsvException e) { fail("Unable to load default files. Test unable to run"); } @@ -289,7 +288,7 @@ public void realDataCalcIndividualGraphSuggestionsTest(){ Settings.TEST_RESOURCE_DIR + "ManuallyCreated/comp220Resources.json", Settings.TEST_RESOURCE_DIR + "ManuallyCreated/exampleDataAssessment.csv"); - } catch (IOException e) { + } catch (IOException | CsvException e) { fail("Unable to load default files. Test unable to run"); } @@ -332,7 +331,7 @@ public void realDataCalcIndividualGraphSuggestionsTest2(){ Settings.TEST_RESOURCE_DIR + "ManuallyCreated/comp220Resources.json", Settings.TEST_RESOURCE_DIR + "ManuallyCreated/exampleDataAssessment.csv"); - } catch (IOException e) { + } catch (IOException | CsvException e) { fail("Unable to load default files. Test unable to run"); } @@ -393,7 +392,7 @@ public void calcIndividualSpecificConceptSuggestionsTest(){ ConceptKnowledgeCalculatorAPI ckc = null; try { ckc = new ConceptKnowledgeCalculator(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticConceptGraph.json", Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticResource.json", Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); - } catch (IOException e) { + } catch (IOException | CsvException e) { fail("Unable to load default files. Test unable to run"); @@ -437,20 +436,20 @@ public void addAssignmentTest(){ assertEquals(originalMasterList.size(), 11); - assertEquals(originalMasterList.get(0).getLearningObjectId(), "Q1"); - assertEquals(originalMasterList.get(1).getLearningObjectId(), "Q2"); - assertEquals(originalMasterList.get(2).getLearningObjectId(), "Q4"); - assertEquals(originalMasterList.get(3).getLearningObjectId(), "Q5"); - assertEquals(originalMasterList.get(4).getLearningObjectId(), "Q7"); - assertEquals(originalMasterList.get(5).getLearningObjectId(), "Q8"); - assertEquals(originalMasterList.get(6).getLearningObjectId(), "Q9"); - assertEquals(originalMasterList.get(7).getLearningObjectId(), "Q11"); - assertEquals(originalMasterList.get(8).getLearningObjectId(), "Q12"); - assertEquals(originalMasterList.get(9).getLearningObjectId(), "Q15"); - assertEquals(originalMasterList.get(10).getLearningObjectId(), "Q14"); - - - } catch (IOException e) { + assertEquals(originalMasterList.get(0).getAssessmentItemText(), "Q1"); + assertEquals(originalMasterList.get(1).getAssessmentItemText(), "Q2"); + assertEquals(originalMasterList.get(2).getAssessmentItemText(), "Q4"); + assertEquals(originalMasterList.get(3).getAssessmentItemText(), "Q5"); + assertEquals(originalMasterList.get(4).getAssessmentItemText(), "Q7"); + assertEquals(originalMasterList.get(5).getAssessmentItemText(), "Q8"); + assertEquals(originalMasterList.get(6).getAssessmentItemText(), "Q9"); + assertEquals(originalMasterList.get(7).getAssessmentItemText(), "Q11"); + assertEquals(originalMasterList.get(8).getAssessmentItemText(), "Q12"); + assertEquals(originalMasterList.get(9).getAssessmentItemText(), "Q15"); + assertEquals(originalMasterList.get(10).getAssessmentItemText(), "Q14"); + + + } catch (IOException | CsvException e) { fail("Unable to load default files. Test unable to run"); } @@ -475,25 +474,25 @@ public void addAssignmentTest(){ assertEquals(postMasterList1.size(), 19); - assertEquals(postMasterList1.get(0).getLearningObjectId(), "Q1"); - assertEquals(postMasterList1.get(1).getLearningObjectId(), "Q2"); - assertEquals(postMasterList1.get(2).getLearningObjectId(), "Q3"); - assertEquals(postMasterList1.get(3).getLearningObjectId(), "Q4"); - assertEquals(postMasterList1.get(4).getLearningObjectId(), "Q4"); - assertEquals(postMasterList1.get(5).getLearningObjectId(), "Q5"); - assertEquals(postMasterList1.get(6).getLearningObjectId(), "Q5"); - assertEquals(postMasterList1.get(7).getLearningObjectId(), "Q6"); - assertEquals(postMasterList1.get(8).getLearningObjectId(), "Q7"); - assertEquals(postMasterList1.get(9).getLearningObjectId(), "Q7"); - assertEquals(postMasterList1.get(10).getLearningObjectId(), "Q8"); - assertEquals(postMasterList1.get(11).getLearningObjectId(), "Q9"); - assertEquals(postMasterList1.get(12).getLearningObjectId(), "Q9"); - assertEquals(postMasterList1.get(13).getLearningObjectId(), "Q11"); - assertEquals(postMasterList1.get(14).getLearningObjectId(), "Q11"); - assertEquals(postMasterList1.get(15).getLearningObjectId(), "Q12"); - assertEquals(postMasterList1.get(16).getLearningObjectId(), "Q15"); - assertEquals(postMasterList1.get(17).getLearningObjectId(), "Q14"); - assertEquals(postMasterList1.get(18).getLearningObjectId(), "Q14"); + assertEquals(postMasterList1.get(0).getAssessmentItemText(), "Q1"); + assertEquals(postMasterList1.get(1).getAssessmentItemText(), "Q2"); + assertEquals(postMasterList1.get(2).getAssessmentItemText(), "Q3"); + assertEquals(postMasterList1.get(3).getAssessmentItemText(), "Q4"); + assertEquals(postMasterList1.get(4).getAssessmentItemText(), "Q4"); + assertEquals(postMasterList1.get(5).getAssessmentItemText(), "Q5"); + assertEquals(postMasterList1.get(6).getAssessmentItemText(), "Q5"); + assertEquals(postMasterList1.get(7).getAssessmentItemText(), "Q6"); + assertEquals(postMasterList1.get(8).getAssessmentItemText(), "Q7"); + assertEquals(postMasterList1.get(9).getAssessmentItemText(), "Q7"); + assertEquals(postMasterList1.get(10).getAssessmentItemText(), "Q8"); + assertEquals(postMasterList1.get(11).getAssessmentItemText(), "Q9"); + assertEquals(postMasterList1.get(12).getAssessmentItemText(), "Q9"); + assertEquals(postMasterList1.get(13).getAssessmentItemText(), "Q11"); + assertEquals(postMasterList1.get(14).getAssessmentItemText(), "Q11"); + assertEquals(postMasterList1.get(15).getAssessmentItemText(), "Q12"); + assertEquals(postMasterList1.get(16).getAssessmentItemText(), "Q15"); + assertEquals(postMasterList1.get(17).getAssessmentItemText(), "Q14"); + assertEquals(postMasterList1.get(18).getAssessmentItemText(), "Q14"); } catch (Exception e) { e.printStackTrace(); @@ -516,23 +515,23 @@ public void addAssignmentTest(){ } assertEquals(postMasterList2.size(), 25); - assertEquals(postMasterList2.get(0).getLearningObjectId(), "Q1"); - assertEquals(postMasterList2.get(1).getLearningObjectId(), "Q1"); - assertEquals(postMasterList2.get(2).getLearningObjectId(), "Q2"); - assertEquals(postMasterList2.get(3).getLearningObjectId(), "Q2"); - assertEquals(postMasterList2.get(4).getLearningObjectId(), "Q3"); - assertEquals(postMasterList2.get(5).getLearningObjectId(), "Q3"); - assertEquals(postMasterList2.get(6).getLearningObjectId(), "Q4"); - assertEquals(postMasterList2.get(8).getLearningObjectId(), "Q4"); - assertEquals(postMasterList2.get(10).getLearningObjectId(), "Q5"); - assertEquals(postMasterList2.get(12).getLearningObjectId(), "Q6"); - assertEquals(postMasterList2.get(14).getLearningObjectId(), "Q7"); - assertEquals(postMasterList2.get(16).getLearningObjectId(), "Q8"); - assertEquals(postMasterList2.get(18).getLearningObjectId(), "Q9"); - assertEquals(postMasterList2.get(20).getLearningObjectId(), "Q11"); - assertEquals(postMasterList2.get(22).getLearningObjectId(), "Q15"); - assertEquals(postMasterList2.get(23).getLearningObjectId(), "Q14"); - assertEquals(postMasterList2.get(24).getLearningObjectId(), "Q14"); + assertEquals(postMasterList2.get(0).getAssessmentItemText(), "Q1"); + assertEquals(postMasterList2.get(1).getAssessmentItemText(), "Q1"); + assertEquals(postMasterList2.get(2).getAssessmentItemText(), "Q2"); + assertEquals(postMasterList2.get(3).getAssessmentItemText(), "Q2"); + assertEquals(postMasterList2.get(4).getAssessmentItemText(), "Q3"); + assertEquals(postMasterList2.get(5).getAssessmentItemText(), "Q3"); + assertEquals(postMasterList2.get(6).getAssessmentItemText(), "Q4"); + assertEquals(postMasterList2.get(8).getAssessmentItemText(), "Q4"); + assertEquals(postMasterList2.get(10).getAssessmentItemText(), "Q5"); + assertEquals(postMasterList2.get(12).getAssessmentItemText(), "Q6"); + assertEquals(postMasterList2.get(14).getAssessmentItemText(), "Q7"); + assertEquals(postMasterList2.get(16).getAssessmentItemText(), "Q8"); + assertEquals(postMasterList2.get(18).getAssessmentItemText(), "Q9"); + assertEquals(postMasterList2.get(20).getAssessmentItemText(), "Q11"); + assertEquals(postMasterList2.get(22).getAssessmentItemText(), "Q15"); + assertEquals(postMasterList2.get(23).getAssessmentItemText(), "Q14"); + assertEquals(postMasterList2.get(24).getAssessmentItemText(), "Q14"); @@ -552,7 +551,7 @@ public void removeLORFileTest(){ List test = new ArrayList<>(); test.add(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); assertEquals(ckc.currentAssessment(),test); - } catch (IOException e) { + } catch (IOException | CsvException e) { fail("Unable to load default files. Test unable to run"); } @@ -623,22 +622,22 @@ public void addLOFileTest(){ assertEquals(originalMasterList.size(), 15); - assertEquals(originalMasterList.get(0).getId(), "Q1"); - assertEquals(originalMasterList.get(1).getId(), "Q2"); - assertEquals(originalMasterList.get(2).getId(), "Q3"); - assertEquals(originalMasterList.get(3).getId(), "Q4"); - assertEquals(originalMasterList.get(4).getId(), "Q5"); - assertEquals(originalMasterList.get(5).getId(), "Q6"); - assertEquals(originalMasterList.get(6).getId(), "Q7"); - assertEquals(originalMasterList.get(7).getId(), "Q8"); - assertEquals(originalMasterList.get(8).getId(), "Q9"); - assertEquals(originalMasterList.get(9).getId(), "Q11"); - assertEquals(originalMasterList.get(10).getId(), "Q10"); - assertEquals(originalMasterList.get(11).getId(), "Q13"); - assertEquals(originalMasterList.get(12).getId(), "Q12"); - assertEquals(originalMasterList.get(13).getId(), "Q15"); - assertEquals(originalMasterList.get(14).getId(), "Q14"); - } catch (IOException e) { + assertEquals(originalMasterList.get(0).getText(), "Q1"); + assertEquals(originalMasterList.get(1).getText(), "Q2"); + assertEquals(originalMasterList.get(2).getText(), "Q3"); + assertEquals(originalMasterList.get(3).getText(), "Q4"); + assertEquals(originalMasterList.get(4).getText(), "Q5"); + assertEquals(originalMasterList.get(5).getText(), "Q6"); + assertEquals(originalMasterList.get(6).getText(), "Q7"); + assertEquals(originalMasterList.get(7).getText(), "Q8"); + assertEquals(originalMasterList.get(8).getText(), "Q9"); + assertEquals(originalMasterList.get(9).getText(), "Q11"); + assertEquals(originalMasterList.get(10).getText(), "Q10"); + assertEquals(originalMasterList.get(11).getText(), "Q13"); + assertEquals(originalMasterList.get(12).getText(), "Q12"); + assertEquals(originalMasterList.get(13).getText(), "Q15"); + assertEquals(originalMasterList.get(14).getText(), "Q14"); + } catch (IOException | CsvException e) { fail("Unable to load default files. Test unable to run"); } @@ -659,21 +658,21 @@ public void addLOFileTest(){ assertEquals(postMasterList.size(), 15); - assertEquals(postMasterList.get(0).getId(), "Q1"); - assertEquals(postMasterList.get(1).getId(), "Q2"); - assertEquals(postMasterList.get(2).getId(), "Q5"); - assertEquals(postMasterList.get(3).getId(), "Q7"); - assertEquals(postMasterList.get(4).getId(), "Q8"); - assertEquals(postMasterList.get(5).getId(), "resource2"); - assertEquals(postMasterList.get(6).getId(), "Q9"); - assertEquals(postMasterList.get(7).getId(), "resource3"); - assertEquals(postMasterList.get(8).getId(), "resource4"); - assertEquals(postMasterList.get(9).getId(), "resource5"); - assertEquals(postMasterList.get(10).getId(), "resource1"); - assertEquals(postMasterList.get(11).getId(), "Q10"); - assertEquals(postMasterList.get(12).getId(), "Q13"); - assertEquals(postMasterList.get(13).getId(), "Q12"); - assertEquals(postMasterList.get(14).getId(), "Q14"); + assertEquals(postMasterList.get(0).getText(), "Q1"); + assertEquals(postMasterList.get(1).getText(), "Q2"); + assertEquals(postMasterList.get(2).getText(), "Q5"); + assertEquals(postMasterList.get(3).getText(), "Q7"); + assertEquals(postMasterList.get(4).getText(), "Q8"); + assertEquals(postMasterList.get(5).getText(), "resource2"); + assertEquals(postMasterList.get(6).getText(), "Q9"); + assertEquals(postMasterList.get(7).getText(), "resource3"); + assertEquals(postMasterList.get(8).getText(), "resource4"); + assertEquals(postMasterList.get(9).getText(), "resource5"); + assertEquals(postMasterList.get(10).getText(), "resource1"); + assertEquals(postMasterList.get(11).getText(), "Q10"); + assertEquals(postMasterList.get(12).getText(), "Q13"); + assertEquals(postMasterList.get(13).getText(), "Q12"); + assertEquals(postMasterList.get(14).getText(), "Q14"); } catch (Exception e) { e.printStackTrace(); @@ -802,7 +801,7 @@ public void modeTest(){ getTest.clear(); getTest.add(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/simpleResource.json"); - assertEquals(ckc.currentResource(), getTest); + assertEquals(ckc.currentResource(), getTest); getTest.clear(); assertEquals(ckc.currentAssessment(), new ArrayList<>()); @@ -866,7 +865,7 @@ public void noDataMode(){ ckc = new ConceptKnowledgeCalculator("test.json", "test.json", "test.csv"); assertNotEquals(ckc.getCurrentMode(), ConceptKnowledgeCalculator.Mode.NODATA); - } catch (IOException e) { + } catch (IOException | CsvException e) { ckc = new ConceptKnowledgeCalculator(); assertEquals(ckc.getCurrentMode(), ConceptKnowledgeCalculator.Mode.NODATA); } @@ -878,7 +877,7 @@ public void getUserListTest() { ConceptKnowledgeCalculatorAPI ckc = null; try { ckc = new ConceptKnowledgeCalculator(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticConceptGraph.json", Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticResource.json", Settings.TEST_RESOURCE_DIR + "ManuallyCreated/basicRealisticAssessment.csv"); - } catch (IOException e) { + } catch (IOException | CsvException e) { fail("Unable to load default files" + ErrorUtil.errorToStr(e)); } List actualList = new ArrayList<>(); @@ -918,11 +917,11 @@ public void csvToResourceTest(){ List recordsFromFile = LearningResourceRecord.createLearningResourceRecordsFromJsonFile(testFilepath); assertNotNull(recordsFromFile); - //TODO:test that these LOLRecords are good compared to the input csv file, they just won't have any concepts in their lists + //TODO:test that these LRRecords are good compared to the input csv file, they just won't have any concepts in their lists LearningResourceRecord currRec = recordsFromFile.get(0); - assertEquals("Q1", currRec.getLearningResourceId()); + assertEquals("Q1", currRec.getText()); LearningResourceRecord nextRec = recordsFromFile.get(13); - assertEquals("Q14", nextRec.getLearningResourceId()); + assertEquals("Q14", nextRec.getText()); }catch (Exception e){ e.printStackTrace(); diff --git a/src/test/java/edu/ithaca/dragon/tecmap/suggester/ConceptGraphSuggesterLibraryTest.java b/src/test/java/edu/ithaca/dragon/tecmap/suggester/ConceptGraphSuggesterLibraryTest.java index e32dc0e..57bfc17 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/suggester/ConceptGraphSuggesterLibraryTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/suggester/ConceptGraphSuggesterLibraryTest.java @@ -1,11 +1,11 @@ package edu.ithaca.dragon.tecmap.suggester; +import com.opencsv.exceptions.CsvException; import edu.ithaca.dragon.tecmap.Settings; import edu.ithaca.dragon.tecmap.conceptgraph.*; -import edu.ithaca.dragon.tecmap.io.reader.TecmapCSVReader; +import edu.ithaca.dragon.tecmap.io.reader.*; import edu.ithaca.dragon.tecmap.io.record.ConceptGraphRecord; import edu.ithaca.dragon.tecmap.io.record.LearningResourceRecord; -import edu.ithaca.dragon.tecmap.io.reader.SakaiReader; import edu.ithaca.dragon.tecmap.learningresource.AssessmentItemResponse; import edu.ithaca.dragon.tecmap.learningresource.ExampleLearningObjectLinkRecordFactory; import edu.ithaca.dragon.tecmap.learningresource.ExampleLearningObjectResponseFactory; @@ -75,7 +75,7 @@ public void conceptsToWorkOnTest() { } @Test - public void RealDataConceptsTOWorkOn() throws IOException { + public void RealDataConceptsTOWorkOn() throws IOException, CsvException { CohortConceptGraphs cohortConceptGraphs = null; @@ -85,7 +85,10 @@ public void RealDataConceptsTOWorkOn() throws IOException { ConceptGraph graph = new ConceptGraph(structureRecord, linkRecord); //create the data to be used to create and populate the graph copies - TecmapCSVReader tecmapCsvReader = new SakaiReader(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/exampleDataAssessment.csv"); + List rows = CsvFileLibrary.parseRowsFromFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/exampleDataAssessment.csv"); + List processors = new ArrayList<>(); + processors.add(new CreateMaxScoreRow()); + TecmapCSVReader tecmapCsvReader = new SakaiReader(rows, processors); List assessments = tecmapCsvReader.getManualGradedResponses(); //create the average and individual graphs @@ -104,7 +107,7 @@ public void RealDataConceptsTOWorkOn() throws IOException { @Test - public void RealDataConceptsTOWorkOnZeroSugg() throws IOException { + public void RealDataConceptsTOWorkOnZeroSugg() throws IOException, CsvException { CohortConceptGraphs cohortConceptGraphs = null; @@ -114,7 +117,10 @@ public void RealDataConceptsTOWorkOnZeroSugg() throws IOException { ConceptGraph graph = new ConceptGraph(structureRecord, linkRecord); //create the data to be used to create and populate the graph copies - TecmapCSVReader tecmapCsvReader = new SakaiReader(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/exampleDataAssessment.csv"); + List rows = CsvFileLibrary.parseRowsFromFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/exampleDataAssessment.csv"); + List processors = new ArrayList<>(); + processors.add(new CreateMaxScoreRow()); + TecmapCSVReader tecmapCsvReader = new SakaiReader(rows, processors); List assessments = tecmapCsvReader.getManualGradedResponses(); //create the average and individual graphs @@ -170,7 +176,7 @@ public void buildSuggestionMapWillOneStudentTest() { @Test public void suggestedOrderBuildLearningObjectListTest() { List myList = ExampleLearningObjectLinkRecordFactory.makeSimpleLOLRecords(); - myList.add(new LearningResourceRecord("Q10", Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), Arrays.asList("A"), 1, 1)); + myList.add(new LearningResourceRecord(Arrays.asList(LearningResourceType.ASSESSMENT, LearningResourceType.PRACTICE), Arrays.asList("A"), 1, 1, "Q10")); ConceptGraph orig = new ConceptGraph(ExampleConceptGraphRecordFactory.makeSimple(), myList, ExampleLearningObjectResponseFactory.makeSimpleResponses()); @@ -187,12 +193,11 @@ public void suggestedOrderBuildLearningObjectListTest() { Map learningSummaryFromA = orig.buildLearningResourcePathCount("A"); Map linkMap = orig.buildDirectConceptLinkCount(); - //makes sure that buildLearningMaterialPathCount works assertEquals(testCompareA, learningSummaryFromA); //build the suggested learning object list - List suggestedList = ConceptGraphSuggesterLibrary.buildLearningResourceSuggestionList(learningSummaryFromA, orig.getAssessmentItemMap(), "A", linkMap); + List suggestedList = ConceptGraphSuggesterLibrary.buildAssessmentItemSuggestionList(learningSummaryFromA, orig.getAssessmentItemMap(), "A", linkMap); //this is ordered based on "level" @@ -226,10 +231,11 @@ public void toStringTest() { List concepts = ConceptGraphSuggesterLibrary.suggestConcepts(orig); OrganizedLearningResourceSuggestions res = new OrganizedLearningResourceSuggestions(orig, concepts); - String incomString = res.toString(0); + System.out.println("incomplete: " + incomString); String wrongString = res.toString(1); + System.out.println("wrong: " + wrongString); assertEquals(incomString, "Resource: Q6\t Concepts it relates to: Boolean\t Importance: 1\t Direct Concept Links: 1" + @@ -246,7 +252,7 @@ public void toStringTest() { @Test - public void toStringTest2()throws IOException{ + public void toStringTest2() throws IOException, CsvException { CohortConceptGraphs cohortConceptGraphs = null; //create the graph structure to be copied for each user @@ -255,7 +261,10 @@ public void toStringTest2()throws IOException{ ConceptGraph graph = new ConceptGraph(structureRecord, linkRecord); //create the data to be used to create and populate the graph copies - TecmapCSVReader tecmapCsvReader = new SakaiReader(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/exampleDataAssessment.csv"); + List rows = CsvFileLibrary.parseRowsFromFile(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/exampleDataAssessment.csv"); + List processors = new ArrayList<>(); + processors.add(new CanvasConverter()); + TecmapCSVReader tecmapCsvReader = new CanvasReader(rows, processors); List assessments = tecmapCsvReader.getManualGradedResponses(); //create the average and individual graphs @@ -282,4 +291,24 @@ public void toStringTest2()throws IOException{ "\nResource: Lab 2: Array Library\t Concepts it relates to: Pointers\t Importance: 1\t Direct Concept Links: 3\n"); } + + @Test + void buildLearningMaterialSuggestionListTest() throws IOException, CsvException { + ConceptGraphRecord structureRecord = ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "comp220_Summer2024/graph.json"); + List linkRecord = LearningResourceRecord.createLearningResourceRecordsFromJsonFile(Settings.TEST_RESOURCE_DIR + "comp220_Summer2024/learningResources.json"); + ConceptGraph graph = new ConceptGraph(structureRecord, linkRecord); + + //create the data to be used to create and populate the graph copies + List rows = CsvFileLibrary.parseRowsFromFile(Settings.TEST_RESOURCE_DIR + "comp220_Summer2024/gradesCanvasFormat.csv"); + List processors = new ArrayList<>(); + TecmapCSVReader tecmapCsvReader = new CanvasReader(rows, processors); + List assessments = tecmapCsvReader.getManualGradedResponses(); + + //create the average and individual graphs + CohortConceptGraphs cohortConceptGraphs = new CohortConceptGraphs(graph, assessments); + ConceptGraph userGraph3 = cohortConceptGraphs.getUserGraph("s03"); + List concepts3 = ConceptGraphSuggesterLibrary.suggestConcepts(userGraph3); + List lmSuggestions = ConceptGraphSuggesterLibrary.buildLearningMaterialSuggestionList(concepts3); + System.out.println(lmSuggestions); + } } \ No newline at end of file diff --git a/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/BucketSuggesterTest.java b/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/BucketSuggesterTest.java index 16c8f6a..e57c7ef 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/BucketSuggesterTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/BucketSuggesterTest.java @@ -1,5 +1,6 @@ package edu.ithaca.dragon.tecmap.suggester.GroupSuggester; +import com.opencsv.exceptions.CsvException; import edu.ithaca.dragon.tecmap.Settings; import edu.ithaca.dragon.tecmap.conceptgraph.CohortConceptGraphs; import edu.ithaca.dragon.tecmap.conceptgraph.ConceptGraph; @@ -22,7 +23,7 @@ public class BucketSuggesterTest { private Map graphs; @BeforeEach - public void setup() throws IOException { + public void setup() throws IOException, CsvException { ConceptGraph graph = new ConceptGraph(ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/researchConceptGraph.json")); List assessmentItemResponses = AssessmentItemResponse.createAssessmentItemResponses(Arrays.asList(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/researchAssessment2.csv")); List links = LearningResourceRecord.createLearningResourceRecordsFromJsonFiles(Arrays.asList(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/researchResource2.json")); diff --git a/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/ComplementaryKnowledgeSuggesterTest.java b/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/ComplementaryKnowledgeSuggesterTest.java index ecb37bd..2e1073b 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/ComplementaryKnowledgeSuggesterTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/ComplementaryKnowledgeSuggesterTest.java @@ -1,5 +1,6 @@ package edu.ithaca.dragon.tecmap.suggester.GroupSuggester; +import com.opencsv.exceptions.CsvException; import edu.ithaca.dragon.tecmap.Settings; import edu.ithaca.dragon.tecmap.conceptgraph.CohortConceptGraphs; import edu.ithaca.dragon.tecmap.conceptgraph.ConceptGraph; @@ -18,7 +19,7 @@ class ComplementaryKnowledgeSuggesterTest { @Test - void isComplementary() throws IOException { + void isComplementary() throws IOException, CsvException { ConceptGraph graph = new ConceptGraph(ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/simpleConceptGraphTest.json")); List assessmentItemResponses = AssessmentItemResponse.createAssessmentItemResponses(Arrays.asList(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/simpleAssessmentTest.csv")); List links = LearningResourceRecord.createLearningResourceRecordsFromJsonFiles(Arrays.asList(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/simpleResourceTest.json")); diff --git a/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/ConceptSuggesterTest.java b/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/ConceptSuggesterTest.java index 46f23f0..83e4eb8 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/ConceptSuggesterTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/ConceptSuggesterTest.java @@ -1,5 +1,6 @@ package edu.ithaca.dragon.tecmap.suggester.GroupSuggester; +import com.opencsv.exceptions.CsvException; import edu.ithaca.dragon.tecmap.Settings; import edu.ithaca.dragon.tecmap.conceptgraph.CohortConceptGraphs; import edu.ithaca.dragon.tecmap.conceptgraph.ConceptGraph; @@ -23,7 +24,7 @@ public class ConceptSuggesterTest { private Map researchGraphs; @BeforeEach - public void setup() throws IOException { + public void setup() throws IOException, CsvException { ConceptGraph graph1 = new ConceptGraph(ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/researchConceptGraph.json")); List assessmentItemResponses1 = AssessmentItemResponse.createAssessmentItemResponses(Arrays.asList(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/researchAssessment2.csv")); List links1 = LearningResourceRecord.createLearningResourceRecordsFromJsonFiles(Arrays.asList(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/researchResource2.json")); diff --git a/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/GroupSuggesterTest.java b/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/GroupSuggesterTest.java index 7e72965..5f11e40 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/GroupSuggesterTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/GroupSuggesterTest.java @@ -2,6 +2,7 @@ //import edu.ithaca.dragon.tecmap.legacy.ConceptKnowledgeCalculator; //import edu.ithaca.dragon.tecmap.legacy.ConceptKnowledgeCalculatorAPI; +import com.opencsv.exceptions.CsvException; import edu.ithaca.dragon.tecmap.Settings; import edu.ithaca.dragon.tecmap.conceptgraph.CohortConceptGraphs; import edu.ithaca.dragon.tecmap.conceptgraph.ConceptGraph; @@ -29,7 +30,7 @@ public class GroupSuggesterTest { private Map researchGraphs; @BeforeEach - public void setup() throws IOException { + public void setup() throws IOException, CsvException { ConceptGraph graph = new ConceptGraph(ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/simpleConceptGraphTest.json")); List assessmentItemResponses = AssessmentItemResponse.createAssessmentItemResponses(Arrays.asList(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/simpleAssessmentTest.csv")); List links = LearningResourceRecord.createLearningResourceRecordsFromJsonFiles(Arrays.asList(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/simpleResourceTest.json")); diff --git a/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/SuggesterTest.java b/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/SuggesterTest.java index 44426d1..51d3402 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/SuggesterTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/suggester/GroupSuggester/SuggesterTest.java @@ -2,6 +2,7 @@ //import edu.ithaca.dragon.tecmap.legacy.ConceptKnowledgeCalculator; //import edu.ithaca.dragon.tecmap.legacy.ConceptKnowledgeCalculatorAPI; +import com.opencsv.exceptions.CsvException; import edu.ithaca.dragon.tecmap.Settings; import edu.ithaca.dragon.tecmap.conceptgraph.CohortConceptGraphs; import edu.ithaca.dragon.tecmap.conceptgraph.ConceptGraph; @@ -27,7 +28,7 @@ public class SuggesterTest { private Map graphs; @BeforeEach - public void setup() throws IOException { + public void setup() throws IOException, CsvException { ConceptGraph graph2 = new ConceptGraph(ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/researchConceptGraph.json")); List assessmentItemResponses2 = AssessmentItemResponse.createAssessmentItemResponses(Arrays.asList(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/researchAssessment2.csv")); List links2 = LearningResourceRecord.createLearningResourceRecordsFromJsonFiles(Arrays.asList(Settings.TEST_RESOURCE_DIR + "ManuallyCreated/researchResource2.json")); diff --git a/src/test/java/edu/ithaca/dragon/tecmap/tecmapExamples/Cs1ExampleJsonStrings.java b/src/test/java/edu/ithaca/dragon/tecmap/tecmapExamples/Cs1ExampleJsonStrings.java index decc312..db2829c 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/tecmapExamples/Cs1ExampleJsonStrings.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/tecmapExamples/Cs1ExampleJsonStrings.java @@ -166,97 +166,97 @@ public class Cs1ExampleJsonStrings { "}"; public static final String assessment1Str = "[ {\n" + - " \"learningResourceId\" : \"Q1\",\n" + " \"resourceTypes\" : [ \"ASSESSMENT\", \"PRACTICE\" ],\n" + " \"conceptIds\" : [ ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 10.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 10.0\n" + + " \"text\" : \"Q1\"\n" + "}, {\n" + - " \"learningResourceId\" : \"Q2\",\n" + " \"resourceTypes\" : [ \"ASSESSMENT\", \"PRACTICE\" ],\n" + " \"conceptIds\" : [ ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 5.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 5.0\n" + + " \"text\" : \"Q2\"\n" + "}, {\n" + - " \"learningResourceId\" : \"Q3\",\n" + " \"resourceTypes\" : [ \"ASSESSMENT\", \"PRACTICE\" ],\n" + " \"conceptIds\" : [ ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 10.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 10.0\n" + + " \"text\" : \"Q3\"\n" + "}, {\n" + - " \"learningResourceId\" : \"Q4\",\n" + " \"resourceTypes\" : [ \"ASSESSMENT\", \"PRACTICE\" ],\n" + " \"conceptIds\" : [ ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 5.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 5.0\n" + + " \"text\" : \"Q4\"\n" + "}, {\n" + - " \"learningResourceId\" : \"Q5\",\n" + " \"resourceTypes\" : [ \"ASSESSMENT\", \"PRACTICE\" ],\n" + " \"conceptIds\" : [ ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 100.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 100.0\n" + + " \"text\" : \"Q5\"\n" + "} ]"; public static final String assessment1And2Str = "[ {\n" + - " \"learningResourceId\" : \"Q1\",\n" + " \"resourceTypes\" : [ \"ASSESSMENT\", \"PRACTICE\" ],\n" + " \"conceptIds\" : [ ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 10.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 10.0\n" + + " \"text\" : \"Q1\"\n" + "}, {\n" + - " \"learningResourceId\" : \"Q2\",\n" + " \"resourceTypes\" : [ \"ASSESSMENT\", \"PRACTICE\" ],\n" + " \"conceptIds\" : [ ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 5.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 5.0\n" + + " \"text\" : \"Q2\"\n" + "}, {\n" + - " \"learningResourceId\" : \"Q3\",\n" + " \"resourceTypes\" : [ \"ASSESSMENT\", \"PRACTICE\" ],\n" + " \"conceptIds\" : [ ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 10.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 10.0\n" + + " \"text\" : \"Q3\"\n" + "}, {\n" + - " \"learningResourceId\" : \"Q4\",\n" + " \"resourceTypes\" : [ \"ASSESSMENT\", \"PRACTICE\" ],\n" + " \"conceptIds\" : [ ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 5.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 5.0\n" + + " \"text\" : \"Q4\"\n" + "}, {\n" + - " \"learningResourceId\" : \"Q5\",\n" + " \"resourceTypes\" : [ \"ASSESSMENT\", \"PRACTICE\" ],\n" + " \"conceptIds\" : [ ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 100.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 100.0\n" + + " \"text\" : \"Q5\"\n" + "}, {\n" + - " \"learningResourceId\" : \"HW1\",\n" + " \"resourceTypes\" : [ \"ASSESSMENT\", \"PRACTICE\" ],\n" + " \"conceptIds\" : [ ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 1.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 1.0\n" + + " \"text\" : \"HW1\"\n" + "}, {\n" + - " \"learningResourceId\" : \"HW2\",\n" + " \"resourceTypes\" : [ \"ASSESSMENT\", \"PRACTICE\" ],\n" + " \"conceptIds\" : [ ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 5.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 5.0\n" + + " \"text\" : \"HW2\"\n" + "}, {\n" + - " \"learningResourceId\" : \"HW3\",\n" + " \"resourceTypes\" : [ \"ASSESSMENT\", \"PRACTICE\" ],\n" + " \"conceptIds\" : [ ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 2.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 2.0\n" + + " \"text\" : \"HW3\"\n" + "}, {\n" + - " \"learningResourceId\" : \"HW4\",\n" + " \"resourceTypes\" : [ \"ASSESSMENT\", \"PRACTICE\" ],\n" + " \"conceptIds\" : [ ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 1.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 1.0\n" + + " \"text\" : \"HW4\"\n" + "}, {\n" + - " \"learningResourceId\" : \"HW5\",\n" + " \"resourceTypes\" : [ \"ASSESSMENT\", \"PRACTICE\" ],\n" + " \"conceptIds\" : [ ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 1.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 1.0\n" + + " \"text\" : \"HW5\"\n" + "} ]"; public static String allConceptsString = "[While Loops, For Loops, Boolean Expressions, Intro CS, Loops, If Statements]"; @@ -271,7 +271,7 @@ public class Cs1ExampleJsonStrings { " \"knowledgePrediction\" : 0.0,\n" + " \"knowledgeDistFromAvg\" : 0.30694444444444446,\n" + " \"dataImportance\" : 12.0,\n" + - " \"resourceSummaries\" : [ \"Q5 Est:1.000 Imp:1.000 ResponseCount:1\" ]\n" + + " \"resourceSummaries\" : [ \"Q5 Est: 1.000 Imp: 1.000 ResponseCount: 1\" ]\n" + " }, {\n" + " \"id\" : \"Loops-1\",\n" + " \"label\" : \"Loops\",\n" + @@ -279,7 +279,7 @@ public class Cs1ExampleJsonStrings { " \"knowledgePrediction\" : 0.0,\n" + " \"knowledgeDistFromAvg\" : 0.3142857142857144,\n" + " \"dataImportance\" : 7.0,\n" + - " \"resourceSummaries\" : [ \"Q4 Est:1.000 Imp:1.000 ResponseCount:1\" ]\n" + + " \"resourceSummaries\" : [ \"Q4 Est: 1.000 Imp: 1.000 ResponseCount: 1\" ]\n" + " }, {\n" + " \"id\" : \"While Loops-1\",\n" + " \"label\" : \"While Loops\",\n" + @@ -287,7 +287,7 @@ public class Cs1ExampleJsonStrings { " \"knowledgePrediction\" : 0.0,\n" + " \"knowledgeDistFromAvg\" : 0.32500000000000007,\n" + " \"dataImportance\" : 4.0,\n" + - " \"resourceSummaries\" : [ \"Q2 Est:1.000 Imp:1.000 ResponseCount:1\", \"HW4 Est:1.000 Imp:1.000 ResponseCount:1\" ]\n" + + " \"resourceSummaries\" : [ \"Q2 Est: 1.000 Imp: 1.000 ResponseCount: 1\", \"HW4 Est: 1.000 Imp: 1.000 ResponseCount: 1\" ]\n" + " }, {\n" + " \"id\" : \"Boolean Expressions-1\",\n" + " \"label\" : \"Boolean Expressions\",\n" + @@ -295,7 +295,7 @@ public class Cs1ExampleJsonStrings { " \"knowledgePrediction\" : 0.0,\n" + " \"knowledgeDistFromAvg\" : 0.3666666666666667,\n" + " \"dataImportance\" : 2.0,\n" + - " \"resourceSummaries\" : [ \"HW2 Est:1.000 Imp:1.000 ResponseCount:1\", \"HW1 Est:1.000 Imp:1.000 ResponseCount:1\" ]\n" + + " \"resourceSummaries\" : [ \"HW2 Est: 1.000 Imp: 1.000 ResponseCount: 1\", \"HW1 Est: 1.000 Imp: 1.000 ResponseCount: 1\" ]\n" + " }, {\n" + " \"id\" : \"For Loops-1\",\n" + " \"label\" : \"For Loops\",\n" + @@ -303,7 +303,7 @@ public class Cs1ExampleJsonStrings { " \"knowledgePrediction\" : 0.0,\n" + " \"knowledgeDistFromAvg\" : 0.2833333333333333,\n" + " \"dataImportance\" : 2.0,\n" + - " \"resourceSummaries\" : [ \"Q3 Est:1.000 Imp:1.000 ResponseCount:1\", \"HW5 Est:1.000 Imp:1.000 ResponseCount:1\" ]\n" + + " \"resourceSummaries\" : [ \"Q3 Est: 1.000 Imp: 1.000 ResponseCount: 1\", \"HW5 Est: 1.000 Imp: 1.000 ResponseCount: 1\" ]\n" + " }, {\n" + " \"id\" : \"If Statements-1\",\n" + " \"label\" : \"If Statements\",\n" + @@ -311,7 +311,7 @@ public class Cs1ExampleJsonStrings { " \"knowledgePrediction\" : 0.0,\n" + " \"knowledgeDistFromAvg\" : 0.30833333333333324,\n" + " \"dataImportance\" : 4.0,\n" + - " \"resourceSummaries\" : [ \"Q1 Est:1.000 Imp:1.000 ResponseCount:1\", \"HW3 Est:1.000 Imp:1.000 ResponseCount:1\" ]\n" + + " \"resourceSummaries\" : [ \"Q1 Est: 1.000 Imp: 1.000 ResponseCount: 1\", \"HW3 Est: 1.000 Imp: 1.000 ResponseCount: 1\" ]\n" + " }, {\n" + " \"id\" : \"Boolean Expressions-2\",\n" + " \"label\" : \"Boolean Expressions\",\n" + @@ -319,7 +319,7 @@ public class Cs1ExampleJsonStrings { " \"knowledgePrediction\" : 0.0,\n" + " \"knowledgeDistFromAvg\" : 0.3666666666666667,\n" + " \"dataImportance\" : 2.0,\n" + - " \"resourceSummaries\" : [ \"HW2 Est:1.000 Imp:1.000 ResponseCount:1\", \"HW1 Est:1.000 Imp:1.000 ResponseCount:1\" ]\n" + + " \"resourceSummaries\" : [ \"HW2 Est: 1.000 Imp: 1.000 ResponseCount: 1\", \"HW1 Est: 1.000 Imp: 1.000 ResponseCount: 1\" ]\n" + " } ],\n" + " \"links\" : [ {\n" + " \"parent\" : \"While Loops-1\",\n" + @@ -351,7 +351,7 @@ public class Cs1ExampleJsonStrings { " \"knowledgePrediction\" : 0.0,\n" + " \"knowledgeDistFromAvg\" : 0.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"resourceSummaries\" : [ \"Q5 Est:0.000 Imp:0.000 ResponseCount:0\" ]\n" + + " \"resourceSummaries\" : [ \"Q5 Est: 0.000 Imp: 0.000 ResponseCount: 0\" ]\n" + " }, {\n" + " \"id\" : \"Loops-1\",\n" + " \"label\" : \"Loops\",\n" + @@ -359,7 +359,7 @@ public class Cs1ExampleJsonStrings { " \"knowledgePrediction\" : 0.0,\n" + " \"knowledgeDistFromAvg\" : 0.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"resourceSummaries\" : [ \"Q4 Est:0.000 Imp:0.000 ResponseCount:0\" ]\n" + + " \"resourceSummaries\" : [ \"Q4 Est: 0.000 Imp: 0.000 ResponseCount: 0\" ]\n" + " }, {\n" + " \"id\" : \"While Loops-1\",\n" + " \"label\" : \"While Loops\",\n" + @@ -367,7 +367,7 @@ public class Cs1ExampleJsonStrings { " \"knowledgePrediction\" : 0.0,\n" + " \"knowledgeDistFromAvg\" : 0.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"resourceSummaries\" : [ \"Q2 Est:0.000 Imp:0.000 ResponseCount:0\", \"HW4 Est:0.000 Imp:0.000 ResponseCount:0\" ]\n" + + " \"resourceSummaries\" : [ \"Q2 Est: 0.000 Imp: 0.000 ResponseCount: 0\", \"HW4 Est: 0.000 Imp: 0.000 ResponseCount: 0\" ]\n" + " }, {\n" + " \"id\" : \"Boolean Expressions-1\",\n" + " \"label\" : \"Boolean Expressions\",\n" + @@ -375,7 +375,7 @@ public class Cs1ExampleJsonStrings { " \"knowledgePrediction\" : 0.0,\n" + " \"knowledgeDistFromAvg\" : 0.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"resourceSummaries\" : [ \"HW2 Est:0.000 Imp:0.000 ResponseCount:0\", \"HW1 Est:0.000 Imp:0.000 ResponseCount:0\" ]\n" + + " \"resourceSummaries\" : [ \"HW2 Est: 0.000 Imp: 0.000 ResponseCount: 0\", \"HW1 Est: 0.000 Imp: 0.000 ResponseCount: 0\" ]\n" + " }, {\n" + " \"id\" : \"For Loops-1\",\n" + " \"label\" : \"For Loops\",\n" + @@ -383,7 +383,7 @@ public class Cs1ExampleJsonStrings { " \"knowledgePrediction\" : 0.0,\n" + " \"knowledgeDistFromAvg\" : 0.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"resourceSummaries\" : [ \"Q3 Est:0.000 Imp:0.000 ResponseCount:0\", \"HW5 Est:0.000 Imp:0.000 ResponseCount:0\" ]\n" + + " \"resourceSummaries\" : [ \"Q3 Est: 0.000 Imp: 0.000 ResponseCount: 0\", \"HW5 Est: 0.000 Imp: 0.000 ResponseCount: 0\" ]\n" + " }, {\n" + " \"id\" : \"If Statements-1\",\n" + " \"label\" : \"If Statements\",\n" + @@ -391,7 +391,7 @@ public class Cs1ExampleJsonStrings { " \"knowledgePrediction\" : 0.0,\n" + " \"knowledgeDistFromAvg\" : 0.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"resourceSummaries\" : [ \"Q1 Est:0.000 Imp:0.000 ResponseCount:0\", \"HW3 Est:0.000 Imp:0.000 ResponseCount:0\" ]\n" + + " \"resourceSummaries\" : [ \"Q1 Est: 0.000 Imp: 0.000 ResponseCount: 0\", \"HW3 Est: 0.000 Imp: 0.000 ResponseCount: 0\" ]\n" + " }, {\n" + " \"id\" : \"Boolean Expressions-2\",\n" + " \"label\" : \"Boolean Expressions\",\n" + @@ -399,7 +399,7 @@ public class Cs1ExampleJsonStrings { " \"knowledgePrediction\" : 0.0,\n" + " \"knowledgeDistFromAvg\" : 0.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"resourceSummaries\" : [ \"HW2 Est:0.000 Imp:0.000 ResponseCount:0\", \"HW1 Est:0.000 Imp:0.000 ResponseCount:0\" ]\n" + + " \"resourceSummaries\" : [ \"HW2 Est: 0.000 Imp: 0.000 ResponseCount: 0\", \"HW1 Est: 0.000 Imp: 0.000 ResponseCount: 0\" ]\n" + " } ],\n" + " \"links\" : [ {\n" + " \"parent\" : \"While Loops-1\",\n" + @@ -423,64 +423,64 @@ public class Cs1ExampleJsonStrings { "}"; public static final String resourcesConnectedString = "[ {\n" + - " \"learningResourceId\" : \"Q1\",\n" + " \"resourceTypes\" : [ \"PRACTICE\" ],\n" + " \"conceptIds\" : [ \"If Statements\" ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 10.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 10.0\n" + + " \"text\" : \"Q1\"\n" + "}, {\n" + - " \"learningResourceId\" : \"Q2\",\n" + " \"resourceTypes\" : [ \"PRACTICE\" ],\n" + " \"conceptIds\" : [ \"While Loops\" ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 5.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 5.0\n" + + " \"text\" : \"Q2\"\n" + "}, {\n" + - " \"learningResourceId\" : \"Q3\",\n" + " \"resourceTypes\" : [ \"PRACTICE\" ],\n" + " \"conceptIds\" : [ \"For Loops\" ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 10.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 10.0\n" + + " \"text\" : \"Q3\"\n" + "}, {\n" + - " \"learningResourceId\" : \"Q4\",\n" + " \"resourceTypes\" : [ \"PRACTICE\" ],\n" + " \"conceptIds\" : [ \"Loops\" ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 5.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 5.0\n" + + " \"text\" : \"Q4\"\n" + "}, {\n" + - " \"learningResourceId\" : \"Q5\",\n" + " \"resourceTypes\" : [ \"PRACTICE\" ],\n" + " \"conceptIds\" : [ \"Intro CS\" ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 100.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 100.0\n" + + " \"text\" : \"Q5\"\n" + "}, {\n" + - " \"learningResourceId\" : \"HW1\",\n" + " \"resourceTypes\" : [ \"PRACTICE\" ],\n" + " \"conceptIds\" : [ \"Boolean Expressions\" ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 1.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 1.0\n" + + " \"text\" : \"HW1\"\n" + "}, {\n" + - " \"learningResourceId\" : \"HW2\",\n" + " \"resourceTypes\" : [ \"PRACTICE\" ],\n" + " \"conceptIds\" : [ \"Boolean Expressions\" ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 5.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 5.0\n" + + " \"text\" : \"HW2\"\n" + "}, {\n" + - " \"learningResourceId\" : \"HW3\",\n" + " \"resourceTypes\" : [ \"PRACTICE\" ],\n" + " \"conceptIds\" : [ \"If Statements\" ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 2.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 2.0\n" + + " \"text\" : \"HW3\"\n" + "}, {\n" + - " \"learningResourceId\" : \"HW4\",\n" + " \"resourceTypes\" : [ \"PRACTICE\" ],\n" + " \"conceptIds\" : [ \"While Loops\" ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 1.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 1.0\n" + + " \"text\" : \"HW4\"\n" + "}, {\n" + - " \"learningResourceId\" : \"HW5\",\n" + " \"resourceTypes\" : [ \"PRACTICE\" ],\n" + " \"conceptIds\" : [ \"For Loops\" ],\n" + + " \"maxPossibleKnowledgeEstimate\" : 1.0,\n" + " \"dataImportance\" : 0.0,\n" + - " \"maxPossibleKnowledgeEstimate\" : 1.0\n" + + " \"text\" : \"HW5\"\n" + "} ]"; } \ No newline at end of file diff --git a/src/test/java/edu/ithaca/dragon/tecmap/tecmapstate/AssessmentLinkedStateTest.java b/src/test/java/edu/ithaca/dragon/tecmap/tecmapstate/AssessmentLinkedStateTest.java index 0162b94..df6eb58 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/tecmapstate/AssessmentLinkedStateTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/tecmapstate/AssessmentLinkedStateTest.java @@ -1,5 +1,6 @@ package edu.ithaca.dragon.tecmap.tecmapstate; +import com.opencsv.exceptions.CsvException; import edu.ithaca.dragon.tecmap.Settings; import edu.ithaca.dragon.tecmap.conceptgraph.ConceptGraph; import edu.ithaca.dragon.tecmap.io.reader.ReaderTools; @@ -20,7 +21,7 @@ class AssessmentLinkedStateTest { @Test - void createCohortTree() throws IOException { + void createCohortTree() throws IOException, CsvException { List assessmentFiles = new ArrayList<>(Arrays.asList(Settings.TEST_RESOURCE_DIR + "tecmapExamples/Cs1ExampleAssessment1.csv", Settings.TEST_RESOURCE_DIR + "tecmapExamples/Cs1ExampleAssessment2.csv")); @@ -28,7 +29,7 @@ void createCohortTree() throws IOException { new ConceptGraph(ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "tecmapExamples/Cs1ExampleGraph.json")), LearningResourceRecord.createLearningResourceRecordsFromJsonFiles(new ArrayList<>(Arrays.asList(Settings.TEST_RESOURCE_DIR + "tecmapExamples/Cs1ExampleResources.json"))), //TODO: hardcoded to sakai csv, need to hold a list of CSVReaders, or the information about which kind of reader it is... - ReaderTools.assessmentItemsFromCSVList(2, assessmentFiles), + ReaderTools.assessmentItemsFromCSVList(assessmentFiles), AssessmentItemResponse.createAssessmentItemResponses(assessmentFiles) ); diff --git a/src/test/java/edu/ithaca/dragon/tecmap/tecmapstate/AssessmentNoLinksStateTest.java b/src/test/java/edu/ithaca/dragon/tecmap/tecmapstate/AssessmentNoLinksStateTest.java index f3ae828..2adaafd 100644 --- a/src/test/java/edu/ithaca/dragon/tecmap/tecmapstate/AssessmentNoLinksStateTest.java +++ b/src/test/java/edu/ithaca/dragon/tecmap/tecmapstate/AssessmentNoLinksStateTest.java @@ -1,5 +1,6 @@ package edu.ithaca.dragon.tecmap.tecmapstate; +import com.opencsv.exceptions.CsvException; import edu.ithaca.dragon.tecmap.Settings; import edu.ithaca.dragon.tecmap.conceptgraph.ConceptGraph; import edu.ithaca.dragon.tecmap.io.Json; @@ -19,12 +20,12 @@ class AssessmentNoLinksStateTest { @Test - void createBlankLearningResourceRecordsFromAssessment1File() throws IOException { + void createBlankLearningResourceRecordsFromAssessment1File() throws IOException, CsvException { List assessmentFiles = new ArrayList<>(Arrays.asList(Settings.TEST_RESOURCE_DIR + "tecmapExamples/Cs1ExampleAssessment1.csv")); AssessmentNoLinksState state = new AssessmentNoLinksState( new ConceptGraph(ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "tecmapExamples/Cs1ExampleGraph.json")), - //TODO: hardcoded to sakai csv, need to hold a list of CSVReaders, or the information about which kind of reader it is... - ReaderTools.assessmentItemsFromCSVList(2, assessmentFiles), + //TODO: hardcoded to canvas csv, need to hold a list of CSVReaders, or the information about which kind of reader it is... + ReaderTools.assessmentItemsFromCSVList(assessmentFiles), AssessmentItemResponse.createAssessmentItemResponses(assessmentFiles) ); @@ -32,14 +33,14 @@ void createBlankLearningResourceRecordsFromAssessment1File() throws IOException } @Test - void createBlankLearningResourceRecordsFromAssessment2Files() throws IOException { + void createBlankLearningResourceRecordsFromAssessment2Files() throws IOException, CsvException { List assessmentFiles = new ArrayList<>(Arrays.asList(Settings.TEST_RESOURCE_DIR + "tecmapExamples/Cs1ExampleAssessment1.csv", Settings.TEST_RESOURCE_DIR + "tecmapExamples/Cs1ExampleAssessment2.csv")); AssessmentNoLinksState state = new AssessmentNoLinksState( new ConceptGraph(ConceptGraphRecord.buildFromJson(Settings.TEST_RESOURCE_DIR + "tecmapExamples/Cs1ExampleGraph.json")), - //TODO: hardcoded to sakai csv, need to hold a list of CSVReaders, or the information about which kind of reader it is... - ReaderTools.assessmentItemsFromCSVList(2, assessmentFiles), + //TODO: hardcoded to canvas csv, need to hold a list of CSVReaders, or the information about which kind of reader it is... + ReaderTools.assessmentItemsFromCSVList(assessmentFiles), AssessmentItemResponse.createAssessmentItemResponses(assessmentFiles) ); diff --git a/src/test/resources/author/ManuallyCreated/LearningRecordResourceTest-MissingFields.json b/src/test/resources/author/ManuallyCreated/LearningRecordResourceTest-MissingFields.json index 3c60f47..f0dcc82 100644 --- a/src/test/resources/author/ManuallyCreated/LearningRecordResourceTest-MissingFields.json +++ b/src/test/resources/author/ManuallyCreated/LearningRecordResourceTest-MissingFields.json @@ -1,19 +1,19 @@ [ { - "resourceId" : "variableHiddenQuizQuestion", + "text" : "variableHiddenQuizQuestion", "conceptIds" : [ "Variables", "Assignments" ], "dataImportance" : 1.0 }, { - "resourceId" : "reassignReturnedQuizQuestion", + "text" : "reassignReturnedQuizQuestion", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "Variables", "Assignments" ], "dataImportance" : 1.0 }, { - "resourceId" : "VariablesChapter", + "text" : "VariablesChapter", "resourceTypes" : [ "INFORMATION" ], "conceptIds" : [ "Variables", "Assignments" ], "maxPossibleKnowledgeEstimate" : 1.0 }, { - "resourceId" : "reassignQuizQuestion", + "text" : "reassignQuizQuestion", "resourceTypes" : [ "INFORMATION", "PRACTICE" ], "conceptIds" : [ "Variables", "Assignments" ], "dataImportance" : 1.0, diff --git a/src/test/resources/author/ManuallyCreated/basicRealisticAssessment.csv b/src/test/resources/author/ManuallyCreated/basicRealisticAssessment.csv index 84787c9..b99dd2b 100644 --- a/src/test/resources/author/ManuallyCreated/basicRealisticAssessment.csv +++ b/src/test/resources/author/ManuallyCreated/basicRealisticAssessment.csv @@ -1,4 +1,3 @@ student ID,Name,Q1 [10],Q2 [20],Q3 [40],Q4 [5],Q5 [2],Q6 [5],Q7 [5],Q8 [10],Q9 [30],Q10 [100], Q11 [10], Q12 [20], Q13 [50], Q14 [100], Q15 [100] -bspinache1,Billiam,5,14,,5,2,,4,10,7,,6,19,,75,0 - +bspinache1,Billiam,5,14,,5,2,,4,10,7,,6,19,,75,0 \ No newline at end of file diff --git a/src/test/resources/author/ManuallyCreated/basicRealisticAssessmentMoreUsers.csv b/src/test/resources/author/ManuallyCreated/basicRealisticAssessmentMoreUsers.csv index e851f16..48de43b 100644 --- a/src/test/resources/author/ManuallyCreated/basicRealisticAssessmentMoreUsers.csv +++ b/src/test/resources/author/ManuallyCreated/basicRealisticAssessmentMoreUsers.csv @@ -1,53 +1,28 @@ student ID,Name,Q1 [6],Q2 [5],Q3 [100],Q4 [10],Q5 [20],Q6 [10],Q7 [10],Q8 [10],Q9 [10],Q10 [10],Q11 [10],Q12 [10],Q13 [10],Q14 [10],Q15 [10] bspinache1,Billiam,5,5,62,5,2,10,4,10,7,8,10,3,2,8,10 - stu1,Will,6,5,81.5,7,0,0,10,10,10,2,5,7,9,4,10 - stu2,Bill,6,5,85,10,0,9,10,10,10,7,1,6,9,3,10 - stu3,Dom,6,5,98,10,19.5,10,10,10,10,7,2,8,9,3,10 - stu4,Hux,6,5,93.5,10,19.5,10,10,10,10,10,9,6,3,7,10 - stu5,Al,0,5,49,7,0,0,9.5,10,10,5,7,3,5,8,10 - stu6,Kev,6,5,78.5,10,13,9,10,10,10,3,6,5,7,9,10 - stu7,Cluf,6,5,97.5,10,19,10,10,10,10,3,3,5,5,7,10 - stu8,Mike,6,5,66.5,9,15,9.5,10,10,10,9,9,9,9,9,10 - stu9,Mac,6,5,84,10,15.5,10,10,10,10,6,8,4,6,9,10 - stu10,Kim,0,5,52,0,0,0,10,10,0,5,5,5,5,5,10 - stu11,Carl,0,5,60.5,10,0,5,10,10,10,6,3,7,8,9,10 - stu12,Dad,6,5,93.5,10,19.5,10,10,10,10,10,10,10,10,10,10 - stu13,Dom,6,5,89,10,19.5,9.5,10,10,10,5,7,6,8,3,10 - stu14,Salam,6,5,93,10,19,9.5,10,10,10,0,0,0,0,1,10 - stu15,Dommie,6,5,31,8,16.5,9,9.5,10,10,0,3,5,7,8,10 - stu16,Dome,6,5,95,10,18,10,10,10,10,7,4,6,8,9,10 - stu17,Doms Dad,6,5,97.5,10,0,9.5,10,10,10,10,7,4,7,8,10 - stu18,Donovan,0,5,0,0,0,0,0,10,0,10,10,10,10,6,10 - stu19,Cliffy,0,5,26,0,0,0,10,10,10,10,10,10,5,3,10 - stu20,Lex,6,5,84,10,15,9,10,10,10,5,7,8,3,8,10 - stu21,Alicia,3,5,74,0,0,0,10,10,10,0,0,10,10,10,10 - stu22,Tori,6,5,95.5,10,18.5,10,10,10,10,10,10,10,10,10,10 - stu23,Morgan,6,5,51,10,0,0,10,10,10,10,10,5,6,8,10 - stu24,Vi,6,5,87,10,17,10,10,10,10,5,7,4,7,9,10 - stu25,Sam,6,5,99,10,16,5,10,5,5,5,7,3,5,6,10 \ No newline at end of file diff --git a/src/test/resources/author/ManuallyCreated/basicRealisticResource.json b/src/test/resources/author/ManuallyCreated/basicRealisticResource.json index 47bbbcf..9f47b37 100644 --- a/src/test/resources/author/ManuallyCreated/basicRealisticResource.json +++ b/src/test/resources/author/ManuallyCreated/basicRealisticResource.json @@ -1,103 +1,100 @@ [ - {"learningResourceId":"Q1", - "conceptIds":[ + {"conceptIds":[ "If Statement" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"Q1" }, - {"learningResourceId":"Q2", - "conceptIds":[ + {"conceptIds":[ "If Statement" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"Q2" }, - {"learningResourceId":"Q3", - "conceptIds":[ + {"conceptIds":[ "If Statement", "For Loop" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"Q3" }, - {"learningResourceId":"Q4", - "conceptIds":[ + {"conceptIds":[ "Boolean Expressions", "Boolean" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"Q4" }, - {"learningResourceId":"Q5", - "conceptIds":[ + {"conceptIds":[ "Boolean Expressions", "Boolean" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"Q5" }, - {"learningResourceId":"Q6", - "conceptIds":[ + {"conceptIds":[ "Boolean" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"Q6" }, - {"learningResourceId":"Q7", - "conceptIds":[ + {"conceptIds":[ "Boolean" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"Q7" }, - {"learningResourceId":"Q8", - "conceptIds":[ + {"conceptIds":[ "Boolean" ], - "dataImportance": "1" - },{"learningResourceId":"Q9", - "conceptIds":[ + "dataImportance": "1", + "text":"Q8" + }, + {"conceptIds":[ "While Loop", "Boolean Expressions", "Boolean" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"Q9" }, - {"learningResourceId":"Q10", - "conceptIds":[ + {"conceptIds":[ "While Loop", "If Statement", "Boolean Expressions", "Boolean" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"Q10" }, - {"learningResourceId": "Q11", - "conceptIds": [ + {"conceptIds": [ "For Loop" ], - "dataImportance": "1" + "dataImportance": "1", + "text": "Q11" }, - { - "learningResourceId": "Q12", - "conceptIds": [ + {"conceptIds": [ "Counting" ], - "dataImportance": "1" + "dataImportance": "1", + "text": "Q12" }, - { - "learningResourceId": "Q13", - "conceptIds": [ + {"conceptIds": [ "Counting" ], - "dataImportance": "1" + "dataImportance": "1", + "text": "Q13" }, - { - "learningResourceId": "Q14", - "conceptIds": [ + {"conceptIds": [ "Counting" ], - "dataImportance": "1" + "dataImportance": "1", + "text": "Q14" }, - { - "learningResourceId": "Q15", - "conceptIds": [ + {"conceptIds": [ "Counting" ], - "dataImportance": "1" + "dataImportance": "1", + "text": "Q15" } ] \ No newline at end of file diff --git a/src/test/resources/author/ManuallyCreated/comp220Resources.json b/src/test/resources/author/ManuallyCreated/comp220Resources.json index de82ee7..057900a 100644 --- a/src/test/resources/author/ManuallyCreated/comp220Resources.json +++ b/src/test/resources/author/ManuallyCreated/comp220Resources.json @@ -1,11 +1,11 @@ [ - {"learningResourceId":"Lab 1: Guess the Pattern", + {"text":"Lab 1: Guess the Pattern", "conceptIds":[ "Interfaces" ], "dataImportance": "1" }, - {"learningResourceId":"Lab 2: Array Library", + {"text":"Lab 2: Array Library", "conceptIds":[ "Array", "Pointers", @@ -13,7 +13,7 @@ ], "dataImportance": "1" }, - {"learningResourceId":"Lab 3: Comparing Array Library Efficiency", + {"text":"Lab 3: Comparing Array Library Efficiency", "conceptIds":[ "Array", "Pointers", @@ -22,7 +22,7 @@ ], "dataImportance": "1" }, - {"learningResourceId":"Lab 4: Recursion", + {"text":"Lab 4: Recursion", "conceptIds":[ "Recursion", "Pointers", @@ -30,7 +30,7 @@ ], "dataImportance": "1" }, - {"learningResourceId":"Lab 5: Comparing Searches", + {"text":"Lab 5: Comparing Searches", "conceptIds":[ "Search", "Sort", @@ -39,14 +39,14 @@ ], "dataImportance": "1" }, - {"learningResourceId":"Lab 6: ArrayList and Testing", + {"text":"Lab 6: ArrayList and Testing", "conceptIds":[ "Array", "List" ], "dataImportance": "2" }, - {"learningResourceId":"Lab 7: Linked List", + {"text":"Lab 7: Linked List", "conceptIds":[ "Linked Nodes", "List", @@ -54,7 +54,7 @@ ], "dataImportance": "1" }, - {"learningResourceId":"Lab 8: Comparing Arrays and Linked Lists", + {"text":"Lab 8: Comparing Arrays and Linked Lists", "conceptIds":[ "List", "Array", diff --git a/src/test/resources/author/ManuallyCreated/complexRealisticAssessment.csv b/src/test/resources/author/ManuallyCreated/complexRealisticAssessment.csv index 3032643..3c957b1 100644 --- a/src/test/resources/author/ManuallyCreated/complexRealisticAssessment.csv +++ b/src/test/resources/author/ManuallyCreated/complexRealisticAssessment.csv @@ -1,51 +1,27 @@ student ID,Name,Week 8 Exercises [6],Book reading and in-text exercises [5],Final Exam [100],Lab 10: Lists and Side Effects [10],Lab 11: Pig Latin Translator [20],Lab 12: Poetry Analysis Objects [10],Lab 1: Counting Machine [10],Lab 2: Turtle Drawing [10],Lab 3: Function Practice (House Paint Calculator) [10] stu1,Will,6,5,81.5,7,0,0,10,10,10 - stu2,Bill,6,5,85,10,0,9,10,10,10 - stu3,Dom,6,5,98,10,19.5,10,10,10,10 - stu4,Hux,6,5,93.5,10,19.5,10,10,10,10 - stu5,Al,0,5,49,7,0,0,9.5,10,10 - stu6,Kev,6,5,78.5,10,13,9,10,10,10 - stu7,Cluf,6,5,97.5,10,19,10,10,10,10 - stu8,Mike,6,5,66.5,9,15,9.5,10,10,10 - stu9,Mac,6,5,84,10,15.5,10,10,10,10 - stu10,Kim,0,5,52,0,0,0,10,10,0 - stu11,Carl,0,5,60.5,10,0,5,10,10,10 - stu12,Dad,6,5,93.5,10,19.5,10,10,10,10 - stu13,Dom,6,5,89,10,19.5,9.5,10,10,10 - stu14,Salam,6,5,93,10,19,9.5,10,10,10 - stu15,Dommie,6,5,31,8,16.5,9,9.5,10,10 - stu16,Dome,6,5,95,10,18,10,10,10,10 - stu17,Doms Dad,6,5,97.5,10,0,9.5,10,10,10 - stu18,Donovan,0,5,0,0,0,0,0,10,0 - stu19,Cliffy,0,5,26,0,0,0,10,10,10 - stu20,Lex,6,5,84,10,15,9,10,10,10 - stu21,Alicia,3,5,74,0,0,0,10,10,10 - stu22,Tori,6,5,95.5,10,18.5,10,10,10,10 - stu23,Morgan,6,5,51,10,0,0,10,10,10 - stu24,Vi,6,5,87,10,17,10,10,10,10 - stu25,Sam,6,5,99,10,20,10,10,10,10 \ No newline at end of file diff --git a/src/test/resources/author/ManuallyCreated/exampleDataAssessment.csv b/src/test/resources/author/ManuallyCreated/exampleDataAssessment.csv index 4a0a70f..7ec389d 100644 --- a/src/test/resources/author/ManuallyCreated/exampleDataAssessment.csv +++ b/src/test/resources/author/ManuallyCreated/exampleDataAssessment.csv @@ -1,4 +1,5 @@ Student ID,Name,Lab 1: Guess the Pattern [10],Lab 2: Array Library [10],Lab 3: Comparing Array Library Efficiency [10],Lab 4: Recursion [10],Lab 5: Comparing Searches [10],Lab 6: ArrayList and Testing [20],Lab 7: Linked List [10],Lab 8: Comparing Arrays and Linked Lists [10] + s01,student01,88,0,9.5,8,9.5,18,7,4 s02,student10,87,9,6.5,8,17,3,4,10 s03,student11,94,9,9.5,9,19,16,2,8 diff --git a/src/test/resources/author/ManuallyCreated/partialComplexRealitsticAssessment.csv b/src/test/resources/author/ManuallyCreated/partialComplexRealitsticAssessment.csv index a0f9d17..113971f 100644 --- a/src/test/resources/author/ManuallyCreated/partialComplexRealitsticAssessment.csv +++ b/src/test/resources/author/ManuallyCreated/partialComplexRealitsticAssessment.csv @@ -1,7 +1,5 @@ student ID,Name,Week8Exercises [6],Bookreadingandin-textexercises [5],FinalExam [100],Lab 10:ListsandSideEffects [10],Lab11:PigLatinTranslator [20],Lab12:PoetryAnalysisObjects [10],Lab1:CountingMachine [10],Lab2:TurtleDrawing [10],Lab3:FunctionPractice(HousePaintCalculator) [10] stu1,Will,6,5,81.5,7,0,0,10,10,10 - stu2,Bill,6,5,85,10,0,9,10,10,10 - stu3,Dom,6,5,98,10,19.5,10,10,10,10 \ No newline at end of file diff --git a/src/test/resources/author/ManuallyCreated/researchAssessment1.csv b/src/test/resources/author/ManuallyCreated/researchAssessment1.csv index 101dcae..f062f0c 100644 --- a/src/test/resources/author/ManuallyCreated/researchAssessment1.csv +++ b/src/test/resources/author/ManuallyCreated/researchAssessment1.csv @@ -1,15 +1,9 @@ student ID,Name,Counting in binary to 10 [100],What’s an algorithm? [100],What’s a function? [100],What’s the purpose of a function? [100],What are the parameters in the function? [100],What data types can be passed as a parameter? [100], Overwrite each element in the list with it’s double value using two functions. [100], What is a side effect? [100], What is the proper for loop diction? [100],What are the three things you need for a for loop [100], What are the differences and similarities between for loops and while loops? [100], How are while loops and booleans related? [100], What is the proper while loop diction? [100], What are the things you need for a while loop? [100], What is a statement? [100], What are some of the statements we have already seen? [100], What is 5%7? [100], What is an assignment statement? [100], Write the following in camel case [100], What are the important rules for variable names? [100], What makes up a dictionary? [100], What’s key-value pairs [100], Are strings mutable? [100] s1,s1,50,75,80,67,,95,90,92,78,90,67,99,70,71,69,,,,74,77,,99,80 - s2,s1,50,75,80,67,,95,90,92,78,53,67,,70,71,69,,99,,74,77,,,71 - s3,s1,50,75,80,67,80,95,55,92,78,90,67,,70,71,69,,66,,74,77,,,90 - s4,s1,50,,,,,,,,,,,,,,,,,,,,,,71 - s5,s1,50,75,80,76,,95,90,100,78,90,100,,70,71,69,100,,99,100,77,,100,79 - s6,s1,50,75,58,67,,95,55,79,78,47,67,55,35,71,69,60,55,,74,77,99,90,100 - s7,s7,100,100,71,80,100,20,71,69,65,90,70,75,80,60,81,79,71,81,100,100,75,85,70 diff --git a/src/test/resources/author/ManuallyCreated/researchAssessment2.csv b/src/test/resources/author/ManuallyCreated/researchAssessment2.csv index 6c1add0..939589d 100644 --- a/src/test/resources/author/ManuallyCreated/researchAssessment2.csv +++ b/src/test/resources/author/ManuallyCreated/researchAssessment2.csv @@ -1,11 +1,7 @@ -student ID,Name, Counting in binary to 10 [100], Write an algorithm to change a list of ints to be a list of strings [100], What’s wrong with the following function definition? [100], What will the following function return? [100], Can a function be called several times by placing a function call in the body of a loop [100], How many parameters can you have? [100], When do you want to cause a side effect? [100], When do you want to allow side effects? [100], "Describe how the following relate to a for loop: variable, terminating condition, loop body" [100], What are the differences and similarities between for loops and while loops? [100], Describe how while loops can depend on booleans [100], Describe the flow of a while loop [100], What’s the difference between a statement and an expression? [100], Write a function that will convert 645 mins into hours [100], Write a function that will convert 645 mins into the whole hours [100], What does the modulus operator do? [100], What is an assignment token? [100], What is a reference diagram? [100], What is printed then the following statements execute? [100], Whats a key [100], What’s a value [100], What are values are accessed by? [100], Is a dictionary ordered? [100], Write a function that will calculate if the substring 'the' is in any user input [100] +student ID,Name, Counting in binary to 10 [100], Write an algorithm to change a list of ints to be a list of strings [100], What’s wrong with the following function definition? [100], What will the following function return? [100], Can a function be called several times by placing a function call in the body of a loop [100], How many parameters can you have? [100], When do you want to cause a side effect? [100], When do you want to allow side effects? [100], "Describe how the following relate to a for loop: variable, terminating condition, loop body [100]", What are the differences and similarities between for loops and while loops? [100], Describe how while loops can depend on booleans [100], Describe the flow of a while loop [100], What’s the difference between a statement and an expression? [100], Write a function that will convert 645 mins into hours [100], Write a function that will convert 645 mins into the whole hours [100], What does the modulus operator do? [100], What is an assignment token? [100], What is a reference diagram? [100], What is printed then the following statements execute? [100], Whats a key [100], What’s a value [100], What are values are accessed by? [100], Is a dictionary ordered? [100], Write a function that will calculate if the substring 'the' is in any user input [100] s1,s4,90,80,91,85,95,82,100,91,85,100,89,90,94,91,100,90,72,85,65,80,80,88,95,100 - s2,s1,55,60,90,94,96,71,80,75,64,,50,69,,75,55,,75,69,70,87,81,,78,50 - s3,s4,66,80,91,93,95,70,80,74,64,,50,68,,74,50,,72,67,65,80,80,,75,40 - s4,s4,90,80,91,85,95,82,100,91,85,100,89,90,94,91,100,90,72,85,65,80,80,88,95,100 - s5,s4,90,80,91,85,95,82,100,91,85,100,89,90,94,91,100,90,72,85,65,80,80,88,95,100 diff --git a/src/test/resources/author/ManuallyCreated/researchResource1.json b/src/test/resources/author/ManuallyCreated/researchResource1.json index 17ac81f..abc6b36 100644 --- a/src/test/resources/author/ManuallyCreated/researchResource1.json +++ b/src/test/resources/author/ManuallyCreated/researchResource1.json @@ -1,156 +1,168 @@ [ - {"learningResourceId":"Counting in binary to 10", + { "conceptIds":[ "Counting" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"Counting in binary to 10" }, - {"learningResourceId":"What’s an algorithm?", + { "conceptIds":[ "Algorithms" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"What’s an algorithm?" }, - {"learningResourceId":"What’s a function?", + { "conceptIds":[ "Functions" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"What’s a function?" }, - {"learningResourceId":"What’s the purpose of a function?", + { "conceptIds":[ "Functions" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"What’s the purpose of a function?" }, - {"learningResourceId":"What are the parameters in the function?", + { "conceptIds":[ "Parameters" ], - "dataImportance": "0" + "dataImportance": "0", + "text":"What are the parameters in the function?" }, - {"learningResourceId":"What data types can be passed as a parameter?", + { "conceptIds":[ "Parameters", "Values and Data Types" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"What data types can be passed as a parameter?" }, - {"learningResourceId":"Overwrite each element in the list with it’s double value using two functions.", + { "conceptIds":[ "Lists", "Parameters" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"Overwrite each element in the list with it’s double value using two functions." }, - {"learningResourceId":"What is a side effect?", + { "conceptIds":[ "Lists", "Parameters" ], - "dataImportance": "1" - },{"learningResourceId":"What is the proper for loop diction?", + "dataImportance": "1", + "text":"What is a side effect?" + }, + { "conceptIds":[ "For Loops" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"What is the proper for loop diction?" }, - {"learningResourceId":"What are the three things you need for a for loop", + { "conceptIds":[ "For Loops" ], - "dataImportance": "1" + "dataImportance": "1", + "text":"What are the three things you need for a for loop" }, - {"learningResourceId": "What are the differences and similarities between for loops and while loops?", + { "conceptIds": [ "For Loops", "While Loops" ], - "dataImportance": "1" + "dataImportance": "1", + "text": "What are the differences and similarities between for loops and while loops?" }, { - "learningResourceId": "How are while loops and booleans related?", "conceptIds": [ "While Loops", "Booleans" ], - "dataImportance": "0" + "dataImportance": "0", + "text": "How are while loops and booleans related?" }, { - "learningResourceId": "What is the proper while loop diction?", "conceptIds": [ "While Loops" ], - "dataImportance": "1" + "dataImportance": "1", + "text": "What is the proper while loop diction?" }, { - "learningResourceId": "What are the things you need for a while loop?", "conceptIds": [ "While Loops" ], - "dataImportance": "1" + "dataImportance": "1", + "text": "What are the things you need for a while loop?" }, { - "learningResourceId": "What is a statement?", "conceptIds": [ "Expressions and Statements" ], - "dataImportance": "1" + "dataImportance": "1", + "text": "What is a statement?" }, { - "learningResourceId": "What are some of the statements we have already seen?", "conceptIds": [ "Expressions and Statements" ], - "dataImportance": "0" + "dataImportance": "0", + "text": "What are some of the statements we have already seen?" }, { - "learningResourceId": "What is 5%7?", "conceptIds": [ "Expressions and Statements" ], - "dataImportance": "0" + "dataImportance": "0", + "text": "What is 5%7?" }, { - "learningResourceId": "What is an assignment statement?", "conceptIds": [ "Variables" ], - "dataImportance": "0" + "dataImportance": "0", + "text": "What is an assignment statement?" }, { - "learningResourceId": "Write the following in camel case", "conceptIds": [ "Variables" ], - "dataImportance": "1" + "dataImportance": "1", + "text": "Write the following in camel case" }, { - "learningResourceId": "What are the important rules for variable names?", "conceptIds": [ "Variables" ], - "dataImportance": "1" + "dataImportance": "1", + "text": "What are the important rules for variable names?" }, { - "learningResourceId": "What makes up a dictionary?", "conceptIds": [ "Dictionaries" ], - "dataImportance": "0" + "dataImportance": "0", + "text": "What makes up a dictionary?" }, { - "learningResourceId": "What’s key-value pairs", "conceptIds": [ "Dictionaries" ], - "dataImportance": "0" + "dataImportance": "0", + "text": "What’s key-value pairs" }, { - "learningResourceId": "Are strings mutable?", "conceptIds": [ "Strings" ], - "dataImportance": "1" + "dataImportance": "1", + "text": "Are strings mutable?" } ] \ No newline at end of file diff --git a/src/test/resources/author/ManuallyCreated/researchResource2.json b/src/test/resources/author/ManuallyCreated/researchResource2.json index 23afa87..984bf77 100644 --- a/src/test/resources/author/ManuallyCreated/researchResource2.json +++ b/src/test/resources/author/ManuallyCreated/researchResource2.json @@ -1,48 +1,48 @@ [ { - "learningResourceId":"Counting in binary to 10", + "text":"Counting in binary to 10", "conceptIds":[ "Counting" ], "dataImportance": "1" }, { - "learningResourceId":"Write an algorithm to change a list of ints to be a list of strings", + "text":"Write an algorithm to change a list of ints to be a list of strings", "conceptIds":[ "Algorithms" ], "dataImportance": "1" }, { - "learningResourceId":"What’s wrong with the following function definition?", + "text":"What’s wrong with the following function definition?", "conceptIds":[ "Functions" ], "dataImportance": "1" }, { - "learningResourceId":"What will the following function return?", + "text":"What will the following function return?", "conceptIds":[ "Functions" ], "dataImportance": "1" }, { - "learningResourceId":"Can a function be called several times by placing a function call in the body of a loop", + "text":"Can a function be called several times by placing a function call in the body of a loop", "conceptIds":[ "Functions" ], "dataImportance": "1" }, { - "learningResourceId":"How many parameters can you have?", + "text":"How many parameters can you have?", "conceptIds":[ "Parameters" ], "dataImportance": "1" }, { - "learningResourceId":"When do you want to cause a side effect?", + "text":"When do you want to cause a side effect?", "conceptIds":[ "Parameters", "Values and Data Types" @@ -50,7 +50,7 @@ "dataImportance": "1" }, { - "learningResourceId":"When do you want to allow side effects?", + "text":"When do you want to allow side effects?", "conceptIds":[ "Lists", "Parameters" @@ -58,14 +58,14 @@ "dataImportance": "1" }, { - "learningResourceId":"Describe how the following relate to a for loop: variable, terminating condition, loop body", + "text":"Describe how the following relate to a for loop: variable, terminating condition, loop body", "conceptIds":[ "For Loops" ], "dataImportance": "1" }, { - "learningResourceId": "What are the differences and similarities between for loops and while loops?", + "text": "What are the differences and similarities between for loops and while loops?", "conceptIds": [ "For Loops", "While Loops" @@ -73,7 +73,7 @@ "dataImportance": "0" }, { - "learningResourceId": "Describe how while loops can depend on booleans", + "text": "Describe how while loops can depend on booleans", "conceptIds": [ "While Loops", "Booleans" @@ -81,91 +81,91 @@ "dataImportance": "1" }, { - "learningResourceId": "Describe the flow of a while loop", + "text": "Describe the flow of a while loop", "conceptIds": [ "While Loops" ], "dataImportance": "1" }, { - "learningResourceId": "What’s the difference between a statement and an expression?", + "text": "What’s the difference between a statement and an expression?", "conceptIds": [ "Expressions and Statements" ], "dataImportance": "0" }, { - "learningResourceId": "Write a function that will convert 645 mins into hours", + "text": "Write a function that will convert 645 mins into hours", "conceptIds": [ "Expressions and Statements" ], "dataImportance": "1" }, { - "learningResourceId": "Write a function that will convert 645 mins into the whole hours", + "text": "Write a function that will convert 645 mins into the whole hours", "conceptIds": [ "Expressions and Statements" ], "dataImportance": "1" }, { - "learningResourceId": "What does the modulus operator do?", + "text": "What does the modulus operator do?", "conceptIds": [ "Expressions and Statements" ], "dataImportance": "0" }, { - "learningResourceId": "What is an assignment token?", + "text": "What is an assignment token?", "conceptIds": [ "Variables" ], "dataImportance": "1" }, { - "learningResourceId": "What is a reference diagram?", + "text": "What is a reference diagram?", "conceptIds": [ "Variables" ], "dataImportance": "1" }, { - "learningResourceId": "What is printed then the following statements execute?", + "text": "What is printed then the following statements execute?", "conceptIds": [ "Variables" ], "dataImportance": "1" }, { - "learningResourceId": "Whats a key", + "text": "Whats a key", "conceptIds": [ "Dictionaries" ], "dataImportance": "1" }, { - "learningResourceId": "What’s a value", + "text": "What’s a value", "conceptIds": [ "Dictionaries" ], "dataImportance": "1" }, { - "learningResourceId": "What are values are accessed by?", + "text": "What are values are accessed by?", "conceptIds": [ "Dictionaries" ], "dataImportance": "0" }, { - "learningResourceId": "Is a dictionary ordered?", + "text": "Is a dictionary ordered?", "conceptIds": [ "Dictionaries" ], "dataImportance": "1" }, { - "learningResourceId": "Write a function that will calculate if the substring 'the' is in any user input", + "text": "Write a function that will calculate if the substring 'the' is in any user input", "conceptIds": [ "Strings" ], diff --git a/src/test/resources/author/ManuallyCreated/simpleAssessmentMoreUsers.csv b/src/test/resources/author/ManuallyCreated/simpleAssessmentMoreUsers.csv index 59bf260..209a1c0 100644 --- a/src/test/resources/author/ManuallyCreated/simpleAssessmentMoreUsers.csv +++ b/src/test/resources/author/ManuallyCreated/simpleAssessmentMoreUsers.csv @@ -1,15 +1,9 @@ student ID,Name,Q1 [100],Q2 [100],Q3 [100],Q4 [100],Q5 [100],Q6 [100] bspinache1,Billiam,0,95,80,50,35,100 - s2,Mia,20,100,70,60,40,95 - s3,Ben,70,80,60,85,70,100 - s4,Toby,50,65,100,45,70,80 - s5,Will,0,60,85,70,45,100 - s6,Doug,40,55,65,100,40,85 - s7,John,20,30,90,90,100,95 \ No newline at end of file diff --git a/src/test/resources/author/ManuallyCreated/simpleAssessmentTest.csv b/src/test/resources/author/ManuallyCreated/simpleAssessmentTest.csv index 0845e18..1d6dbf7 100644 --- a/src/test/resources/author/ManuallyCreated/simpleAssessmentTest.csv +++ b/src/test/resources/author/ManuallyCreated/simpleAssessmentTest.csv @@ -1,7 +1,7 @@ student ID,Name,Q1 [100],Q2 [100] -s1,s1,50,70 -s2,s2,70,50 -s3,s3,60,60 -s4,s4,50,70 -s5,s4,60,50 +s1,Lisa,50,70 +s2,John,70,50 +s3,Olive,60,60 +s4,Jack,50,70 +s5,Ivy,60,50 diff --git a/src/test/resources/author/ManuallyCreated/simpleChangeNameLOL.json b/src/test/resources/author/ManuallyCreated/simpleChangeNameLOL.json index ef49782..058fa8b 100644 --- a/src/test/resources/author/ManuallyCreated/simpleChangeNameLOL.json +++ b/src/test/resources/author/ManuallyCreated/simpleChangeNameLOL.json @@ -1,88 +1,89 @@ [ - {"learningResourceId":"resource1", + {"text":"resource1", "conceptIds":[ "For Loop" ], "dataImportance": "1" }, - {"learningResourceId":"Q1", + {"text":"Q1", "conceptIds":[ "For Loop" ], "dataImportance": "1" }, - {"learningResourceId":"Q2", + {"text":"Q2", "conceptIds":[ "For Loop" ], "dataImportance": "1" }, - {"learningResourceId":"resource2", + {"text":"resource2", "conceptIds":[ "For Loop" ], "dataImportance": "1" }, - {"learningResourceId":"resource3", + {"text":"resource3", "conceptIds":[ "For Loop" ], "dataImportance": "1" }, - {"learningResourceId":"Q5", + {"text":"Q5", "conceptIds":[ "For Loop" ], "dataImportance": "1" }, - {"learningResourceId":"resource4", + {"text":"resource4", "conceptIds":[ "For Loop" ], "dataImportance": "1" }, - {"learningResourceId":"Q7", + {"text":"Q7", "conceptIds":[ "For Loop" ], "dataImportance": "1" }, - {"learningResourceId":"Q8", + {"text":"Q8", "conceptIds":[ "For Loop" ], "dataImportance": "1" - },{"learningResourceId":"Q9", + }, + {"text":"Q9", "conceptIds":[ "For Loop" ], "dataImportance": "1" }, - {"learningResourceId":"Q10", + {"text":"Q10", "conceptIds":[ "For Loop" ], "dataImportance": "1" }, - {"learningResourceId": "resource5", + {"text": "resource5", "conceptIds": [ "For Loop" ], "dataImportance": "1" }, - {"learningResourceId": "Q12", + {"text": "Q12", "conceptIds": [ "For Loop" ], "dataImportance": "1" }, - {"learningResourceId": "Q13", + {"text": "Q13", "conceptIds": [ "For Loop" ], "dataImportance": "1" }, - {"learningResourceId": "Q14", + {"text": "Q14", "conceptIds": [ "For Loop" ], diff --git a/src/test/resources/author/ManuallyCreated/simpleResource.json b/src/test/resources/author/ManuallyCreated/simpleResource.json index d8004ed..6536030 100644 --- a/src/test/resources/author/ManuallyCreated/simpleResource.json +++ b/src/test/resources/author/ManuallyCreated/simpleResource.json @@ -1,35 +1,35 @@ [ - {"learningResourceId":"Q1", + {"text":"Q1", "conceptIds":[ "B" ], "dataImportance": "1" }, - {"learningResourceId":"Q2", + {"text":"Q2", "conceptIds":[ "B" ], "dataImportance": "1" }, - {"learningResourceId":"Q3", + {"text":"Q3", "conceptIds":[ "C" ], "dataImportance": "0.3" }, - {"learningResourceId":"Q4", + {"text":"Q4", "conceptIds":[ "C" ], "dataImportance": "1" }, - {"learningResourceId":"Q5", + {"text":"Q5", "conceptIds":[ "C" ], "dataImportance": "1" }, - {"learningResourceId":"Q6", + {"text":"Q6", "conceptIds":[ "C" ], diff --git a/src/test/resources/author/ManuallyCreated/simpleResourceTest.json b/src/test/resources/author/ManuallyCreated/simpleResourceTest.json index 4d94340..0c55785 100644 --- a/src/test/resources/author/ManuallyCreated/simpleResourceTest.json +++ b/src/test/resources/author/ManuallyCreated/simpleResourceTest.json @@ -1,11 +1,11 @@ [ - {"learningResourceId":"Q1", + {"text":"Q1", "conceptIds":[ "B" ], "dataImportance": "1" }, - {"learningResourceId":"Q2", + {"text":"Q2", "conceptIds":[ "C" ], diff --git a/src/test/resources/author/comp220_Summer2024/gradesCanvasFormat.csv b/src/test/resources/author/comp220_Summer2024/gradesCanvasFormat.csv new file mode 100644 index 0000000..b665aee --- /dev/null +++ b/src/test/resources/author/comp220_Summer2024/gradesCanvasFormat.csv @@ -0,0 +1,8 @@ +Name,student ID,,,Q1,Q2,Q3,Q4,Q5,Q6,Q7 + +Points Possible,,,,10,10,5,5,100,50,100 +Bart,s01,,,5,9,5,4.5,100,45,90 +Lisa,s02,,,2,5,,3,100,48,89 +Parker,s03,,,10,4,2.5,3,75,19,92 +Jack,s04,,,9,10,4,,89,49, +Lily,s05,,,4,7,1,4.5,45,,56 \ No newline at end of file diff --git a/src/test/resources/author/comp220_Summer2024/learningResources.json b/src/test/resources/author/comp220_Summer2024/learningResources.json index a37bf0f..29ce6ed 100644 --- a/src/test/resources/author/comp220_Summer2024/learningResources.json +++ b/src/test/resources/author/comp220_Summer2024/learningResources.json @@ -1,43 +1,43 @@ [ { - "learningResourceId" : "Q1", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "List", "Arrays"], "dataImportance" : 0.0, - "maxPossibleKnowledgeEstimate" : 10.0 + "maxPossibleKnowledgeEstimate" : 10.0, + "text" : "Q1" }, { - "learningResourceId" : "Q2", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "Stack", "Queue", "List"], "dataImportance" : 0.0, - "maxPossibleKnowledgeEstimate" : 10.0 + "maxPossibleKnowledgeEstimate" : 10.0, + "text" : "Q2" }, { - "learningResourceId" : "Q3", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "Map"], "dataImportance" : 0.0, - "maxPossibleKnowledgeEstimate" : 5.0 + "maxPossibleKnowledgeEstimate" : 5.0, + "text" : "Q3" }, { - "learningResourceId" : "Q4", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "Binary Trees"], "dataImportance" : 0.0, - "maxPossibleKnowledgeEstimate" : 5.0 + "maxPossibleKnowledgeEstimate" : 5.0, + "text" : "Q4" }, { - "learningResourceId" : "Q5", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "BigO", "Theoretical", "Empirical"], "dataImportance" : 0.0, - "maxPossibleKnowledgeEstimate" : 100.0 + "maxPossibleKnowledgeEstimate" : 100.0, + "text" : "Q5" } , { - "learningResourceId" : "Q6", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "BigO", "Binary Trees", "Chained Hash Tables"], "dataImportance" : 0.0, - "maxPossibleKnowledgeEstimate" : 50.0 + "maxPossibleKnowledgeEstimate" : 50.0, + "text" : "Q6" }, { - "learningResourceId" : "Q7", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "Concrete Implementation Techniques/Tools"], "dataImportance" : 0.0, - "maxPossibleKnowledgeEstimate" : 100.0 + "maxPossibleKnowledgeEstimate" : 100.0, + "text" : "Q7" }] diff --git a/src/test/resources/author/io/assessmentSources/sakai-comp220-DataExample.csv b/src/test/resources/author/io/assessmentSources/sakai-comp220-DataExample.csv index 59605e4..c003264 100644 --- a/src/test/resources/author/io/assessmentSources/sakai-comp220-DataExample.csv +++ b/src/test/resources/author/io/assessmentSources/sakai-comp220-DataExample.csv @@ -1 +1 @@ -Student ID,Student Name,"Attendance, Participation, and Engagement - midterm estimation [10]","Attendance, Particpation, and Engagment Final [10]",Exam 1 [100],Exam 2 [100],Final Exam - Tree Portion [30],Full Final Exam [100],Overall Weighted Exam Score [100],Lab 1: Guess the Pattern [10],Lab 2: Array Library [10],Lab 3: Comparing Array Library Efficiency [10],Lab 4: Recursion [10],Lab 5: Comparing Searches [10],Lab 6: ArrayList and Testing [20],Lab 7: Linked List [10],Lab 8: Comparing Arrays and Linked Lists [10],Overall Project Score [100],Day 03 Reading - C++ intro and pointers [4],Day 02 Reading - C++ Intro [6],"Day 06 Reading - Pointers, Arrays, and Dynamic Memory [6]",Day 09 Reading - Ponters and const [2],Day 10 Reading - Recursion [8],Day 15 Reading - Big-O Notation [4],Day 17 Reading - OOP in C++ [6],Day 27 Reading - Copying Objects [10],Course Grade s01,student01,9,10,79,88,25,,83,10,9,10,8.5,8.5,20,7.5,8.5,93,4,6,6,2,8,4,6,10,91.18 s02,student02,9,8.5,56,76,,74,72,9.5 (dropped),8,9.5,7,6,16.5,7,5.5,79,4,6,6,2,8,4,6,10,*80.0 s03,student03,9,9.5,94,97.5,28,,95,10,9.5,9.5,10,8.5,19.5,9,9.5,98,4,3,6,2,8,4,3,10,*95.0 \ No newline at end of file +Student ID,Student Name,"Attendance, Participation, and Engagement - midterm estimation [10]","Attendance, Particpation, and Engagment Final [10]",Exam 1 [100],Exam 2 [100],Final Exam - Tree Portion [30],Full Final Exam [100],Overall Weighted Exam Score [100],Lab 1: Guess the Pattern [10],Lab 2: Array Library [10],Lab 3: Comparing Array Library Efficiency [10],Lab 4: Recursion [10],Lab 5: Comparing Searches [10],Lab 6: ArrayList and Testing [20],Lab 7: Linked List [10],Lab 8: Comparing Arrays and Linked Lists [10],Overall Project Score [100],Day 03 Reading - C++ intro and pointers [4],Day 02 Reading - C++ Intro [6],"Day 06 Reading - Pointers, Arrays, and Dynamic Memory [6]",Day 09 Reading - Ponters and const [2],Day 10 Reading - Recursion [8],Day 15 Reading - Big-O Notation [4],Day 17 Reading - OOP in C++ [6],Day 27 Reading - Copying Objects [10],Course Grade s01,student01,9,10,79,88,25,,83,10,9,10,8.5,8.5,20,7.5,8.5,93,4,6,6,2,8,4,6,10,91.18 s02,student02,9,8.5,56,76,,74,72,9.5 (dropped),8,9.5,7,6,16.5,7,5.5,79,4,6,6,2,8,4,6,10,*80.0 s03,student03,9,9.5,94,97.5,28,,95,10,9.5,9.5,10,8.5,19.5,9,9.5,98,4,3,6,2,8,4,3,10,*95.0 \ No newline at end of file diff --git a/src/test/resources/author/io/assessmentSources/zybook-comp115-DataExample.csv b/src/test/resources/author/io/assessmentSources/zybook-comp115-DataExample.csv deleted file mode 100644 index cbc99b7..0000000 --- a/src/test/resources/author/io/assessmentSources/zybook-comp115-DataExample.csv +++ /dev/null @@ -1,17 +0,0 @@ -Last name,First name,Primary email,School email,Total (179),Participation total (148),Challenge total (31),1.1 - Participation (17),1.2 - Participation (12),1.3 - Participation (14),1.4 - Participation (11),1.5 - Participation (16),1.6 - Participation (15),1.7 - Participation (3),1.8 - Participation (13),1.9 - Participation (15),1.10 - Participation (15),1.11 - Participation (2),1.12 - Participation (15),1.1 - Challenge (0),1.2 - Challenge (13),1.3 - Challenge (10),1.4 - Challenge (0),1.5 - Challenge (0),1.6 - Challenge (8),1.7 - Challenge (0),1.8 - Challenge (0),1.9 - Challenge (0),1.10 - Challenge (0),1.11 - Challenge (0),1.12 - Challenge (0) -lname01,fname01,a@b.com,c@d.com,82.12290503,78.37837838,100,100,100,100,100,100,100,100,100,100,0,0,0,N/A,100,100,N/A,N/A,100,N/A,N/A,N/A,N/A,N/A,N/A -lname02,fname02,a@b.com,c@d.com,90.5027933,88.51351351,100,100,100,100,100,100,100,100,100,100,100,0,0,N/A,100,100,N/A,N/A,100,N/A,N/A,N/A,N/A,N/A,N/A -lname03,fname03,a@b.com,c@d.com,84.3575419,81.08108108,100,100,100,100,100,100,100,100,100,100,26.66666667,0,0,N/A,100,100,N/A,N/A,100,N/A,N/A,N/A,N/A,N/A,N/A -lname04,fname04,a@b.com,c@d.com,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,N/A,100,100,N/A,N/A,100,N/A,N/A,N/A,N/A,N/A,N/A -lname05,fname05,a@b.com,c@d.com,82.12290503,78.37837838,100,100,100,100,100,100,100,100,100,100,0,0,0,N/A,100,100,N/A,N/A,100,N/A,N/A,N/A,N/A,N/A,N/A -lname06,fname06,a@b.com,c@d.com,82.12290503,78.37837838,100,100,100,100,100,100,100,100,100,100,0,0,0,N/A,100,100,N/A,N/A,100,N/A,N/A,N/A,N/A,N/A,N/A -lname07,fname07,a@b.com,c@d.com,84.3575419,81.08108108,100,82.35294118,91.66666667,100,90.90909091,100,100,33.33333333,84.61538462,86.66666667,93.33333333,50,0,N/A,100,100,N/A,N/A,100,N/A,N/A,N/A,N/A,N/A,N/A -lname08,fname08,a@b.com,c@d.com,90.5027933,88.51351351,100,100,100,100,100,100,100,100,100,100,100,0,0,N/A,100,100,N/A,N/A,100,N/A,N/A,N/A,N/A,N/A,N/A -lname09,fname09,a@b.com,c@d.com,95.53072626,94.59459459,100,100,100,100,100,100,100,100,100,100,100,100,46.66666667,N/A,100,100,N/A,N/A,100,N/A,N/A,N/A,N/A,N/A,N/A -lname10,fname10,a@b.com,c@d.com,81.00558659,78.37837838,93.5483871,100,100,100,100,100,100,100,100,100,0,0,0,N/A,84.61538462,100,N/A,N/A,100,N/A,N/A,N/A,N/A,N/A,N/A -lname11,fname11,a@b.com,c@d.com,23.46368715,25,16.12903226,82.35294118,33.33333333,21.42857143,0,43.75,53.33333333,33.33333333,0,0,0,0,0,N/A,38.46153846,0,N/A,N/A,0,N/A,N/A,N/A,N/A,N/A,N/A -lname12,fname12,a@b.com,c@d.com,80.44692737,76.35135135,100,82.35294118,100,100,100,100,100,100,100,100,0,0,0,N/A,100,100,N/A,N/A,100,N/A,N/A,N/A,N/A,N/A,N/A -lname13,fname13,a@b.com,c@d.com,35.75418994,27.7027027,74.19354839,88.23529412,100,100,0,0,0,0,0,0,0,0,0,N/A,100,100,N/A,N/A,0,N/A,N/A,N/A,N/A,N/A,N/A -lname14,fname14,a@b.com,c@d.com,45.81005587,49.32432432,29.03225806,82.35294118,100,92.85714286,54.54545455,81.25,6.666666667,100,76.92307692,6.666666667,0,0,0,N/A,61.53846154,10,N/A,N/A,0,N/A,N/A,N/A,N/A,N/A,N/A -lname15,fname15,a@b.com,c@d.com,16.75977654,16.89189189,16.12903226,88.23529412,83.33333333,0,0,0,0,0,0,0,0,0,0,N/A,38.46153846,0,N/A,N/A,0,N/A,N/A,N/A,N/A,N/A,N/A -lname16,fname16,a@b.com,c@d.com,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,N/A,100,100,N/A,N/A,100,N/A,N/A,N/A,N/A,N/A,N/A \ No newline at end of file diff --git a/src/test/resources/author/io/mediumGraphLearnObjectLinkRecordsCreationTest.json b/src/test/resources/author/io/mediumGraphLearnObjectLinkRecordsCreationTest.json index 157f77a..a0e5a4d 100644 --- a/src/test/resources/author/io/mediumGraphLearnObjectLinkRecordsCreationTest.json +++ b/src/test/resources/author/io/mediumGraphLearnObjectLinkRecordsCreationTest.json @@ -1,57 +1,57 @@ [ { - "learningResourceId" : "Q1", + "text": "Q1", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Q2", + "text": "Q2", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Q3", + "text": "Q3", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Q4", + "text": "Q4", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Q5", + "text": "Q5", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Q6", + "text": "Q6", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Q7", + "text": "Q7", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Q8", + "text": "Q8", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Q9", + "text": "Q9", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Q10", + "text": "Q10", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Q11", + "text": "Q11", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Q12", + "text": "Q12", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Q13", + "text": "Q13", "conceptIds" : [ ], "dataImportance" : 1.0 }, { - "learningResourceId" : "Q14", + "text": "Q14", "conceptIds" : [ ], "dataImportance" : 1.0 } ] \ No newline at end of file diff --git a/src/test/resources/author/io/recordToJson.json b/src/test/resources/author/io/recordToJson.json index 652e921..3c9565f 100644 --- a/src/test/resources/author/io/recordToJson.json +++ b/src/test/resources/author/io/recordToJson.json @@ -1 +1,2 @@ -{"learningResourceId":"id 1","conceptIds":["concept 1","concept 2"],"dataImportance":1.0} \ No newline at end of file +{ + "text":"id 1","conceptIds":["concept 1","concept 2"],"dataImportance":1.0} \ No newline at end of file diff --git a/src/test/resources/author/practicalExamples/advancedRealisticAssessment.csv b/src/test/resources/author/practicalExamples/advancedRealisticAssessment.csv index 7868669..4ea2645 100644 --- a/src/test/resources/author/practicalExamples/advancedRealisticAssessment.csv +++ b/src/test/resources/author/practicalExamples/advancedRealisticAssessment.csv @@ -1,21 +1,12 @@ student ID,Name,Q1 [1],Q2 [1],Q3 [1],Q4 [1],Q5 [1],Q6 [1],Q7 [1],Q8 [1],Q9 [1],Q10 [1],Q11 [1],Q12 [1],Q13 [1],Q14 [1],Q15 [1] stu1,Stu1,1,1,-1,1,1,1,1,1,1,1,-1,1,-1,0,-1 - stu2,Stu2,0,-1,1,0,1,1,1,1,1,1,1,1,1,1,1 - stu3,Stu3,0,1,1,0,-1,1,1,1,1,1,1,1,1,1,1 - stu4,Stu4,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1 - stu5,Stu5,0,0,1,-1,1,1,1,1,1,1,1,1,1,1,1 - stu6,Stu6,0,0,1,-1,0,1,1,1,1,1,1,1,1,1,1 - stu7,Stu7,0,-1,1,-1,0,1,1,1,1,1,1,1,1,1,1 - stu8,Stu8,-1,0,1,-1,0,1,1,1,1,1,1,1,1,1,1 - stu9,Stu9,-1,0,1,-1,-1,1,1,1,1,1,1,1,1,1,1 - stu10,Stu10,-1,0,1,-1,-1,1,1,1,1,1,1,1,1,1,1 diff --git a/src/test/resources/author/practicalExamples/basicRealisticAssessment.csv b/src/test/resources/author/practicalExamples/basicRealisticAssessment.csv index d794cdd..96646f0 100644 --- a/src/test/resources/author/practicalExamples/basicRealisticAssessment.csv +++ b/src/test/resources/author/practicalExamples/basicRealisticAssessment.csv @@ -1,11 +1,7 @@ student ID,Name,Q1 [10],Q2 [20],Q3 [20],Q4 [5],Q5 [5],Q6 [1],Q7 [1],Q8 [1],Q9 [30],Q10 [40],Q11 [3],Q12 [3],Q13 [3],Q14 [5],Q15 [5] stu1,Stu1,10,20,20,5,5,1,1,1,30,40,3,3,3,5,5 - stu2,Stu2,10,20,20,5,5,1,1,1,30,40,3,3,3,5,5 - stu3,Stu3,10,20,20,5,5,1,1,1,30,40,3,3,3,5,5 - stu4,Stu4,10,20,20,5,5,1,1,1,30,40,3,3,3,5,5 - stu5,Stu5,10,20,20,5,5,1,1,1,30,40,3,3,3,5,5 \ No newline at end of file diff --git a/src/test/resources/author/practicalExamples/mediumRealisticResource.json b/src/test/resources/author/practicalExamples/mediumRealisticResource.json index 148098e..db9c4cd 100644 --- a/src/test/resources/author/practicalExamples/mediumRealisticResource.json +++ b/src/test/resources/author/practicalExamples/mediumRealisticResource.json @@ -1,17 +1,17 @@ [ - {"learningResourceId":"Q1", + {"text":"Q1", "conceptIds":[ "If Statement" ], "dataImportance": "1" }, - {"learningResourceId":"Q2", + {"text":"Q2", "conceptIds":[ "If Statement" ], "dataImportance": "1" }, - {"learningResourceId":"Q3", + {"text":"Q3", "conceptIds":[ "For Loop", "Sequence Types", @@ -19,7 +19,7 @@ ], "dataImportance": "1" }, - {"learningResourceId":"Q4", + {"text":"Q4", "conceptIds":[ "Boolean Expressions", "Boolean", @@ -27,7 +27,7 @@ ], "dataImportance": "1" }, - {"learningResourceId":"Q5", + {"text":"Q5", "conceptIds":[ "Boolean Expressions", "Boolean", @@ -35,25 +35,25 @@ ], "dataImportance": "1" }, - {"learningResourceId":"Q6", + {"text":"Q6", "conceptIds":[ "Boolean" ], "dataImportance": "1" }, - {"learningResourceId":"Q7", + {"text":"Q7", "conceptIds":[ "Boolean", "Operators" ], "dataImportance": "1" }, - {"learningResourceId":"Q8", + {"text":"Q8", "conceptIds":[ "Operators" ], "dataImportance": "1" - },{"learningResourceId":"Q9", + },{"text":"Q9", "conceptIds":[ "While Loop", "Boolean Expressions", @@ -62,31 +62,31 @@ ], "dataImportance": "1" }, - {"learningResourceId":"Q10", + {"text":"Q10", "conceptIds":[ "While Loop" ], "dataImportance": "1" }, - {"learningResourceId":"Q11", + {"text":"Q11", "conceptIds":[ "List" ], "dataImportance": "1" }, - {"learningResourceId":"Q12", + {"text":"Q12", "conceptIds":[ "String" ], "dataImportance": "1" }, - {"learningResourceId":"Q13", + {"text":"Q13", "conceptIds":[ "List" ], "dataImportance": "1" }, - {"learningResourceId":"Q14", + {"text":"Q14", "conceptIds":[ "Sequence Types", "String", @@ -94,7 +94,7 @@ ], "dataImportance": "1" }, - {"learningResourceId":"Q15", + {"text":"Q15", "conceptIds":[ "Sequence Types", "List" diff --git a/src/test/resources/author/tecmapExamples/Cs1ExampleResources.json b/src/test/resources/author/tecmapExamples/Cs1ExampleResources.json index e741074..d734c4f 100644 --- a/src/test/resources/author/tecmapExamples/Cs1ExampleResources.json +++ b/src/test/resources/author/tecmapExamples/Cs1ExampleResources.json @@ -1,59 +1,59 @@ [ { - "learningResourceId" : "Q1", + "text" : "Q1", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "If Statements"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Q2", + "text" : "Q2", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "While Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Q3", + "text" : "Q3", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "For Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Q4", + "text" : "Q4", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Q5", + "text" : "Q5", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "Intro CS"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 100.0 }, { - "learningResourceId" : "HW1", + "text" : "HW1", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "Boolean Expressions"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 1.0 }, { - "learningResourceId" : "HW2", + "text" : "HW2", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "Boolean Expressions"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "HW3", + "text" : "HW3", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "If Statements"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 2.0 }, { - "learningResourceId" : "HW4", + "text" : "HW4", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "While Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 1.0 }, { - "learningResourceId" : "HW5", + "text" : "HW5", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "For Loops"], "dataImportance" : 0.0, diff --git a/src/test/resources/datastore/AnalysisExample/AnalysisResources.json b/src/test/resources/datastore/AnalysisExample/AnalysisResources.json index 48dadaa..fa39cd7 100644 --- a/src/test/resources/datastore/AnalysisExample/AnalysisResources.json +++ b/src/test/resources/datastore/AnalysisExample/AnalysisResources.json @@ -1,29 +1,29 @@ [ { - "learningResourceId" : "Q1", + "text" : "Q1", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "If Statements"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Q2", + "text" : "Q2", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "While Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Q3", + "text" : "Q3", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "For Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Q4", + "text" : "Q4", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Q5", + "text" : "Q5", "resourceTypes" : [ "ASSESSMENT" ], "conceptIds" : [ "Intro CS"], "dataImportance" : 0.0, diff --git a/src/test/resources/datastore/BayesTest/sanityCheck.csv b/src/test/resources/datastore/BayesTest/sanityCheck.csv index 7ea00c0..ef8e995 100644 --- a/src/test/resources/datastore/BayesTest/sanityCheck.csv +++ b/src/test/resources/datastore/BayesTest/sanityCheck.csv @@ -1,4 +1,5 @@ Student ID ,Name ,Q1 [10],Q2 [10] ,Q3 [10] ,Exam [10] + s1,s1,7,7,6,5 s2,s2,8,10,9,10 s3,s3,5,1,4,5 diff --git a/src/test/resources/datastore/BayesTest/sanityCheckWNoise.csv b/src/test/resources/datastore/BayesTest/sanityCheckWNoise.csv index f5725e1..4686c2a 100644 --- a/src/test/resources/datastore/BayesTest/sanityCheckWNoise.csv +++ b/src/test/resources/datastore/BayesTest/sanityCheckWNoise.csv @@ -1,4 +1,5 @@ Student ID ,Name ,Q1 [10],Q2 [10] ,Q3 [10] ,Exam [10] + s1,s1,0,8,1,4 s2,s2,8,7,4,2 s3,s3,1,7,5,6 diff --git a/src/test/resources/datastore/BayesTest/test10000RowAssessment.csv b/src/test/resources/datastore/BayesTest/test10000RowAssessment.csv index 0646c5d..58c4cfe 100644 --- a/src/test/resources/datastore/BayesTest/test10000RowAssessment.csv +++ b/src/test/resources/datastore/BayesTest/test10000RowAssessment.csv @@ -1,4 +1,5 @@ Student ID,Name,Q1 [10],Q2 [10],Q3 [5],Exam [10] + s1,s1,6,3,2,3 s2,s2,8,5,0,5 s3,s3,5,9,1,9 diff --git a/src/test/resources/datastore/BayesTest/test4ColResources.json b/src/test/resources/datastore/BayesTest/test4ColResources.json index 3b3d27b..dd6800c 100644 --- a/src/test/resources/datastore/BayesTest/test4ColResources.json +++ b/src/test/resources/datastore/BayesTest/test4ColResources.json @@ -1,23 +1,23 @@ [ { - "learningResourceId" : "Q1", + "text": "Q1", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "Q1" ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Q2", + "text": "Q2", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "Q2" ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Q3", + "text": "Q3", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "Q3" ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Exam", + "text": "Exam", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "Exam" ], "dataImportance" : 0.0, diff --git a/src/test/resources/datastore/CanvasFiles/CanvasGradeExample.csv b/src/test/resources/datastore/ConvertToCanvasFiles/CanvasGradeExample.csv similarity index 85% rename from src/test/resources/datastore/CanvasFiles/CanvasGradeExample.csv rename to src/test/resources/datastore/ConvertToCanvasFiles/CanvasGradeExample.csv index 24d75b4..ce09f8c 100644 --- a/src/test/resources/datastore/CanvasFiles/CanvasGradeExample.csv +++ b/src/test/resources/datastore/ConvertToCanvasFiles/CanvasGradeExample.csv @@ -1,11 +1,11 @@ -Student,ID,SIS Login ID,Section,172-Task00-01-Reading-Python Review (227500),172-Task00-02- Structure and Testing - Setup (228223),172-Task00-03 - The TDD Cycle (228513),172-Task00-04-Reading-Unit Testing (228514),172-Task00-05- Tracing Practice (229747),172-Task01-01 - Reading - OOP: Using Objects (229748),172-Task01-02- Turtle Trace (229888),172-Task01-03-Reading- OOP (229889),172-Task01-04- Tracing Objects (230529) -,,,,Manual Posting,Manual Posting,Manual Posting,Manual Posting,Manual Posting,Manual Posting,Manual Posting,Manual Posting,Manual Posting -Points Possible,,,,4,2,10,3,3,2,1.5,3,3 -Leo,1,,COMP 17200 01 SP2024,4,2,7.5,0,3,0,0,0,2.9 -Athena,2,,COMP 17200 01 SP2025,0,0,0,0,0,0,0,0,0 -Belle,3,,COMP 17200 01 SP2026,4,2,8.5,3,3,2,3,3,2.5 -Lucy,4,,COMP 17200 01 SP2027,4,2,10,3,3,2,3,2.9,3 -Mark,5,,COMP 17200 01 SP2028,4,2,10,3,3,2,3,3,2.5 -James,6,,COMP 17200 01 SP2029,4,2,10,3,3,2,3,3,3 -Ivy,7,,COMP 17200 01 SP2030,4,2,8.5,2,3,1.5,0,2,1 +Student,ID,SIS Login ID,Section,172-Task00-01-Reading-Python Review (227500),172-Task00-02- Structure and Testing - Setup (228223),172-Task00-03 - The TDD Cycle (228513),172-Task00-04-Reading-Unit Testing (228514),172-Task00-05- Tracing Practice (229747),172-Task01-01 - Reading - OOP: Using Objects (229748),172-Task01-02- Turtle Trace (229888),172-Task01-03-Reading- OOP (229889),172-Task01-04- Tracing Objects (230529) + +Points Possible,,,,4,2,10,3,3,2,1.5,3,3 +Leo,1,,COMP 17200 01 SP2024,4,2,7.5,0,3,0,0,0,2.9 +Athena,2,,COMP 17200 01 SP2025,0,0,0,0,0,0,0,0,0 +Belle,3,,COMP 17200 01 SP2026,4,2,8.5,3,3,2,3,3,2.5 +Lucy,4,,COMP 17200 01 SP2027,4,2,10,3,3,2,3,2.9,3 +Mark,5,,COMP 17200 01 SP2028,4,2,10,3,3,2,3,3,2.5 +James,6,,COMP 17200 01 SP2029,4,2,10,3,3,2,3,3,3 +Ivy,7,,COMP 17200 01 SP2030,4,2,8.5,2,3,1.5,0,2,1 Gary,8,,COMP 17200 01 SP2031,0,2,8.5,2.9,3,2,3,0,3 \ No newline at end of file diff --git a/src/test/resources/datastore/ConvertToCanvasFiles/CorrectGradeStartColumnIndex.csv b/src/test/resources/datastore/ConvertToCanvasFiles/CorrectGradeStartColumnIndex.csv new file mode 100644 index 0000000..e7d774b --- /dev/null +++ b/src/test/resources/datastore/ConvertToCanvasFiles/CorrectGradeStartColumnIndex.csv @@ -0,0 +1,11 @@ +Student,ID,,,172-Task00-01-Reading-Python Review (227500),172-Task00-02- Structure and Testing - Setup (228223),172-Task00-03 - The TDD Cycle (228513),172-Task00-04-Reading-Unit Testing (228514),172-Task00-05- Tracing Practice (229747),172-Task01-01 - Reading - OOP: Using Objects (229748),172-Task01-02- Turtle Trace (229888),172-Task01-03-Reading- OOP (229889),172-Task01-04- Tracing Objects (230529) + +Points Possible,,,,4,2,10,3,3,2,1.5,3,3 +Leo,1,,,4,2,7.5,0,3,0,0,0,2.9 +Athena,2,,,0,0,0,0,0,0,0,0,0 +Belle,3,,,4,2,8.5,3,3,2,3,3,2.5 +Lucy,4,,,4,2,10,3,3,2,3,2.9,3 +Mark,5,,,4,2,10,3,3,2,3,3,2.5 +James,6,,,4,2,10,3,3,2,3,3,3 +Ivy,7,,,4,2,8.5,2,3,1.5,0,2,1 +Gary,8,,,0,2,8.5,2.9,3,2,3,0,3 \ No newline at end of file diff --git a/src/test/resources/datastore/CanvasFiles/convertedCanvasGradeExample.csv b/src/test/resources/datastore/ConvertToCanvasFiles/WithoutMaxScoreRow.csv similarity index 82% rename from src/test/resources/datastore/CanvasFiles/convertedCanvasGradeExample.csv rename to src/test/resources/datastore/ConvertToCanvasFiles/WithoutMaxScoreRow.csv index a5dbab9..e245fdc 100644 --- a/src/test/resources/datastore/CanvasFiles/convertedCanvasGradeExample.csv +++ b/src/test/resources/datastore/ConvertToCanvasFiles/WithoutMaxScoreRow.csv @@ -1,6 +1,5 @@ Student,ID,SIS Login ID,Section,172-Task00-01-Reading-Python Review (227500) [4],172-Task00-02- Structure and Testing - Setup (228223) [2],172-Task00-03 - The TDD Cycle (228513) [10],172-Task00-04-Reading-Unit Testing (228514) [3],172-Task00-05- Tracing Practice (229747) [3],172-Task01-01 - Reading - OOP: Using Objects (229748) [2],172-Task01-02- Turtle Trace (229888) [1.5],172-Task01-03-Reading- OOP (229889) [3],172-Task01-04- Tracing Objects (230529) [3] -,,,,Manual Posting,Manual Posting,Manual Posting,Manual Posting,Manual Posting,Manual Posting,Manual Posting,Manual Posting,Manual Posting -Points Possible,,,,4,2,10,3,3,2,1.5,3,3 + Leo,1,,COMP 17200 01 SP2024,4,2,7.5,0,3,0,0,0,2.9 Athena,2,,COMP 17200 01 SP2025,0,0,0,0,0,0,0,0,0 Belle,3,,COMP 17200 01 SP2026,4,2,8.5,3,3,2,3,3,2.5 diff --git a/src/test/resources/datastore/ConvertToCanvasFiles/WrongGradeStartColumnIndex.csv b/src/test/resources/datastore/ConvertToCanvasFiles/WrongGradeStartColumnIndex.csv new file mode 100644 index 0000000..25e9cfc --- /dev/null +++ b/src/test/resources/datastore/ConvertToCanvasFiles/WrongGradeStartColumnIndex.csv @@ -0,0 +1,11 @@ +Student,ID,172-Task00-01-Reading-Python Review (227500),172-Task00-02- Structure and Testing - Setup (228223),172-Task00-03 - The TDD Cycle (228513),172-Task00-04-Reading-Unit Testing (228514),172-Task00-05- Tracing Practice (229747),172-Task01-01 - Reading - OOP: Using Objects (229748),172-Task01-02- Turtle Trace (229888),172-Task01-03-Reading- OOP (229889),172-Task01-04- Tracing Objects (230529) + +Points Possible,,4,2,10,3,3,2,1.5,3,3 +Leo,1,4,2,7.5,0,3,0,0,0,2.9 +Athena,2,0,0,0,0,0,0,0,0,0 +Belle,3,4,2,8.5,3,3,2,3,3,2.5 +Lucy,4,4,2,10,3,3,2,3,2.9,3 +Mark,5,4,2,10,3,3,2,3,3,2.5 +James,6,4,2,10,3,3,2,3,3,3 +Ivy,7,4,2,8.5,2,3,1.5,0,2,1 +Gary,8,0,2,8.5,2.9,3,2,3,0,3 \ No newline at end of file diff --git a/src/test/resources/datastore/ConvertToCanvasFiles/WrongIdAndStudentColumn.csv b/src/test/resources/datastore/ConvertToCanvasFiles/WrongIdAndStudentColumn.csv new file mode 100644 index 0000000..2312a63 --- /dev/null +++ b/src/test/resources/datastore/ConvertToCanvasFiles/WrongIdAndStudentColumn.csv @@ -0,0 +1,11 @@ +ID,Student,SIS Login ID,Section,172-Task00-01-Reading-Python Review (227500),172-Task00-02- Structure and Testing - Setup (228223),172-Task00-03 - The TDD Cycle (228513),172-Task00-04-Reading-Unit Testing (228514),172-Task00-05- Tracing Practice (229747),172-Task01-01 - Reading - OOP: Using Objects (229748),172-Task01-02- Turtle Trace (229888),172-Task01-03-Reading- OOP (229889),172-Task01-04- Tracing Objects (230529) + +Points Possible,,,,4,2,10,3,3,2,1.5,3,3 +1,Leo,,COMP 17200 01 SP2024,4,2,7.5,0,3,0,0,0,2.9 +2,Athena,,COMP 17200 01 SP2025,0,0,0,0,0,0,0,0,0 +3,Belle,,COMP 17200 01 SP2026,4,2,8.5,3,3,2,3,3,2.5 +4,Lucy,,COMP 17200 01 SP2027,4,2,10,3,3,2,3,2.9,3 +5,Mark,,COMP 17200 01 SP2028,4,2,10,3,3,2,3,3,2.5 +6,James,,COMP 17200 01 SP2029,4,2,10,3,3,2,3,3,3 +7,Ivy,,COMP 17200 01 SP2030,4,2,8.5,2,3,1.5,0,2,1 +8,Gary,,COMP 17200 01 SP2031,0,2,8.5,2.9,3,2,3,0,3 \ No newline at end of file diff --git a/src/test/resources/datastore/ConvertToCanvasFiles/canvasConverterTest1.csv b/src/test/resources/datastore/ConvertToCanvasFiles/canvasConverterTest1.csv new file mode 100644 index 0000000..f2aaa98 --- /dev/null +++ b/src/test/resources/datastore/ConvertToCanvasFiles/canvasConverterTest1.csv @@ -0,0 +1,10 @@ +ID,Student,SIS Login ID,Section,172-Task00-01-Reading-Python Review (227500) [4],172-Task00-02- Structure and Testing - Setup (228223) [2],172-Task00-03 - The TDD Cycle (228513) [10],172-Task00-04-Reading-Unit Testing (228514) [3],172-Task00-05- Tracing Practice (229747) [3],172-Task01-01 - Reading - OOP: Using Objects (229748) [2],172-Task01-02- Turtle Trace (229888) [1.5],172-Task01-03-Reading- OOP (229889) [3],172-Task01-04- Tracing Objects (230529) [3] + +1,Leo,,COMP 17200 01 SP2024,4,2,7.5,0,3,0,0,0,2.9 +2,Athena,,COMP 17200 01 SP2025,0,0,0,0,0,0,0,0,0 +3,Belle,,COMP 17200 01 SP2026,4,2,8.5,3,3,2,3,3,2.5 +4,Lucy,,COMP 17200 01 SP2027,4,2,10,3,3,2,3,2.9,3 +5,Mark,,COMP 17200 01 SP2028,4,2,10,3,3,2,3,3,2.5 +6,James,,COMP 17200 01 SP2029,4,2,10,3,3,2,3,3,3 +7,Ivy,,COMP 17200 01 SP2030,4,2,8.5,2,3,1.5,0,2,1 +8,Gary,,COMP 17200 01 SP2031,0,2,8.5,2.9,3,2,3,0,3 \ No newline at end of file diff --git a/src/test/resources/datastore/ConvertToCanvasFiles/canvasConverterTest2.csv b/src/test/resources/datastore/ConvertToCanvasFiles/canvasConverterTest2.csv new file mode 100644 index 0000000..5288039 --- /dev/null +++ b/src/test/resources/datastore/ConvertToCanvasFiles/canvasConverterTest2.csv @@ -0,0 +1,10 @@ +Student,ID,172-Task00-01-Reading-Python Review (227500) [4],172-Task00-02- Structure and Testing - Setup (228223) [2],172-Task00-03 - The TDD Cycle (228513) [10],172-Task00-04-Reading-Unit Testing (228514) [3],172-Task00-05- Tracing Practice (229747) [3],172-Task01-01 - Reading - OOP: Using Objects (229748) [2],172-Task01-02- Turtle Trace (229888) [1.5],172-Task01-03-Reading- OOP (229889) [3],172-Task01-04- Tracing Objects (230529) [3] + +Leo,1,4,2,7.5,0,3,0,0,0,2.9 +Athena,2,0,0,0,0,0,0,0,0,0 +Belle,3,4,2,8.5,3,3,2,3,3,2.5 +Lucy,4,4,2,10,3,3,2,3,2.9,3 +Mark,5,4,2,10,3,3,2,3,3,2.5 +James,6,4,2,10,3,3,2,3,3,3 +Ivy,7,4,2,8.5,2,3,1.5,0,2,1 +Gary,8,0,2,8.5,2.9,3,2,3,0,3 \ No newline at end of file diff --git a/src/test/resources/datastore/ConvertToCanvasFiles/canvasConverterTest3.csv b/src/test/resources/datastore/ConvertToCanvasFiles/canvasConverterTest3.csv new file mode 100644 index 0000000..65de9f2 --- /dev/null +++ b/src/test/resources/datastore/ConvertToCanvasFiles/canvasConverterTest3.csv @@ -0,0 +1,11 @@ +ID,Student,172-Task00-01-Reading-Python Review (227500),172-Task00-02- Structure and Testing - Setup (228223),172-Task00-03 - The TDD Cycle (228513),172-Task00-04-Reading-Unit Testing (228514),172-Task00-05- Tracing Practice (229747),172-Task01-01 - Reading - OOP: Using Objects (229748),172-Task01-02- Turtle Trace (229888),172-Task01-03-Reading- OOP (229889),172-Task01-04- Tracing Objects (230529) + +Points Possible,,4,2,10,3,3,2,1.5,3,3 +1,Leo,4,2,7.5,0,3,0,0,0,2.9 +2,Athena,0,0,0,0,0,0,0,0,0 +3,Belle,4,2,8.5,3,3,2,3,3,2.5 +4,Lucy,4,2,10,3,3,2,3,2.9,3 +5,Mark,4,2,10,3,3,2,3,3,2.5 +6,James,4,2,10,3,3,2,3,3,3 +7,Ivy,4,2,8.5,2,3,1.5,0,2,1 +8,Gary,0,2,8.5,2.9,3,2,3,0,3 \ No newline at end of file diff --git a/src/test/resources/datastore/Cs1Example/Cs1ExampleResources.json b/src/test/resources/datastore/Cs1Example/Cs1ExampleResources.json index ae0c543..0dcaa28 100644 --- a/src/test/resources/datastore/Cs1Example/Cs1ExampleResources.json +++ b/src/test/resources/datastore/Cs1Example/Cs1ExampleResources.json @@ -1,59 +1,59 @@ [ { - "learningResourceId" : "Q1", + "text" : "Q1", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "If Statements"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Q2", + "text" : "Q2", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "While Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Q3", + "text" : "Q3", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "For Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Q4", + "text" : "Q4", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Q5", + "text" : "Q5", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "Intro CS"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 100.0 }, { - "learningResourceId" : "HW1", + "text" : "HW1", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "Boolean Expressions"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 1.0 }, { - "learningResourceId" : "HW2", + "text" : "HW2", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "Boolean Expressions"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "HW3", + "text" : "HW3", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "If Statements"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 2.0 }, { - "learningResourceId" : "HW4", + "text" : "HW4", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "While Loops"], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 1.0 }, { - "learningResourceId" : "HW5", + "text" : "HW5", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ "For Loops"], "dataImportance" : 0.0, diff --git a/src/test/resources/datastore/Cs1ExampleAssessmentAdded/Cs1ExampleAssessmentAddedResources-backup-1.json b/src/test/resources/datastore/Cs1ExampleAssessmentAdded/Cs1ExampleAssessmentAddedResources-backup-1.json index 77e4480..d2f699f 100644 --- a/src/test/resources/datastore/Cs1ExampleAssessmentAdded/Cs1ExampleAssessmentAddedResources-backup-1.json +++ b/src/test/resources/datastore/Cs1ExampleAssessmentAdded/Cs1ExampleAssessmentAddedResources-backup-1.json @@ -1,59 +1,59 @@ [ { - "learningResourceId" : "Q1", + "text": "Q1", "resourceTypes" : [ "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Q2", + "text": "Q2", "resourceTypes" : [ "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Q3", + "text": "Q3", "resourceTypes" : [ "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Q4", + "text": "Q4", "resourceTypes" : [ "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Q5", + "text": "Q5", "resourceTypes" : [ "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 100.0 }, { - "learningResourceId" : "HW1", + "text": "HW1", "resourceTypes" : [ "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 1.0 }, { - "learningResourceId" : "HW2", + "text": "HW2", "resourceTypes" : [ "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "HW3", + "text": "HW3", "resourceTypes" : [ "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 2.0 }, { - "learningResourceId" : "HW4", + "text": "HW4", "resourceTypes" : [ "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 1.0 }, { - "learningResourceId" : "HW5", + "text": "HW5", "resourceTypes" : [ "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, diff --git a/src/test/resources/datastore/Cs1ExampleAssessmentAdded/Cs1ExampleAssessmentAddedResources-backup-2.json b/src/test/resources/datastore/Cs1ExampleAssessmentAdded/Cs1ExampleAssessmentAddedResources-backup-2.json index 249f14b..a3bde7d 100644 --- a/src/test/resources/datastore/Cs1ExampleAssessmentAdded/Cs1ExampleAssessmentAddedResources-backup-2.json +++ b/src/test/resources/datastore/Cs1ExampleAssessmentAdded/Cs1ExampleAssessmentAddedResources-backup-2.json @@ -1,59 +1,59 @@ [ { - "learningResourceId" : "Q1", + "text": "Q1", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Q2", + "text": "Q2", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Q3", + "text": "Q3", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 10.0 }, { - "learningResourceId" : "Q4", + "text": "Q4", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "Q5", + "text": "Q5", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 100.0 }, { - "learningResourceId" : "HW1", + "text": "HW1", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 1.0 }, { - "learningResourceId" : "HW2", + "text": "HW2", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 5.0 }, { - "learningResourceId" : "HW3", + "text": "HW3", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 2.0 }, { - "learningResourceId" : "HW4", + "text": "HW4", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0, "maxPossibleKnowledgeEstimate" : 1.0 }, { - "learningResourceId" : "HW5", + "text": "HW5", "resourceTypes" : [ "ASSESSMENT", "PRACTICE" ], "conceptIds" : [ ], "dataImportance" : 0.0,