Subversion Repositories SmartDukaan

Rev

Rev 8024 | Rev 8659 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8024 Rev 8025
Line 1631... Line 1631...
1631
    
1631
    
1632
    public String getFormattedDate(Date date){
1632
    public String getFormattedDate(Date date){
1633
    	return sdf.format(date);
1633
    	return sdf.format(date);
1634
    }
1634
    }
1635
    
1635
    
1636
    public Map<String, Double> getScores() throws Exception{
1636
    public Map<Object, Double> getScores() throws Exception{
1637
    	Long entityId = Long.parseLong(this.id);
1637
    	Long entityId = Long.parseLong(this.id);
1638
    	Map<String,Double> finalScores = new HashMap<String, Double>();
1638
    	Map<Object,Double> finalScores = new HashMap<Object, Double>();
1639
    	EntityState es = CreationUtils.getEntityState(entityId);
1639
    	EntityState es = CreationUtils.getEntityState(entityId);
1640
    	if (es!=null && es.getCategoryID() > 0) {
1640
    	if (es!=null && es.getCategoryID() > 0) {
1641
	    	if((es.getCategoryID() == 10002l || es.getCategoryID() == 10003l || es.getCategoryID() == 10004l || es.getCategoryID() == 10005l) && !es.getStatus().equals(EntityStatus.UNASSIGNED)){
1641
	    	if((es.getCategoryID() == 10002l || es.getCategoryID() == 10003l || es.getCategoryID() == 10004l || es.getCategoryID() == 10005l) && !es.getStatus().equals(EntityStatus.UNASSIGNED)){
1642
		    	NewCMP cmp = new NewCMP(Arrays.asList(this.entity));
1642
		    	NewCMP cmp = new NewCMP(Arrays.asList(this.entity));
1643
				try {
1643
				try {
1644
					//get Scores on the basis of evaluation
1644
					//get Scores on the basis of evaluation
1645
					Map<Long, Map<Long, Double>> scoreMap = cmp.getSlideScores(0);
1645
					Map<Long, Map<Long, Double>> scoreMap = cmp.getSlideScores(0);
-
 
1646
					finalScores = new HashMap<Object, Double>(scoreMap.get(entityId));
-
 
1647
					finalScores.put(130054L, cmp.getFinalScores(scoreMap).get(entityId)/10);
1646
					finalScores.put("actual", cmp.getFinalScores(scoreMap).get(entityId)/10);
1648
					finalScores.put("actual", cmp.getFinalScores(scoreMap).get(entityId)/10);
1647
					
1649
					
1648
					Map<Long, Double> customScores = CreationUtils.getCustomSlideComparisonScores(entityId);
1650
					Map<Long, Double> customScores = CreationUtils.getCustomSlideComparisonScores(entityId);
1649
					if(customScores != null){
1651
					if(customScores != null){
1650
						//now update scoreMap if any of the slide score has been customised
1652
						//now update scoreMap if any of the slide score has been customised
Line 1659... Line 1661...
1659
				} catch (Exception e) {
1661
				} catch (Exception e) {
1660
					System.out.println("Some error occurred");
1662
					System.out.println("Some error occurred");
1661
					e.printStackTrace();
1663
					e.printStackTrace();
1662
				}
1664
				}
1663
				DecimalFormat oneDForm = new DecimalFormat("#.#");
1665
				DecimalFormat oneDForm = new DecimalFormat("#.#");
1664
				for(Map.Entry<String, Double> scoreEntry : finalScores.entrySet()){
1666
				for(Map.Entry<Object, Double> scoreEntry : finalScores.entrySet()){
1665
					scoreEntry.setValue(Double.valueOf(oneDForm.format(scoreEntry.getValue())));
1667
					scoreEntry.setValue(Double.valueOf(oneDForm.format(scoreEntry.getValue())));
1666
				}
1668
				}
1667
				return finalScores;
1669
				return finalScores;
1668
	    	} else {
1670
	    	} else {
1669
	    		return new HashMap<String, Double>();
1671
	    		return new HashMap<Object, Double>();
1670
	    	}
1672
	    	}
1671
    	} else {
1673
    	} else {
1672
    		return new HashMap<String, Double>();
1674
    		return new HashMap<Object, Double>();
1673
    	}
1675
    	}
1674
    }
1676
    }
1675
    
1677
    
1676
	
1678
	
1677
}
1679
}