You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Moodle v3.10结合SCORM v1.2环境下学生考试响应存储、检索及重考限制问题咨询

Answers to Your SCORM & Moodle Questions

Let's break down your questions based on the Moodle 3.10, SCORM 1.2, and Laragon 4.0 environment you're working with:

1. Does the LMS (Moodle) store student test responses?

Yes, but it relies on two key pieces to work properly:

  • SCORM 1.2 Data Model Compliance: SCORM 1.2 includes the cmi.interactions.* data model specifically built to store student interaction data (like quiz answers, selection choices, or text inputs). Your SCORM package must explicitly write to these fields using the SCORM API when a student submits an answer. Here's a quick example:
    // Record a multiple-choice question response
    var interactionId = "question_01";
    var studentAnswer = "B";
    var answerResult = "correct";
    
    // Push data to SCORM API
    API.SetValue("cmi.interactions.0.id", interactionId);
    API.SetValue("cmi.interactions.0.type", "choice");
    API.SetValue("cmi.interactions.0.student_response", studentAnswer);
    API.SetValue("cmi.interactions.0.result", answerResult);
    API.Commit(); // Save changes to the LMS
    
  • Moodle SCORM Settings: By default, Moodle's SCORM module stores cmi.interactions data. As an admin or teacher, you can verify this by accessing the SCORM activity's Reports section and checking the "Interactions" report to view individual student responses.

If your package isn't writing to these SCORM data fields, Moodle won't save the answers — that's the first thing to troubleshoot.

2. Do you need jQuery/PHP/MySQL to restrict retakes and display submitted answers?

Restricting Retakes

Start with Moodle's built-in tools before adding custom code:

  • Moodle SCORM Activity Configuration: Go to your SCORM activity's edit page, then navigate to the Attempts Management section:
    • Set Maximum number of attempts to 1
    • Enable Prevent access if completed (under the Completion Tracking section)
  • SCORM Package Completion Status: Ensure your package sets the correct completion status when the student passes. Add this code after calculating the final score and pass/fail result:
    // Mark course as completed when student passes
    if (isStudentPassed) {
      API.SetValue("cmi.completion_status", "completed");
      API.SetValue("cmi.success_status", "passed");
      API.Commit();
    }
    

Moodle will honor these settings if the SCORM package communicates the completion status correctly. Only if you need complex retake rules (like conditional retakes based on specific criteria) would you need custom logic — even then, use Moodle's web services or hooks instead of standalone PHP/MySQL to maintain LMS integration.

Displaying Submitted Answers

You don't need external databases or PHP. Use the SCORM API to read stored cmi.interactions data and render it with JavaScript (jQuery is optional but can simplify DOM manipulation). Here's a basic implementation:

// Fetch all stored interaction data
var interactionCount = parseInt(API.GetValue("cmi.interactions._count"));
for (var i = 0; i < interactionCount; i++) {
  var questionId = API.GetValue(`cmi.interactions.${i}.id`);
  var studentResponse = API.GetValue(`cmi.interactions.${i}.student_response`);
  var answerResult = API.GetValue(`cmi.interactions.${i}.result`);

  // Populate quiz elements with saved answers using jQuery
  $(`#${questionId}`).val(studentResponse);
  $(`#${questionId}-feedback`).text(`Your answer: ${studentResponse} (${answerResult})`);
}

// Switch from quiz form to review view
$(".quiz-form").hide();
$(".review-section").show();

This code pulls saved answers from Moodle via the SCORM API, populates the quiz interface with the student's submissions, and hides the editable form in favor of a read-only review view.

Final Notes

Always prioritize using SCORM's native data model and Moodle's built-in features first — this ensures compatibility and avoids unnecessary custom code. Reserve custom tools only for edge cases that standard SCORM/Moodle functionality can't handle.

内容的提问来源于stack exchange,提问作者Max William Vitorino

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.29 04:52:33