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

Error saving T&Q responses for other questions after numeric validation failure

    XMLWordPrintable

    Details

    • 19 status:
      Verified
    • 12 status:
      Verified
    • Test Plan:
      Hide

      As instructor in a site, in T&Q, import the attached assessment. Publish the assessment. Note that the assessment is timed (10 min) and all questions are on one page.

      As a student in the site, in T&Q

      • take the published assessment. In the first question (fill-in-the-blank numeric) enter "invalid" as the response (next to Fill in a value here). Click Save to attempt to save the assessment. Note the validation error.
      • Answer questions 2 (select an MCQ response) and 3 (type in some short text). Attempt to Save the assessment (click Save). Attempt to submit the assessment (click Submit for Grading).
      • Wait for the timer to expire and the assessment to be auto-submitted.

      As an instructor in the site, view submitted responses for the assessment. Export spreadsheet of responses. Note that no answer has been saved for question 2 or 3. Clicking on student name under Total Scores produces a further error (bug report).

      Tested on 12.x nightly as 19.x and master have other T&Q issues preventing testing. Testing on 19.1 instance https://qa1-us.nightly.sakaiproject.org/portal shows the same functional problem (other question answers are not saved), but does not have the same Hibernate errors in the logs.

      Show
      As instructor in a site, in T&Q, import the attached assessment. Publish the assessment. Note that the assessment is timed (10 min) and all questions are on one page. As a student in the site, in T&Q take the published assessment. In the first question (fill-in-the-blank numeric) enter "invalid" as the response (next to Fill in a value here). Click Save to attempt to save the assessment. Note the validation error. Answer questions 2 (select an MCQ response) and 3 (type in some short text). Attempt to Save the assessment (click Save). Attempt to submit the assessment (click Submit for Grading). Wait for the timer to expire and the assessment to be auto-submitted. As an instructor in the site, view submitted responses for the assessment. Export spreadsheet of responses. Note that no answer has been saved for question 2 or 3. Clicking on student name under Total Scores produces a further error (bug report). Tested on 12.x nightly as 19.x and master have other T&Q issues preventing testing. Testing on 19.1 instance https://qa1-us.nightly.sakaiproject.org/portal shows the same functional problem (other question answers are not saved), but does not have the same Hibernate errors in the logs.

      Description

      The errors below were seen in the logs for multiple students. It appears to be related to submitting responses with multiple questions on one page, at least one fill-in-the-blank numeric response question with invalid input that causes a validation error, autosave enabled and timed assessments.

      In both cases, no answers were saved for a number of questions in the database, although the students had answered all questions.

      The unique key violation is this:

      SAM_ITEMGRADING_T:
      UNIQUE KEY `ASSESSMENTGRADINGID` (`ASSESSMENTGRADINGID`,`PUBLISHEDITEMID`,`PUBLISHEDITEMTEXTID`,`AGENTID`,`PUBLISHEDANSWERID`)

      2019-05-23 14:28:53,914 ERROR ajp-nio-8009-exec-734 org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Duplicate entry '3084674-1935554-2319597-d3fba611-4d63-4bf4-b394-321d1891e145-102' for key 'ASSESSMENTGRADINGID'
      2019-05-23 14:28:53,914  WARN ajp-nio-8009-exec-734 org.sakaiproject.tool.assessment.facade.AssessmentGradingFacadeQueries - problem inserting/updating assessmentGrading: could not execute statement; SQL [n/a]; constraint [ASSESSMENTGRADINGID]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
      2019-05-23 14:28:53,914  WARN ajp-nio-8009-exec-734 org.sakaiproject.tool.assessment.services.PersistenceHelper - Error saving to db...retry again....
      2019-05-23 14:28:53,914  WARN ajp-nio-8009-exec-734 org.sakaiproject.tool.assessment.services.PersistenceHelper - could not execute statement; SQL [n/a]; constraint [ASSESSMENTGRADINGID]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
      2019-05-23 14:28:53,915 ERROR ajp-nio-8009-exec-734 org.hibernate.AssertionFailure - HHH000099: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session): org.hibernate.AssertionFailure: null id in org.sakaiproject.tool.assessment.data.dao.grading.ItemGradingData entry (don't flush the Session after an exception occurs)
      2019-05-23 14:28:53,918 ERROR ajp-nio-8009-exec-734 org.sakaiproject.tool.assessment.services.GradingService - null id in org.sakaiproject.tool.assessment.data.dao.grading.ItemGradingData entry (don't flush the Session after an exception occurs)
      org.hibernate.AssertionFailure: null id in org.sakaiproject.tool.assessment.data.dao.grading.ItemGradingData entry (don't flush the Session after an exception occurs)
              at org.hibernate.event.internal.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:77)
              at org.hibernate.event.internal.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:192)
              at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:152)
              at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:231)
              at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:102)
              at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:55)
              at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1258)
              at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:425)
              at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)
              at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:177)
              at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:584)
              at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)
              at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)
              at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:518)
              at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:292)
              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
              at com.sun.proxy.$Proxy149.saveOrUpdateAssessmentGrading(Unknown Source)
              at org.sakaiproject.tool.assessment.services.GradingService.saveOrUpdateAssessmentGrading(GradingService.java:691)
              at org.sakaiproject.tool.assessment.ui.bean.delivery.DeliveryBean.syncTimeElapsedWithServer(DeliveryBean.java:3052)
              at org.sakaiproject.tool.assessment.ui.bean.delivery.DeliveryBean.submitForGrade(DeliveryBean.java:1602)
              at org.sakaiproject.tool.assessment.ui.bean.delivery.DeliveryBean.submitForGradeFromTimer(DeliveryBean.java:1557)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.apache.el.parser.AstValue.invoke(AstValue.java:247)
              at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:267)
              at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:74)
              at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
              at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
              at javax.faces.component.UICommand.broadcast(UICommand.java:387)
              at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
              at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
              at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
              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:52)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at com.corejsf.UploadFilter.doFilter(UploadFilter.java:131)
              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:418)
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  farreri Miguel Pellicer
                  Reporter:
                  smarquard Stephen Marquard
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code