تقنية

كيفية الحصول على نتيجة الاختبار في نماذج Google باستخدام Apps Script


يمكن للمدرسين استخدام نماذج Google لإنشاء اختبار عبر الإنترنت ويمكن للطلاب عرض نتائج الاختبار مباشرة بعد إرسال النموذج. باستخدام Apps Script، يمكنك إعداد إشعارات البريد الإلكتروني التلقائية وإرسال نتائج الاختبار إلى أولياء الأمور بعد قيام الطالب بإجراء الاختبار.

فيما يلي نموذج لبرنامج Google Script الذي سيتكرر خلال كل إجابة في أحدث استجابة لنموذج Google ويسجل الحد الأقصى من النقاط (النقاط) للسؤال القابل للتقدير ودرجة الإجابة المقدمة من المستجيب.

function getGoogleFormQuizScore() {
  // Returns the form to which the script is container-bound.
  var form = FormApp.getActiveForm();

  // Get the most recently submitted form response
  var response = form.getResponses().reverse()[0];

  // Gets an array of all items in the form.
  var items = form.getItems();

  for (var i = 0; i < items.length; i++) {
    var question = items[i];

    // Get the item's title text
    var qTitle = question.getTitle();

    // Get the item's type like Checkbox, Multiple Choice, Grid, etc.
    var qType = question.getType();

    // Gets the item response contained in this form response for a given item.
    var responseForItem = response.getResponseForItem(question);

    //Gets the answer that the respondent submitted.
    var answer = responseForItem ? responseForItem.getResponse() : null;

    var item = castQuizItem_(question, qType);

    // Quiz Score and Maximum Points are not available
    // for Checkbox Grid and Multiple Choice Grid questions
    // through they are gradable in the Google Form

    if (item && typeof item.getPoints === "function") {
      var maxScore = item.getPoints();
      var gradableResponseForItem = response.getGradableResponseForItem(question);
      var score = gradableResponseForItem.getScore();

      Logger.log(String(qType), qTitle, answer, maxScore, score);
    }
  }
}

يمكن لـ Google Forms API عرض النتائج لأسئلة نمط الاختيار من متعدد والقائمة المنسدلة ومربع الاختيار فقط. ولا يمكنه توفير درجات لنوع الأسئلة الشبكية حيث يتم تقديم العنصر كشبكة من الصفوف والأعمدة.

  1. Checkbox Grid – عنصر سؤال يسمح للمستجيب بتحديد خيارات متعددة لكل صف من سلسلة من مربعات الاختيار.
  2. شبكة الاختيار – عنصر سؤال يسمح للمستجيب بتحديد خيار واحد لكل صف من سلسلة من أزرار الاختيار.
function castQuizItem_(item, itemType) {
  if (itemType === FormApp.ItemType.CHECKBOX) {
    return item.asCheckboxItem();
  }
  if (itemType === FormApp.ItemType.DATE) {
    return item.asDateItem();
  }
  if (itemType === FormApp.ItemType.DATETIME) {
    return item.asDateTimeItem();
  }
  if (itemType === FormApp.ItemType.DURATION) {
    return item.asDurationItem();
  }
  if (itemType === FormApp.ItemType.LIST) {
    return item.asListItem();
  }
  if (itemType === FormApp.ItemType.MULTIPLE_CHOICE) {
    return item.asMultipleChoiceItem();
  }
  if (itemType === FormApp.ItemType.PARAGRAPH_TEXT) {
    return item.asParagraphTextItem();
  }
  if (itemType === FormApp.ItemType.SCALE) {
    return item.asScaleItem();
  }
  if (itemType === FormApp.ItemType.TEXT) {
    return item.asTextItem();
  }
  if (itemType === FormApp.ItemType.TIME) {
    return item.asTimeItem();
  }
  if (itemType === FormApp.ItemType.GRID) {
    return item.asGridItem();
  }
  if (itemType === FormApp.ItemType.CHECKBOX_GRID) {
    return item.asCheckboxGridItem();
  }
  if (itemType === FormApp.ItemType.PAGE_BREAK) {
    return item.asPageBreakItem();
  }
  if (itemType === FormApp.ItemType.SECTION_HEADER) {
    return item.asSectionHeaderItem();
  }
  if (itemType === FormApp.ItemType.VIDEO) {
    return item.asVideoItem();
  }
  if (itemType === FormApp.ItemType.IMAGE) {
    return item.asImageItem();
  }
  return null;
}

مسابقة في نماذج جوجل مع النتيجة



Source link


اكتشاف المزيد من مرابع التكنولوجيا

اشترك للحصول على أحدث التدوينات المرسلة إلى بريدك الإلكتروني.

اترك تعليقاً

لن يتم نشر عنوان بريدك الإلكتروني. الحقول الإلزامية مشار إليها بـ *

زر الذهاب إلى الأعلى

اكتشاف المزيد من مرابع التكنولوجيا

اشترك الآن للاستمرار في القراءة والحصول على حق الوصول إلى الأرشيف الكامل.

Continue reading