Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-45534

SAMIGO: Solving problems of calculation pattern

    XMLWordPrintable

Details

    • Please Merge
    • Please Merge
    • Hide
      1. Import the assessment
      2. You should edit the assessment
      3. You should edit and save the calculted question

      No error appears on log.

      1. Add a calculated question
      2. Fill Instructions
        [[3 * [phi]] ]
        
        Kevin tiene {x} manzanas. Él compra {y} más. Ahora Kevin tiene [[{x}+{y}]]. Jane come {z} manzanas. Kevin tiene ahora {{w}} manzanas.
        La fórmula w en el ejemplo anterior se definiría como: {x} + {y} - {z}
      1. Without this patch you can save but a UI warning should appear: 3 * [phi cannot be calculated and you cannot save. 
      Show
      Import the assessment You should edit the assessment You should edit and save the calculted question No error appears on log. — Add a calculated question Fill Instructions [[3 * [phi]] ] Kevin tiene {x} manzanas. Él compra {y} más. Ahora Kevin tiene [[{x}+{y}]]. Jane come {z} manzanas. Kevin tiene ahora {{w}} manzanas. La fórmula w en el ejemplo anterior se definiría como: {x} + {y} - {z} Without this patch you can save but a UI warning should appear: 3 * [phi cannot be calculated and you cannot save. 

    Description

      The main problem is that you cannot parse html-level languages ​​with infinite nests with regular expressions.

      We need to change the CALCQ_CALCULATION_PATTERN. 

      The new CALCQ_CALCULATION_PATTERN musn't include all the expression with [[ ]]

      Could be something like this: 

      \└([^\└\┐]+)\┐? 

      Key lines:

      We need to replace that [[ for another character (maybe └└ ) and ]] for another different character (maybe ┐┐). Avoid using mathematical characters as opening or closing like * +, etc. 

      https://github.com/sakaiproject/sakai/blob/ec8ee1cef6e2d7dffb5908baa492c504d8d65f4e/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/services/GradingService.java#L2767
      https://github.com/sakaiproject/sakai/blob/ec8ee1cef6e2d7dffb5908baa492c504d8d65f4e/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/services/GradingService.java#L3216

      https://github.com/sakaiproject/sakai/blob/master/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/services/GradingService.java#L117-L118

      15-abr-2021 10:23:46.303 WARN [ajp-nio-127.0.0.1-8016-exec-1] org.sakaiproject.portal.charon.handlers.SiteHandler.bufferContent Failed to buffer content.
      org.sakaiproject.tool.api.ToolException: javax.servlet.ServletException
      	at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:520)
      	at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1500)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doToolBuffer(SiteHandler.java:1262)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.bufferContent(SiteHandler.java:1096)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doSite(SiteHandler.java:508)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:280)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:164)
      	at org.sakaiproject.portal.charon.handlers.WorksiteHandler.doPost(WorksiteHandler.java:69)
      	at org.sakaiproject.portal.charon.SkinnableCharonPortal.doPost(SkinnableCharonPortal.java:1173)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:475)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
      	at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:747)
      	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      	at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:431)
      	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
      	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
      	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: javax.servlet.ServletException
      	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:683)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:426)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)
      	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
      	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384)
      	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
      	at org.sakaiproject.jsf.util.SamigoJsfTool.dispatch(SamigoJsfTool.java:360)
      	at org.sakaiproject.jsf2.util.JsfTool.doPost(JsfTool.java:250)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)
      	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
      	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:352)
      	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
      	at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:508)
      	... 36 more
      Caused by: java.lang.StackOverflowError
      	at java.util.regex.Pattern$GroupCurly.match(Pattern.java:4421)
      	at java.util.regex.Pattern$GroupHead.match(Pattern.java:4672)
      	at java.util.regex.Pattern$LazyLoop.match(Pattern.java:4861)
      	at java.util.regex.Pattern$GroupTail.match(Pattern.java:4731)
      	at java.util.regex.Pattern$LazyLoop.matchInit(Pattern.java:4878)
      	at java.util.regex.Pattern$Prolog.match(Pattern.java:4755)
      	at java.util.regex.Pattern$GroupCurly.match1(Pattern.java:4504)
      	at java.util.regex.Pattern$GroupCurly.match(Pattern.java:4421)
      	at java.util.regex.Pattern$GroupHead.match(Pattern.java:4672)
      	at java.util.regex.Pattern$LazyLoop.match(Pattern.java:4861)
      	at java.util.regex.Pattern$GroupTail.match(Pattern.java:4731)
      	at java.util.regex.Pattern$LazyLoop.matchInit(Pattern.java:4878)
      	at java.util.regex.Pattern$Prolog.match(Pattern.java:4755)
      	at java.util.regex.Pattern$GroupCurly.match1(Pattern.java:4504)
      	at java.util.regex.Pattern$GroupCurly.match(Pattern.java:4421)
      	at java.util.regex.Pattern$GroupHead.match(Pattern.java:4672)
      	at java.util.regex.Pattern$LazyLoop.match(Pattern.java:4861)
      	at java.util.regex.Pattern$GroupTail.match(Pattern.java:4731)
      	at java.util.regex.Pattern$LazyLoop.matchInit(Pattern.java:4878)
      	at java.util.regex.Pattern$Prolog.match(Pattern.java:4755) 

       

       

      Gliffy Diagrams

        Zeplin

          Attachments

            Issue Links

              Activity

                People

                  jesusmmp Jesus Maria Mendez
                  jesusmmp Jesus Maria Mendez
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                    Created:
                    Updated:
                    Resolved:

                    Git Integration