Ejemplo n.º 1
0
$(() => {
  const $el = $('#assignment_publish_button')
  if ($el.length > 0) {
    const model = new Assignment({
      id: $el.attr('data-id'),
      unpublishable: !$el.hasClass('disabled'),
      published: $el.hasClass('published')
    })
    model.doNotParse()

    new SpeedgraderLinkView({model, el: '#assignment-speedgrader-link'})
        .render()
    const pbv = new PublishButtonView({model, el: $el})
    pbv.render()

    pbv.on('publish', () => $('#moderated_grading_button').show())

    pbv.on('unpublish', () => $('#moderated_grading_button').hide())
  }

    // Add module sequence footer
  $('#sequence_footer').moduleSequenceFooter({
    courseID: ENV.COURSE_ID,
    assetType: 'Assignment',
    assetID: ENV.ASSIGNMENT_ID,
    location
  })

  return vddTooltip()
})
Ejemplo n.º 2
0
    , [])

    return QuizOverrideLoader.loadQuizOverrides(quizModels, ENV.URLS.assignment_overrides)
  },

  createQuizItemGroupView (collection, title, type) {
    const { options } = this.allQuizzes

    // get quiz attributes from root container and add options
    return new QuizItemGroupView({
      collection: new QuizCollection(_.map(collection, quiz =>
        $.extend(quiz, options[quiz.id]))
      ),
      isSurvey: type === 'surveys',
      listId: `${type}-quizzes`,
      title,
      toggleMessage: this.translations.toggleMessage
    })
  },

  shouldLoadOverrides () {
    return true
  }
})

// Start up the page
const router = new QuizzesIndexRouter()
Backbone.history.start()

vddTooltip()