0

I have a quiz in SharePoint.

It works perfectly but what I want is:

After a student have taken the quiz, I would like a list named quizlist to store information for the users who has taken the quiz to show what the score he/she got and to show the user name.

How can I do this?

  • 1
    Are you using the survey app? – Patrick Nov 11 '15 at 9:49
  • something like that – Nderon Hyseni Nov 11 '15 at 9:59
  • 1
    You should give more details about how you have implemented the quiz so far. Is it a OOTB Survey or custom implementation (SP app or PHA or page with jsom/csom etc) – Unnie Nov 11 '15 at 10:34
  • var itemCreateInfo = new SP.ListItemCreationInformation(); var listItem = resultList.addItem(itemCreateInfo); listItem.set_item("Student", UserName); listItem.set_item("TestDate", dtm); listItem.set_item("Score", (score / testQuestions) * 100); listItem.set_item("QuizID", currentQuizItem.get_id()); listItem.update(); – Nderon Hyseni Nov 11 '15 at 10:36
2

There are several ways to save information in a list. Check following and find which suites you best.

  • // Store the score for the current user var dtm = new Date(); ` var itemCreateInfo = new SP.ListItemCreationInformation();` ` var listItem = resultList.addItem(itemCreateInfo);` listItem.set_item("Student", UserName);`` listItem.set_item("TestDate", dtm); listItem.set_item("Score", (score / testQuestions) * 100); listItem.set_item("QuizID", currentQuizItem.get_id()); listItem.update(); context.load(listItem); context.executeQueryAsync(function () { $('#TestUI').fadeOut(500, function () { $('#TestReport').fadeIn(500, null) }); }, howto store? – Nderon Hyseni Nov 11 '15 at 9:59
  • add some description in your comment. what do you mean? add this code in your question. it is not readable from comment – Atish Dipongkor - MVP Nov 11 '15 at 10:02
  • i have the following method inside of my code i have to modify this code and to store my information on my desire list! – Nderon Hyseni Nov 11 '15 at 10:06
  • Is it your code or you got it from somewhere? – grisha Nov 11 '15 at 10:35
  • yes from microsoft – Nderon Hyseni Nov 11 '15 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.