コード例 #1
0
    test('omits the anonymous ID if both flavors of ID are available', () => {
      const rubric = createRubric(`
        <div class="user_id">100</div>
        <div class="anonymous_id">81bc2</div>
      `)
      const data = rubric_assessment.assessmentData(rubric)

      strictEqual(data['rubric_assessment[anonymous_id]'], undefined)
    })
コード例 #2
0
    test('returns the user ID if both flavors of ID are available', () => {
      const rubric = createRubric(`
        <div class="user_id">100</div>
        <div class="anonymous_id">81bc2</div>
      `)
      const data = rubric_assessment.assessmentData(rubric)

      strictEqual(data['rubric_assessment[user_id]'], '100')
    })
コード例 #3
0
    test('returns the anonymous ID if one exists in the submitted rubric', () => {
      const rubric = createRubric(`<div class="anonymous_id">81bc2</div>`)
      const data = rubric_assessment.assessmentData(rubric)

      strictEqual(data['rubric_assessment[anonymous_id]'], '81bc2')
    })
コード例 #4
0
    test('returns the anonymous ID if anonymous_id exists in the environment', () => {
      ENV.RUBRIC_ASSESSMENT.anonymous_id = '7a8c1'
      const data = rubric_assessment.assessmentData(createRubric())

      strictEqual(data['rubric_assessment[anonymous_id]'], '7a8c1')
    })
コード例 #5
0
    test('returns the user ID if one exists in the submitted rubric', () => {
      const rubric = createRubric(`<div class="user_id">234</div>`)
      const data = rubric_assessment.assessmentData(rubric)

      strictEqual(data['rubric_assessment[user_id]'], '234')
    })
コード例 #6
0
    test('returns the user ID if assessment_user_id exists in the environment', () => {
      ENV.RUBRIC_ASSESSMENT.assessment_user_id = '123'
      const data = rubric_assessment.assessmentData(createRubric())

      strictEqual(data['rubric_assessment[user_id]'], '123')
    })