Skip to content

Improve the Exam Page #46

@arjunsuresh

Description

@arjunsuresh

When Exam taken results are available on the exam page, currently the exam data is embedded in the HTML. It'll be better if we only embed the resultid and then fetch the exam data on the button click like in the below code.

$('.results-btn').on('click', function () {
  const examId = this.dataset.examId;
  const resultId = this.dataset.resultId;

  // Fetch heavy data via AJAX
  fetch(`/exam/result.php?id=${resultId}`)
    .then(r => r.json())
    .then(data => {
      console.log(data);
    });
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions