Index: lams_tool_scratchie/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r5e1548fd8c9caed9a861784801054363e2efb400 -r53c3a625c611e2b5400a39d96628c774700d37ed --- lams_tool_scratchie/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 5e1548fd8c9caed9a861784801054363e2efb400) +++ lams_tool_scratchie/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 53c3a625c611e2b5400a39d96628c774700d37ed) @@ -85,7 +85,7 @@ label.authoring.basic.question.text =Question label.authoring.advanced.give.extra.point =Give an extra mark if the first scratchie attempt is the correct one. label.authoring.scratchie.answers =Scratchie answers -label.one.or.more.questions.not.completed =One or more questions have not being completed. If you are to continue, you won't be able to answer these questions at a later stage and you'll get zero point for this questions. Are you sure you want to continue? +label.one.or.more.questions.not.completed =One or more questions have not being completed. If you are to continue, you won't be able to answer these questions at a later stage and you'll get lowest score for this questions. Are you sure you want to continue? label.correct.answer =Correct answer label.mark =Mark label.attempts =Attempts Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java =================================================================== diff -u -rf5e59b4320e8fdfb492b6432ca965c2381918d91 -r53c3a625c611e2b5400a39d96628c774700d37ed --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java (.../ScratchieServiceImpl.java) (revision f5e59b4320e8fdfb492b6432ca965c2381918d91) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java (.../ScratchieServiceImpl.java) (revision 53c3a625c611e2b5400a39d96628c774700d37ed) @@ -610,6 +610,8 @@ ScratchieSession session = this.getScratchieSessionBySessionId(toolSessionId); session.setScratchingFinished(true); scratchieSessionDao.saveObject(session); + + recalculateMarkForSession(toolSessionId, false); } @Override @@ -821,8 +823,9 @@ private int getUserMarkPerItem(Scratchie scratchie, ScratchieItem item, List userLogs, String[] presetMarks) { - int mark = 0; - // add mark only if an item was unraveled + // get lowest mark by default + int mark = Integer.parseInt(presetMarks[presetMarks.length - 1]); + // add mark only if an item was unravelled if (isItemUnraveled(item, userLogs)) { int itemAttempts = calculateItemAttempts(userLogs, item); Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/controller/LearningController.java =================================================================== diff -u -r17de10bb40e34a174c19ccc0b8821bfe08025156 -r53c3a625c611e2b5400a39d96628c774700d37ed --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/controller/LearningController.java (.../LearningController.java) (revision 17de10bb40e34a174c19ccc0b8821bfe08025156) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/controller/LearningController.java (.../LearningController.java) (revision 53c3a625c611e2b5400a39d96628c774700d37ed) @@ -73,7 +73,6 @@ import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; import com.fasterxml.jackson.databind.node.JsonNodeFactory; @@ -398,8 +397,7 @@ */ @RequestMapping("/launchTimeLimit") @ResponseStatus(HttpStatus.OK) - private void launchTimeLimit(HttpServletRequest request) - throws ScratchieApplicationException, SchedulerException { + private void launchTimeLimit(HttpServletRequest request) throws ScratchieApplicationException, SchedulerException { String sessionMapID = WebUtil.readStrParam(request, ScratchieConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() .getAttribute(sessionMapID); @@ -448,6 +446,10 @@ int score = toolSession.getMark(); int maxScore = (Integer) sessionMap.get(ScratchieConstants.ATTR_MAX_SCORE); double percentage = (maxScore == 0) ? 0 : ((score * 100) / maxScore); + if (percentage < 0) { + // if lowest score for questions is negative, percentage can also be negative + percentage = 0; + } request.setAttribute(ScratchieConstants.ATTR_SCORE, (int) percentage); // display other groups' BurningQuestions