public boolean subtst(String enu,String name, String[] results,int Questionscount) throws AssessmentNotExist{
		dbtang = new CouchDbClient(ASSDb,false,HEADER,HOST,PORT,USR,PWD);
		List<JsonObject> json = dbtang.view("tangerine/byDKey")
										.includeDocs(true)
										.key(dkey)
										.query(JsonObject.class);
		List<JsonObject> json2 = new ArrayList<JsonObject>();
		rslt = new JsonObject();
		String col ="";
		JsonArray colls = new JsonArray();
		for (int i = 0; i < json.size(); i++) {
			JsonObject el = json.get(i);
			SubtestDoc subDoc = new SubtestDoc();
			if(el.get("collection") != null){
				col = el.get("collection").getAsString();
				switch (col){
					case "assessment":
						rslt.add("assessmentId", el.get("assessmentId"));
						rslt.add("assessmentName", el.get("name"));
						rslt.addProperty("start_time", System.currentTimeMillis());
						rslt.addProperty("enumerator", enu);
						rslt.addProperty("collection", "result");
						break;
					case "subtest":
						//System.out.println(el.get("name").getAsString());
						subDoc.setname(el.get("name").getAsString());
						subDoc.setprototype(el.get("prototype").getAsString());
						subDoc.setsubtestId(el.get("_id").getAsString());
						if (el.get("prototype").getAsString().equals("location") || el.get("prototype").getAsString().equals("datetime")){
							subDoc.setsum(1, 0, 0, 1);
						}else{
							subDoc.setsum(0, 0, 0, 0);
						}
						if(el.get("prototype").getAsString().equals("location")){
							subDoc.setloc(name);
						}else{
							subDoc.setdata(json,el.get("prototype").getAsString(),seqdoc.getqSeq(),results,seqdoc.getoptSeq(),Questionscount);
						}
						
						colls.add(subDoc.toJson());
						break;
					default:
						break;
				}
			}
		}
		System.out.println(colls.size());
		if(colls.size() < 3) throw new AssessmentNotExist(""+dkey);
		JsonObject 	tmptime = colls.get(colls.size()-1).getAsJsonObject(),
					tmpname = colls.get(colls.size()-2).getAsJsonObject();
		System.out.println(tmpname.toString());
		System.out.println(tmptime.toString());
		JsonArray ordcolls = new JsonArray();
		ordcolls.add(tmpname);
		ordcolls.add(tmptime);
		
		for (int i = 0; i < colls.size()-2; i++) {
			ordcolls.add(colls.get(i));
		}
		SubtestDoc comp = new SubtestDoc();
		comp.setname("Assessment complete");
		comp.setprototype("complete");
		comp.setsubtestId("result");
		comp.setsum(1, 0, 0, 1);
		comp.setdata("complete");
		ordcolls.add(comp.toJson());
		json2.add(comp.toJson());
		rslt.add("subtestData", ordcolls);
		System.out.println(rslt);
		dbtang.shutdown();
		return true;
	}