Skip to content
Snippets Groups Projects

WIP: Submission notes

Closed Jan Maximilian Michal requested to merge submission-notes into master
All threads resolved!
6 files
+ 92
46
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -18,6 +18,7 @@
<script>
import {mapGetters, mapState} from 'vuex'
import CommentForm from '@/components/submission_notes/FeedbackForm.vue'
import FeedbackComment from '@/components/submission_notes/FeedbackComment.vue'
@@ -26,46 +27,18 @@
FeedbackComment,
CommentForm},
name: 'annotated-submission',
beforeCreate () {
this.$store.dispatch('getFeedback', 0)
this.$store.dispatch('getSubmission', 0)
},
computed: {
submission () {
return this.source.split('\n').reduce((acc, cur, index) => {
acc[index + 1] = cur
return acc
}, {})
}
...mapState({
feedback: state => state.submissionNotes.feedback
}),
...mapGetters(['submission'])
},
data: function () {
return {
source: '//Procedural Programming technique shows creation of Pascal\'s Triangl\n' +
'#include <iostream>\n' +
'#include <iomanip>\n' +
'using namespace std;\n' +
'int** comb(int** a , int row , int col)\n' +
'{\n' +
' int mid = col/2;\n' +
' //clear matrix\n' +
' for( int i = 0 ; i < row ; i++)\n' +
' for( int j = 0 ; j < col ; j++)\n' +
' a[i][j] = 0;\n' +
' a[0][mid] = 1; //put 1 in the middle of first row\n' +
' //build up Pascal\'s Triangle matrix\n' +
' for( int i = 1 ; i < row ; i++)\n' +
' {\n' +
' for( int j = 1 ; j < col - 1 ; j++)\n' +
' a[i][j] = a[i-1][j-1] + a[i-1][j+1];\n' +
' }\n' +
' return a;\n' +
'}\n' +
'void disp(int** ptr, int row, int col)\n' +
'{\n' +
' cout << endl << endl;\n' +
' for ( int i = 0 ; i < row ; i++)\n' +
' {\n' +
' for ( int j = 0 ; j < col ; j++)\n',
feedback: {
'1': 'Youre STUPID',
'4': 'Very much so'
},
showEditorOnLine: { }
}
},
Loading