Picture of Marie-Eve Levesque
Question IDs in Assessment
by Marie-Eve Levesque - Thursday, 4 January 2024, 8:23 PM
 

Hello,

I've successfully created an assessment in Adapt for publication on Saba, and it's functioning well. However, when users attempt to view their results in Saba, they see 'interaction IDs' (equivalent to question IDs) presented as generated numbers, such as: 65770f69b8a61439708c9c71

I've noticed that these interaction/question IDs are defined in the components.json file.

Despite not being a programmer, I'm wondering if there's a possibility or easy way to override these question IDs with more user-friendly labels, like Question 1, Question 2, Question 3, and so on. Is this feasible?

BIG THANK YOU :)

JSON file ---



In Saba ---

Picture of Marie-Eve Levesque
Re: Question IDs in Assessment
by Marie-Eve Levesque - Thursday, 4 January 2024, 9:04 PM
 

json file and Saba screenshot



Picture of Ignacio Cinalli
Re: Question IDs in Assessment
by Ignacio Cinalli - Friday, 5 January 2024, 6:13 PM
 

Hi Marie-Eve,
I'm not sure if this is the best way, but you can do it by modifying the adapt-contrib-spoor extension.
Modify the recordInteractionScorm12 and recordInteractionScorm2004 functions as follows:

recordInteractionScorm12(id, response, correct, latency, type) {
    id = id.trim();
    const titleId =
      Data.findById(id)
        .get('title')
        .replace(/[^a-zA-Z0-9]/g, '_')
        .toLowerCase() || id;

    const cmiPrefix = `cmi.interactions.${this.getInteractionCount()}`;

    this.setValue(`${cmiPrefix}.id`, titleId);
    this.setValue(`${cmiPrefix}.type`, type);
    this.setValue(`${cmiPrefix}.student_response`, response);
    this.setValue(`${cmiPrefix}.result`, correct ? 'correct' : 'wrong');
    if (latency !== null && latency !== undefined) this.setValue(`${cmiPrefix}.latency`, this.convertToSCORM12Time(latency));
    this.setValue(`${cmiPrefix}.time`, this.getCMITime());
  }

  recordInteractionScorm2004(id, response, correct, latency, type) {
    id = id.trim();
    const titleId =
      Data.findById(id)
        .get('title')
        .replace(/[^a-zA-Z0-9]/g, '_')
        .toLowerCase() || id;
    const cmiPrefix = `cmi.interactions.${this.getInteractionCount()}`;

    this.setValue(`${cmiPrefix}.id`, titleId);
    this.setValue(`${cmiPrefix}.type`, type);
    this.setValue(`${cmiPrefix}.learner_response`, response);
    this.setValue(`${cmiPrefix}.result`, correct ? 'correct' : 'incorrect');
    if (latency !== null && latency !== undefined) this.setValue(`${cmiPrefix}.latency`, this.convertToSCORM2004Time(latency));
    this.setValue(`${cmiPrefix}.timestamp`, this.getISO8601Timestamp());
  } 

This will allow you to use the component/question title instead of the ID.

Hope this helps!