5.1.1.7 Tests & Quizzes: Global variables in calculated questions

Description

Las preguntas calculadas son un tipo de pregunta del LMS Sakai en su herramienta Tests & Quizzes (Exámenes) que permite especificar parámetros aleatorios con valores dentro de rangos configurables y cuya solución depende de un cálculo a partir de dichos valores, con lo que la respuesta difiere para cada estudiante. Algunos cálculos deben repetirse varias veces en algunas fórmulas ocasionalmente, lo cual causa complejidad al crearlos y produce pérdida de rendimiento. El desarrollo deberá incorporar una funcionalidad que añadirá variables globales en un examen, las cuales podrán ser configuradas por el profesor con el resultado de una fórmula y utilizadas en las fórmulas posteriores de otras preguntas calculadas.


Calculated questions are a question type on the Sakai LMS on Tests & Quizzes tool that allows to specify random parameters with values within configurable ranges and whose solution depends on a calculation from these values, so the answer differs for each student.

Main problematic is than some calculations must be repeated several times in some formulas occasionally, which causes complexity when creating them and results in loss of performance. The development will incorporate a functionality which allow adding global variables in a calculated question.
This functionality should be configured by the instructor setting the global variable’s names and formulas.

 

Example:

Variables | Min | Max | Decimal places

x | 1 | 5 | 0
y | 2 | 6 | 0

Global variables | Formula

a | 3*{x}*{y}

 

Analysis and Design: https://docs.google.com/document/d/1Z-VcJGwG7iUky_3R8qOvZGxoTQz9xmqA/edit?usp=share_link&ouid=112676745722902650910&rtpof=true&sd=true
Prototype: https://github.com/jesusmmp/S2U-Prototypes/blob/main/5.1.1.7-global-variables-in-calculated-question/global-variables-in-calculated-question.md

Activity

Show:

Jesus Maria Mendez Perez February 13, 2024 at 11:03 AM

I’ll take a look asap. Thanks !

Earle Nietzel February 12, 2024 at 4:40 PM
Edited

This stack appeared accessing an assessment in Samigo:
private boolean addedButNotExtracted = false;

Standard SQL database represents a bit with 3 states: 1, 0, NULL which maps more correctly with a Boolean object vs a primitive.

Stacktrace: at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:499) caused by: java.lang.RuntimeException: org.springframework.orm.hibernate5.HibernateSystemException: Null value was assigned to a property of primitive type setter of org.sakaiproject.tool.assessment.data.dao.assessment.PublishedItemText.addedButNotExtracted; nested exception is org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of org.sakaiproject.tool.assessment.data.dao.assessment.PublishedItemText.addedButNotExtracted at org.sakaiproject.tool.assessment.ui.listener.select.SelectActionListener.processAction(SelectActionListener.java:459) caused by: org.springframework.orm.hibernate5.HibernateSystemException: Null value was assigned to a property of primitive type setter of org.sakaiproject.tool.assessment.data.dao.assessment.PublishedItemText.addedButNotExtracted; nested exception is org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of org.sakaiproject.tool.assessment.data.dao.assessment.PublishedItemText.addedButNotExtracted at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:374) caused by: org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of org.sakaiproject.tool.assessment.data.dao.assessment.PublishedItemText.addedButNotExtracted at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:694) caused by: java.lang.IllegalArgumentException at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:566) at org.hibernate.property.access.spi.SetterMethodImpl.set(SetterMethodImpl.java:45) at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:694) at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:144) at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:5281) at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntityFromEntityEntryLoadedState(TwoPhaseLoad.java:253) at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:156) at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:126) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1201) at org.hibernate.loader.Loader.processResultSet(Loader.java:1009) at org.hibernate.loader.Loader.doQuery(Loader.java:967) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:357) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:327) at org.hibernate.loader.Loader.loadCollectionBatch(Loader.java:2616) at org.hibernate.loader.collection.plan.LegacyBatchingCollectionInitializerBuilder$LegacyBatchingCollectionInitializer.initialize(LegacyBatchingCollectionInitializerBuilder.java:87) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:705) at org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:76) at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107) at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:2208) at org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:595) at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:264) at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:591) at org.hibernate.collection.internal.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:787) at org.hibernate.engine.internal.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:1005) at org.hibernate.engine.internal.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:991) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:362) at org.hibernate.loader.Loader.doList(Loader.java:2868) at org.hibernate.loader.Loader.doList(Loader.java:2850) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2682) at org.hibernate.loader.Loader.list(Loader.java:2677) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:218) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1459) at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649) at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617) at org.springframework.orm.hibernate5.HibernateTemplate.lambda$findByNamedParam$31(HibernateTemplate.java:906) at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:367) at org.springframework.orm.hibernate5.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:334) at org.springframework.orm.hibernate5.HibernateTemplate.findByNamedParam(HibernateTemplate.java:900) at org.springframework.orm.hibernate5.HibernateTemplate.findByNamedParam(HibernateTemplate.java:889) at org.sakaiproject.tool.assessment.facade.PublishedAssessmentFacadeQueries.getSectionSetForAssessment(PublishedAssessmentFacadeQueries.java:1294)

Miguel Pellicer June 22, 2023 at 10:55 AM

All the fixes have been released in QA, thanks everybody for the great work.

Jesus Maria Mendez Perez May 19, 2023 at 9:50 AM

Tested.

Miguel Pellicer May 19, 2023 at 9:49 AM

Confirmation that the main cases of the feature have been tested successfully at UM, thanks !

Fixed

Details

Components

Priority

Assignee

Reporter

Labels

Conversion Script Required

Yes
Created December 21, 2022 at 11:24 AM
Updated December 2, 2024 at 12:36 PM
Resolved May 10, 2023 at 2:45 PM

Flag notifications